[OpenJDK 2D-Dev] [9] RFR JDK-8166685: We should unpin stream and pixel buffer in case of setjmp during writeImage in JPEG.

Jayathirth D V jayathirth.d.v at oracle.com
Mon Sep 26 10:01:36 UTC 2016


Hi Prasanta,

 

There is no need to call RELEASE_ARRAYS() at 

2934         return data->abortFlag;

 

We have not yet pinned(GET_ARRAYS()) the needed buffers. Only in case of setjmp we need because while writing if we get call to sun_jpeg_error_exit()(which is overridden function for IJG error_exit()) we call longjmp() and it throws IOException in writeImage(). Before this we need to call RELEASE_ARRAYS().

 

Thanks,

Jay

 

From: Prasanta Sadhukhan 
Sent: Monday, September 26, 2016 3:22 PM
To: Jayathirth D V; Philip Race; 2d-dev
Subject: Re: [OpenJDK 2D-Dev] [9] RFR JDK-8166685: We should unpin stream and pixel buffer in case of setjmp during writeImage in JPEG.

 

looks ok. 
Additionally, 
Shouldn't we call RELEASE_ARRAYS before

2934         return data->abortFlag;

Regards
Prasanta

On 9/26/2016 1:05 PM, Jayathirth D V wrote:

Hi,

 

Please review the following fix in JDK9 at your convenience:

 

Bug : https://bugs.openjdk.java.net/browse/JDK-8166685 

 

Webrev : HYPERLINK "http://cr.openjdk.java.net/%7Ejdv/8166685/webrev.00/"http://cr.openjdk.java.net/~jdv/8166685/webrev.00/ 

 

Issue : As part of fix for JDK- 8162461 we removed RELEASE_ARRAYS() in writeImage() call in imageioJPEG.c for setjmp case.

 

Root cause : We can perform non-local jump to setjmp from longjmp during anytime in write process. If there is no RELEASE_ARRAYS() call then it might crash JVM as it was happening in JDK- 8162461.

 

Solution : We should have RELEASE_ARRAYS() call in setjmp case for writeImage() in imageioJPEG.c.

 

Thanks,

Jay

 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20160926/359700ff/attachment.html>


More information about the 2d-dev mailing list