Bug 120764 - [Win][WebGL] Crash on exit
Summary: [Win][WebGL] Crash on exit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Unspecified
: P2 Normal
Assignee: Nobody
URL: http://media.tojicode.com/q3bsp/
Keywords: PlatformOnly
Depends on:
Blocks:
 
Reported: 2013-09-05 03:58 PDT by peavo
Modified: 2013-10-04 09:51 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.58 KB, patch)
2013-09-05 04:09 PDT, peavo
no flags Details | Formatted Diff | Diff
Patch (2.54 KB, patch)
2013-10-04 06:13 PDT, peavo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description peavo 2013-09-05 03:58:05 PDT
Everytime I have visited a page with WebGL content, I get a crash on exit (NULL pointer access violation).

I believe the reason for the crash is that the libGLESv2.dll is detached from the process at exit,
and releases relevant memory, and then the atexit cleanup routine is called afterwards, accessing the released memory. 


This is the stacktrace I'm getting:

 	libGLESv2.dll!0588787f() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for libGLESv2.dll]	
 	libGLESv2.dll!05893fdc() 	
	WebKit.dll!WebCore::GLContextEGL::~GLContextEGL()  Line 236	C++
 	WebKit.dll!WebCore::GLContextEGL::`scalar deleting destructor'()  + 0xb bytes	C++
 	WebKit.dll!WebCore::GLContext::cleanupActiveContextsAtExit()  Line 140	C++
 	WebKit.dll!_CRT_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved)  Line 415	C
 	WebKit.dll!__DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved)  Line 526 + 0x8 bytes	C
 	WebKit.dll!_DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved)  Line 476 + 0xe bytes	C
Comment 1 peavo 2013-09-05 04:09:08 PDT
Created attachment 210598 [details]
Patch
Comment 2 Martin Robinson 2013-10-03 14:14:02 PDT
Nice catch. This can probably be surrounded by PLATFORM(X11) actually. Looks like the activeContextList is unused otherwise? That can go into the #ifdef as well, i guess.
Comment 3 peavo 2013-10-04 06:13:33 PDT
Created attachment 213356 [details]
Patch
Comment 4 peavo 2013-10-04 06:14:55 PDT
(In reply to comment #2)
> Nice catch. This can probably be surrounded by PLATFORM(X11) actually. Looks like the activeContextList is unused otherwise? That can go into the #ifdef as well, i guess.

Thanks for looking into this, I have updated the patch accordingly :)
This should also reduce code size for other platforms.
Comment 5 Martin Robinson 2013-10-04 09:10:44 PDT
Comment on attachment 213356 [details]
Patch

Thanks!
Comment 6 WebKit Commit Bot 2013-10-04 09:14:14 PDT
Comment on attachment 213356 [details]
Patch

Clearing flags on attachment: 213356

Committed r156893: <http://trac.webkit.org/changeset/156893>
Comment 7 WebKit Commit Bot 2013-10-04 09:14:16 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 peavo 2013-10-04 09:51:13 PDT
(In reply to comment #5)
> (From update of attachment 213356 [details])
> Thanks!

Thanks for reviewing ;)