Bug 109427 - Web Inspector: stack trace is cut at native bind if inspector is closed
Summary: Web Inspector: stack trace is cut at native bind if inspector is closed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-11 06:52 PST by Yury Semikhatsky
Modified: 2013-02-12 01:22 PST (History)
16 users (show)

See Also:


Attachments
Patch (9.91 KB, patch)
2013-02-11 06:58 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Sample page (371 bytes, text/html)
2013-02-11 07:32 PST, Yury Semikhatsky
no flags Details
Patch (5.14 KB, patch)
2013-02-11 08:21 PST, Yury Semikhatsky
pfeldman: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2013-02-11 06:52:46 PST
If inspector front-end is closed when uncaught exception is thrown, stack trace will be trimmed at the top bound function. In the attached page top function will be 'b' while there should be 'baz' and 'throwUndefined' above it.
Comment 1 Yury Semikhatsky 2013-02-11 06:58:13 PST
Created attachment 187563 [details]
Patch
Comment 2 Yury Semikhatsky 2013-02-11 07:02:34 PST
There use to be no stack traces if inspector front-end was closed when uncaught exception was thrown. That behavior changed after refactoring of the mechanism how console collects stack traces. Uncaught exception should be rare as they are errors in the applications. I think we it would be a reasonable tradeoff to sacrifice performance for better diagnostic in those cases.
Comment 3 Pavel Feldman 2013-02-11 07:27:56 PST
Why did this work before? This will make js engine run way more code than it used to upon exceptions. It sounds like you are avoiding the problem instead of fixing the regression.
Comment 4 Yury Semikhatsky 2013-02-11 07:32:56 PST
Created attachment 187569 [details]
Sample page
Comment 5 Pavel Feldman 2013-02-11 07:35:30 PST
Comment on attachment 187563 [details]
Patch

I am sorry, but neither from the bug thread nor from the changelog it is clear what the problem is and why this is the right solution to it.
Comment 6 Yury Semikhatsky 2013-02-11 07:37:54 PST
(In reply to comment #3)
> Why did this work before?
It didn't. We used to collect only top stack frame when there was no front-end. After Mike's refactorings the behavior changed and we started to collect stack trace even with closed front-end but since the place where the stack is collected moved the stack collected while front-end is closed will be trimmed in some cases like in the example with native bind.

> This will make js engine run way more code than it used to upon exceptions. It sounds like you are avoiding the problem instead of fixing the regression.

This is a case of uncaught exception which was thrown and not handled by any try catch or global onerror handler so I would assume it to be uncommon one.
Comment 7 Yury Semikhatsky 2013-02-11 08:21:05 PST
Created attachment 187577 [details]
Patch
Comment 8 Build Bot 2013-02-11 11:33:29 PST
Comment on attachment 187577 [details]
Patch

Attachment 187577 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/16495302

New failing tests:
http/tests/inspector-enabled/console-exception-while-no-inspector.html
Comment 9 Yury Semikhatsky 2013-02-12 01:22:31 PST
Committed r142594: <http://trac.webkit.org/changeset/142594>