Assertion failure: frame.isDebuggee(), at js/src/vm/Debugger-inl.h:18
Categories
(Core :: JavaScript Engine, defect, P2)
Tracking
()
People
(Reporter: decoder, Assigned: jimb)
Details
(4 keywords, Whiteboard: [jsbugmon:testComment=8,origRev=c9f0730a57a6])
Attachments
(1 file)
![]() |
||
Updated•8 years ago
|
Comment 1•8 years ago
|
||
Comment 3•8 years ago
|
||
Comment 4•8 years ago
|
||
Comment hidden (obsolete) |
Updated•7 years ago
|
Updated•7 years ago
|
Comment 6•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Comment hidden (obsolete) |
var g1 = this;
var g2 = newGlobal();
var dbg = Debugger(g2);
dbg.onExceptionUnwind = function(f, x) {
var h = newGlobal();
h.parent = g1;
h.eval("var dbg = new Debugger(parent); dbg.onEnterFrame = function(frame) {};");
};
dbg.onDebuggerStatement = function(f) {
assertEq(f.eval('throw 42').throw, 42);
};
g2.eval('debugger');
asserts js shell compiled with --enable-debug on m-c rev 8ec327de0ba7 using --fuzzing-safe --no-threads --no-baseline --no-ion --more-compartments at Assertion failure: frame.isDebuggee(), at js/src/vm/Debugger-inl.h:21
Updated•7 years ago
|
Updated•7 years ago
|
Comment hidden (obsolete) |
Updated•7 years ago
|
Updated•7 years ago
|
Comment 10•6 years ago
|
||
I think we can drop this from regression triage.
![]() |
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment hidden (obsolete) |
Jim mentioned over Slack that he's still the only one taking Debugger fuzzbugs.
Assignee | ||
Comment 13•6 years ago
|
||
I can reproduce this. This should be quick.
Assignee | ||
Comment 14•6 years ago
|
||
Here's a further simplified test case:
var g1 = this;
var h = newGlobal();
h.parent = g1;
h.eval(`
var hdbg = new Debugger(parent);
function j() {
hdbg.onEnterFrame = function(frame) {};
}
`);
var g2 = newGlobal();
g2.j = h.j;
var dbg = new Debugger(g2);
var g2DO = dbg.addDebuggee(g2);
dbg.onDebuggerStatement = function(f) {
f.eval('j()');
};
g2.eval('debugger');
Since an onEnterFrame
hook detects calls anywhere in any debuggee realm, setting such a hook entails setting the isDebuggee
flag on all stack frames in the debuggee realms. This is the job of Debugger::updateExecutionObservabilityOfFrames
.
Unfortunately, that function uses FrameIter
to walk the stack. FrameIter
respects 'debugger eval prev' links, which make the parent of a frame for a call to Debugger.Frame.prototype.eval
to appear to be the Debugger.Frame
's referent, not the actual youngest debuggee frame. (Debugger eval prev links are somewhat nonsensical, and perhaps should be removed, but they predate the Debugger
API.)
In the test case, the function h.f
sets an onEnterFrame
hook on a Debugger
whose debuggee is the main global running the test script. At that point, the JavaScript stack looks like this (youngest to oldest):
- In global
h
, a call toh.j
, setting theonEnterFrame
hook - In global
g2
, a debugger eval frame evaluating the expressionj()
- In the main global, the
onDebuggerStatement
handler - In global
g2
, an eval frame evaluating the statementdebugger;
- In the main global, a frame running the test script top level code.
As a debugger eval frame, frame 2 has a debugger eval prev link pointing to frame 4. The FrameIter
in Debugger::updateExecutionObservabilityOfFrames
follows that link, skipping over frame 3. When we return from frame 3, the assertion notices that the frame's script is marked as a debuggee (setting the onEnterFrame
hook set its realm's DebuggerObservesAllExecution
flag), but that the frame itself is not. This violates the Debugger
's invariant that all frames running debuggee scripts must be themselves debuggee frames.
Assignee | ||
Comment 15•6 years ago
|
||
Setting a hook on a Debugger
may expand the set of behaviors it observes, so
that new scripts and stack frames must have their isDebuggee
flags set. The
Debugger::updateExecutionObservabilityOfFrames
function is supposed to walk
the stack and sets the flag where necessary.
However, the old code performed that stack walk using FrameIter
, which follows
'debugger eval prevlinks, potentially skipping over stack frames that need to be flagged. This patch changes the code to use
AllFramesIter, which differs from
FrameIter` only in that it ignores 'debugger eval prev' links.
Assignee | ||
Comment 16•6 years ago
|
||
Comment 17•6 years ago
|
||
Comment 18•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Description
•