Bug 16842 - Hang in DRT in leaks mode due to signal handler doing unsafe things
Summary: Hang in DRT in leaks mode due to signal handler doing unsafe things
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-11 11:03 PST by Mark Rowe (bdash)
Modified: 2008-01-11 11:05 PST (History)
0 users

See Also:


Attachments
Sample from buildbot showing this hang occurring (6.17 KB, text/plain)
2008-01-11 11:03 PST, Mark Rowe (bdash)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Rowe (bdash) 2008-01-11 11:03:09 PST
static void crashHandler(int sig)
{
    fprintf(stderr, "%s\n", strsignal(sig));
    restoreColorSpace(0);
    exit(128 + sig);
}


If "crashHandler" is triggered from within malloc/realloc/free then any calls to those functions may deadlock on a malloc lock.  "restoreColorSpace" can run arbitrary system code, and "exit" will lead to C++ destructors being called on global objects. Both of these could result in a malloc-related function being called.
Comment 1 Mark Rowe (bdash) 2008-01-11 11:03:55 PST
Created attachment 18395 [details]
Sample from buildbot showing this hang occurring
Comment 2 Mark Rowe (bdash) 2008-01-11 11:05:15 PST
I think that to call restoreColorSpace safely in the event of a crash it would need to be moved to a parent process that executes the real DRT.  "_exit" can probably be used in place of "exit" to avoid the problems with that call.