Bug 142191

Summary: Exception stack unwinding in JSC hangs while the Timeline Profiler is enabled
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: burg, joepeck, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 142189    
Bug Blocks:    
Attachments:
Description Flags
the patch. ggaren: review+

Description Mark Lam 2015-03-02 15:20:06 PST
Imagine a scenario where the Inspector is paused / suspended at a breakpoint or while the user is stepping through code.  The user then tries to evaluate an expression in the console, and that evaluation results in an exception being thrown.  Currently, if the Timeline Profiler is enabled while this exception is being thrown, the WebProcess will hang while trying to handle that exception.

The issue is that the Timeline Profiler's ProfileGenerator::didExecute() will return early and decline to process ProfileNodes if the Inspector is paused.  This is proper because it does not want to count work done for injected scripts (e.g. from the console) towards the timeline profile of the webpage being run.  However, this is in conflict with ProfileGenerator::exceptionUnwind()'s expectation that didExecute() will process ProfileNodes in order to do the stack unwinding for the exception handling.  As a result, ProfileGenerator::exceptionUnwind() hangs.

ProfileGenerator::exceptionUnwind() is in error.  While the Inspector is paused, there will not be any ProfileNodes that it needs to "unwind".  Hence, the fix is simply to return early also in ProfileGenerator::exceptionUnwind() if the Inspector is paused.
Comment 1 Mark Lam 2015-03-02 15:21:37 PST
<rdar://problem/19891850>
Comment 2 Mark Lam 2015-03-02 15:54:44 PST
Created attachment 247709 [details]
the patch.
Comment 3 Geoffrey Garen 2015-03-02 16:14:26 PST
Comment on attachment 247709 [details]
the patch.

r=me
Comment 4 Mark Lam 2015-03-02 16:30:12 PST
Thanks for the review.  Landed in r180907: <http://trac.webkit.org/r180907>.

Sorry for the botched commit message.  Should have re-checked the diffs after I svn up'ed.