Bug 21221

Summary: Crash when using console.trace()
Product: WebKit Reporter: Kevin McCullough <kmccullough>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Severity: Normal CC: keishi, kmccullough, timothy
Priority: P2 Keywords: Regression
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
fixed minor mistake
eric: review-
patch kmccullough: review-

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.