[OpenJDK 2D-Dev] RFR: JDK-8057830: Crash in Java2D Queue Flusher, OGLSD_SetScratchSurface

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Mon Oct 27 16:44:32 UTC 2014


Hi, Hendrik.
The fix looks good.
webrev: http://cr.openjdk.java.net/~serb/Hendrik/8057830/webrev

However, before we can accept fixes from you, you will need to have an 
OCA signed. Please find more details here:
http://www.oracle.com/technetwork/community/oca-486395.html


On 22.09.2014 12:19, Hendrik Schreiber wrote:
> Hi,
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8057830
>
> On OS X, CGLGraphicsConfigInfo is destroyed by OGLGC_DestroyOGLGraphicsConfig, however the pointer to it still hangs around for a while and is not reset to NULL, until we get rid of it with a Disposer later on.
>
> In the meantime it appears to be possible that OGLSD_SetScratchSurface is called with the already destroyed CGLGraphicsConfigInfo as argument. The CGLGraphicsConfigInfo is not NULL, but its structs are in a bad state, most likely freed, leading to the observed crash.
>
> The suggested change does not solve the problem, of needing to NULL the pointer to CGLGraphicsConfigInfo right where it's destroyed in OGLRenderQueue.c (not really possible IMO). However, it improves the destruction by NULLing some of it struct members and thus allowing us in OGLSD_SetScratchSurface to test those for NULL values. I also added a trace call for when this happens, to aiding potentially creating a better fix in the future.
>
> Unfortunately, I have not been able to come up with a reasonable unit test for this, therefore I cannot be certain that it solves the problem. However, as the changes are minimal and obviously harmless, I would very much appreciate it, if somebody decided to sponsor and commit this patch. I have a live application out there based on 8u20 and this is the number one reason for user-reported crashes.
>
> Webrev: https://www.beatunes.com/download/webrev_8057830.zip
>
> I did a full clean OS X build to test the change. Before and after I encountered the same 11 jdk_2d failures (which made me wonder whether that is normal...).
>
> Cheers,
>
> -hendrik
>
> PS: I'm new to contributing OpenJDK patches, let me know, if I should have done it some other way. Thanks.


-- 
Best regards, Sergey.




More information about the 2d-dev mailing list