On Fri, 24 May 2024 08:37:25 GMT, Jayathirth D V <j...@openjdk.org> wrote:

> In IJG library's jmemmgr.c file we can define MEM_STATS(by default this flag 
> is disabled and we don't see this issue) to enable printing of memory trace 
> logs when we have OOM. But if we enable it we get crash while disposing IJG 
> stored objects in jmemmgr->free-pool() function.
> 
> This is happening because we delete the error handler before we actually 
> start deleting IJG stored objects and while freeing the IJG objects we try to 
> access cinfo->err->trace_level of error handler. This early deletion of error 
> handler is happening in imageioJPEG.c->imageio_dispose() function.
> 
> Moved the logic to delete error handler after we are done with deleting IJG 
> stored objects, after this change there is no crash. There is no regression 
> test because this issue is seen only when we enable MEM_STATS flag in IJG 
> library. Ran jtreg ImageIO tests with code update and i don't see any 
> regressions.
> 
> I have verified that this issue doesn't effect SplashScreen code path and 
> disposing of IJG objects is handled differently in SplashScreen.

This pull request has now been integrated.

Changeset: ca307263
Author:    Jayathirth D V <j...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/ca3072635215755766575b4eb70dc6267969a550
Stats:     5 lines in 1 file changed: 2 ins; 2 del; 1 mod

8332866: Crash in ImageIO JPEG decoding when MEM_STATS in enabled

Reviewed-by: abhiscxk, psadhukhan

-------------

PR: https://git.openjdk.org/jdk/pull/19386

Reply via email to