Bug 21221 - Crash when using console.trace()
Summary: Crash when using console.trace()
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Keywords: Regression
Depends on:
Reported: 2008-09-29 13:31 PDT by Kevin McCullough
Modified: 2009-07-09 00:24 PDT (History)
3 users (show)

See Also:

patch (1.44 KB, patch)
2008-09-29 22:32 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
fixed minor mistake (1.25 KB, patch)
2008-09-29 22:36 PDT, Keishi Hattori
eric: review-
Details | Formatted Diff | Diff
patch (2.09 KB, patch)
2008-09-30 05:51 PDT, Keishi Hattori
kmccullough: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin McCullough 2008-09-29 13:31:32 PDT
If I open the WebInspector and type "console.trace()" the inspector will crash.  It should probably do nothing.

Maybe if we were broken in the script debugger it should show a back trace, but normally it seems meaningless.

Sorry my debugger is sucking and I don't have a backtrace.
Comment 1 Timothy Hatcher 2008-09-29 19:39:04 PDT
I think it is crashing because the console uses eval(). Just a hunch.
Comment 2 Keishi Hattori 2008-09-29 22:32:36 PDT
Created attachment 23930 [details]

Checking if the caller function is 0 was missing.
Comment 3 Keishi Hattori 2008-09-29 22:36:04 PDT
Created attachment 23931 [details]
fixed minor mistake

fixed mistake
Comment 4 Eric Seidel (no email) 2008-09-29 22:53:11 PDT
Comment on attachment 23931 [details]
fixed minor mistake

This should have a layout test and use if (!func) to comply with the style guidelines.
Comment 5 Keishi Hattori 2008-09-30 05:51:58 PDT
Created attachment 23939 [details]

I wasn't sure how to write a layout test so I wrote a manual test. What is the difference between a layout test and a manual test?
Comment 6 Kevin McCullough 2008-09-30 12:03:49 PDT
Comment on attachment 23939 [details]

I was able to replicate the error by having a script tag with nothing in it but "console.trace()".  Since that case does not require a manual action we can make an automated layout test instead of a manual test.

To see many examples of layout tests look in the LayoutTests/fast/ directory.
Comment 7 Devin Torres 2008-10-01 09:32:50 PDT
Try console.trace(console) in the Web Inspector. Or console.trace(function(){}). Anything will crash it.