Closed
Bug 609687
Opened 14 years ago
Closed 14 years ago
crash jsd single stepping [@ jsd_FunctionCallHook]
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | beta8+ |
People
(Reporter: johnjbarton, Assigned: timeless)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
1.47 KB,
patch
|
timeless
:
review+
|
Details | Diff | Splinter Review |
1) Install Firebug from: http://www.softwareishard.com/temp/firebug-1.7X.0a4.608763.xpi 2) Load page: https://getfirebug.com/tests/content/script/singleStepping/index.html 3) Enable the Script panel, reload the page 4) Create breakpoint on line 14 5) Press the button on the page crash http://crash-stats.mozilla.com/report/index/bp-8e9476ab-d01a-4c4c-9a2c-8418d2101104 http://crash-stats.mozilla.com/report/index/bp-431e9f45-79be-43fa-9465-003832101104
Reporter | ||
Comment 1•14 years ago
|
||
Mozilla/5.0 (Windows NT 6.1; rv:2.0b8pre) Gecko/20101104 Firefox/4.0b8pre
Reporter | ||
Comment 2•14 years ago
|
||
Hmm. I also have Chromebug and FBTest running
Reporter | ||
Comment 3•14 years ago
|
||
With just FBTrace and Firebug I don't crash
No longer blocks: 609663
Comment 4•14 years ago
|
||
I am seeing this too. I am only using Firebug1.7, no Chromebug or FBTest. What I see happening, going backwards: - jsd_FunctionCallHook is passed a NULL 'closure' arg. - the interpreter's ScriptEpilogue invokes jsd_FunctionCallHook with this guard: if (hook && fp->hasHookData() && !fp->isExecuteFrame()) hook(cx, fp, JS_FALSE, &ok, fp->hookData()); - hasHookData() is testing the frame's JSFRAME_HAS_HOOK_DATA flag, not the hook data itself (which is why that guard passes it) - earlier, setHookData is called to set a NULL hookData_ - the NULL comes from the interpreter's ScriptProlog: JSInterpreterHook hook = cx->debugHooks->callHook; if (JS_UNLIKELY(hook != NULL) && !fp->isExecuteFrame()) fp->setHookData(hook(cx, fp, JS_TRUE, 0, cx->debugHooks->callHookData)); - all of this is triggered when I set a breakpoint on a for loop and then single-step. The intent here is that the entry hook gets to decide whether the exit hook is called. Which suggests to me that the unconditional call to fp->setHookData is wrong. I'll chase it back through hg history, but hopefully someone knowledgeable will chip in.
blocking2.0: --- → ?
Component: General → JavaScript Debugging APIs
Product: Firefox → Core
QA Contact: general → jsd
Someone broke the js api design. http://mxr.mozilla.org/mozilla1.8/source/js/src/jsinterp.c#1367 1365 /* call the hook if present */ 1366 if (hook && (native || script)) 1367 hookData = hook(cx, &frame, JS_TRUE, 0, cx->runtime->callHookData); 1369 /* Call the function, either a native method or an interpreted script. .... 1413 out: 1414 if (hookData) { 1415 hook = cx->runtime->callHook; 1416 if (hook) 1417 hook(cx, &frame, JS_FALSE, &ok, hookData); 1418 } The design is such that the return from hook() is either a closure or null. If it's null, then the hook on the other side is *not* called.
Assignee: nobody → general
Component: JavaScript Debugging APIs → JavaScript Engine
QA Contact: jsd → general
Comment 7•14 years ago
|
||
An alternative would be to make setHookData clear the FRAME_HAS_HOOK_DATA flag when NULL is passed in, and leave everything else alone. I'm not sure why the flag exists, if it's purely redundant with !!hookData_. I guess it's just mimicking several other fields, and for some of those, NULL must be a valid value?
Comment 8•14 years ago
|
||
Comment on attachment 490038 [details] [diff] [review] restore jsapi behavior antebellum Luke, would you be willing to review and follow up on the frame flag issue Steve pointed out? Thanks, /be
Attachment #490038 -
Flags: review?(brendan) → review?(lw)
Severity: normal → critical
Summary: crash jsd single stepping jsd_FunctionCallHook → crash jsd single stepping [@ jsd_FunctionCallHook]
Comment 9•14 years ago
|
||
(In reply to comment #7) The flag allows us to leave hookData_ uninitialized when pushing a stack frame, as part of the general "make calls fast" effort.
Updated•14 years ago
|
Attachment #490038 -
Flags: review?(lw) → review+
Assignee | ||
Comment 10•14 years ago
|
||
luke/et al: please land according to whatever process is being used I'm at a conference for the week...
Attachment #490038 -
Attachment is obsolete: true
Attachment #490875 -
Flags: review+
Keywords: checkin-needed
Comment 11•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/22273789b140
Keywords: checkin-needed
Whiteboard: fixed-in-tracemonkey
Comment 12•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/22273789b140
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
blocking2.0: ? → beta8+
You need to log in
before you can comment on or make changes to this bug.
Description
•