Closed
Bug 859008
Opened 13 years ago
Closed 13 years ago
IonMonkey: Crash [@ scopeChain] or [@ js::AbstractFramePtr::evalPrevScopeChain] or Assertion failure: ins->type() == MIRType_Value, at ion/MIR.h or Assertion failure: false (Unexpected state), at vm/Stack.cpp
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla23
| Tracking | Status | |
|---|---|---|
| firefox20 | --- | unaffected |
| firefox21 | --- | unaffected |
| firefox22 | --- | unaffected |
| firefox23 | + | fixed |
| firefox-esr17 | --- | unaffected |
| b2g18 | --- | unaffected |
| b2g18-v1.0.0 | --- | unaffected |
| b2g18-v1.0.1 | --- | unaffected |
People
(Reporter: gkw, Assigned: sstangl)
References
Details
(4 keywords, Whiteboard: [jsbugmon:testComment=9,update,bisectfix][adv-main23-])
Crash Data
Attachments
(2 files)
The upcoming testcase asserts js debug shell on m-c changeset 768af8d8fad4 with --ion-eager and --no-jm at Assertion failure: ins->type() == MIRType_Value, at ion/MIR.h
autoBisect shows this is probably related to the following changeset:
The first bad revision is:
changeset: 127209:ed51ae24fee2
user: Kannan Vijayan
date: Wed Jan 30 12:09:10 2013 -0500
summary: Bug 805877 - Bailout from Ion to Baseline. r=jandem
Locking s-s because similar bug 858617 is also marked s-s. I have tested the patch in that bug does not fix this issue.
| Reporter | ||
Updated•13 years ago
|
Hardware: x86_64 → x86
Summary: BaselineCompiler: Assertion failure: ins->type() == MIRType_Value, at ion/MIR.h → BaselineCompiler: Assertion failure: ins->type() == MIRType_Value, at ion/MIR.h or Assertion failure: false (Unexpected state), at vm/Stack.cpp
Whiteboard: [jsbugmon:update,testComment=1]
| Reporter | ||
Comment 3•13 years ago
|
||
fwiw, the assertion(s) go(es) away with --no-baseline.
| Reporter | ||
Comment 4•13 years ago
|
||
Turns out the regressor in comment 0 was for comment 2, for comment 0, autoBisect pointed to another possible regressor but I'm not sure which is correct:
autoBisect shows this is probably related to the following changeset:
The first bad revision is:
changeset: 127248:d0639bd4b896
user: Brian Hackett
date: Thu Feb 07 12:10:50 2013 -0700
summary: Bug 838820 - Compile NAME and ALIASEDVAR related opcodes, r=djvj.
Flags: needinfo?(kvijayan)
Updated•13 years ago
|
Whiteboard: [jsbugmon:update,testComment=1] → [jsbugmon:testComment=1]
Comment 5•13 years ago
|
||
JSBugMon: Cannot process bug: Error: Failed to isolate original revision for test
Comment 6•13 years ago
|
||
JSBugMon should automatically pick up the attachments, but testComment must not point to a comment without HG revision (except origRev is used to specify one).
Whiteboard: [jsbugmon:testComment=1] → [jsbugmon:update]
Comment 7•13 years ago
|
||
I think that neither of these bugs are directly related to the issue. Somehow the |thisDefn| of the CallInfo struct is becoming NULL during the IonBuilder's handling of JSOP_CALL. This should not happen, and it's highly unlinkely that its occurrence is happening because of baseline issues.
More likely, the two bugs are falsely identified as regressors because:
1. The bailout patch changes how Ion bails out, and thus changes when Ion is re-entered. Unapplying the patch is just hiding the issue, not removing it.
2. The NAME and ALIASEDVAR patch allows some scripts to be baseline compiled which would otherwise not have been. Unapplying it probably just disables the scripts exposing the bug in ion from not running.
My gut says to mark this as an Ion bug and debug it as such.
Flags: needinfo?(kvijayan)
| Reporter | ||
Comment 8•13 years ago
|
||
Marking as an IonMonkey bug based on comment 7.
Summary: BaselineCompiler: Assertion failure: ins->type() == MIRType_Value, at ion/MIR.h or Assertion failure: false (Unexpected state), at vm/Stack.cpp → IonMonkey: Assertion failure: ins->type() == MIRType_Value, at ion/MIR.h or Assertion failure: false (Unexpected state), at vm/Stack.cpp
| Reporter | ||
Comment 9•13 years ago
|
||
x = Set
function f() {
eval("isPrototypeOf.call(Set, x)")
}
y = [0, 0]
Array.prototype.some.call(y, f)
Set = 0[0]
Array.prototype.sort.call(y, f)
crashes js opt shell at scopeChain with js::AbstractFramePtr::evalPrevScopeChain on the stack and asserts js debug shell at Assertion failure: false (Unexpected state), at vm/Stack.cpp
Tested on 64-bit opt deterministic threadsafe shell with --ion-eager --no-jm --no-baseline, on m-c changeset 9d5f05a6d497.
| Reporter | ||
Updated•13 years ago
|
Crash Signature: [@ scopeChain]
[@ js::AbstractFramePtr::evalPrevScopeChain]
Summary: IonMonkey: Assertion failure: ins->type() == MIRType_Value, at ion/MIR.h or Assertion failure: false (Unexpected state), at vm/Stack.cpp → IonMonkey: Crash [@ scopeChain] or [@ js::AbstractFramePtr::evalPrevScopeChain] or Assertion failure: ins->type() == MIRType_Value, at ion/MIR.h or Assertion failure: false (Unexpected state), at vm/Stack.cpp
| Reporter | ||
Updated•13 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
| Reporter | ||
Comment 10•13 years ago
|
||
I f2f discussed this with Sean, and he mentioned he might be able to take a look.
Flags: needinfo?(sstangl)
Comment 11•13 years ago
|
||
If we're sure this is only on FF23, then tracking to ensure we get a backout or forward fix on this before ship.
Updated•13 years ago
|
Crash Signature: [@ scopeChain]
[@ js::AbstractFramePtr::evalPrevScopeChain] → [@ scopeChain]
[@ js::AbstractFramePtr::evalPrevScopeChain]
Whiteboard: [jsbugmon:update] → [jsbugmon:update,ignore]
Comment 12•13 years ago
|
||
JSBugMon: The testcase found in this bug no longer reproduces (tried revision 8b1a7228674a).
| Reporter | ||
Updated•13 years ago
|
Crash Signature: [@ scopeChain]
[@ js::AbstractFramePtr::evalPrevScopeChain] → [@ scopeChain]
[@ js::AbstractFramePtr::evalPrevScopeChain]
Whiteboard: [jsbugmon:update,ignore] → [jsbugmon:update,testComment=9]
Updated•13 years ago
|
Crash Signature: [@ scopeChain]
[@ js::AbstractFramePtr::evalPrevScopeChain] → [@ scopeChain]
[@ js::AbstractFramePtr::evalPrevScopeChain]
Whiteboard: [jsbugmon:update,testComment=9] → [jsbugmon:testComment=9]
Comment 13•13 years ago
|
||
JSBugMon: Cannot process bug: Unable to automatically reproduce, please track manually.
| Reporter | ||
Comment 14•13 years ago
|
||
(In reply to Gary Kwong [:gkw] [:nth10sd] from comment #9)
> Created attachment 736503 [details]
> debug and opt stacks
>
> x = Set
> function f() {
> eval("isPrototypeOf.call(Set, x)")
> }
> y = [0, 0]
> Array.prototype.some.call(y, f)
> Set = 0[0]
> Array.prototype.sort.call(y, f)
>
> crashes js opt shell at scopeChain with
> js::AbstractFramePtr::evalPrevScopeChain on the stack and asserts js debug
> shell at Assertion failure: false (Unexpected state), at vm/Stack.cpp
>
> Tested on 64-bit opt deterministic threadsafe shell with --ion-eager --no-jm
> --no-baseline, on m-c changeset 9d5f05a6d497.
I can still reproduce this on m-c changeset 8b1a7228674a.
Crash Signature: [@ scopeChain]
[@ js::AbstractFramePtr::evalPrevScopeChain] → [@ scopeChain]
[@ js::AbstractFramePtr::evalPrevScopeChain]
Comment 15•13 years ago
|
||
I looked into the testcase provided in comment 9 .
In that testcase we both use FastInvoke for IM (bug 797131) for array_sort and DirectEvalFromIon (introduced in bug 743394). I have no proof, but I wouldn't be surprised if this is caused by a faulty interaction between the two.
Just to make it more readable, this is equivalent testcase (doesn't crashes or run)
x = Set
y = [0, 0]
function f() {
eval("x.isPrototypeOf(Set)")
}
y.some(f)
x = undefined
y.sort(f)
The problem arises in the eval'd code that "x" isn't an object (but undefined) for y.sort(f). So it throws an error. But it goes wrong when unwinding scope. We need "evalPrevScopeChain", but during settle, we get the wrong stackFrame. We get the Native, instead of the Ion frame. (And we die/assert/crash, because we can't get the scopeChain from Native.)
Now I found where we make the wrong decision in "StackIter::settleOnNewState()".
vm/Stack.cpp:1384
if (containsFrame && (!containsCall || (Value *)data_.fp_ >= data_.calls_->array())) {
This should be true. containsFrame and containsCall are true. (This is correct).
But "(Value *)data_.fp_ >= data_.calls_->array()" should also be true. But it is false!
When removing the "some"-call or replacing with another "sort"-call, this is indeed true.
Also when running the testcase and setting this to true on the right moment, makes it not crash, but report the right error message!
Now I'm a bit in the dark as to what this expression does and where it is set and where we could miss it. I'm going to leave this now in the hands of people that are more experienced with this part of the code.
Updated•13 years ago
|
Flags: needinfo?(jdemooij)
Comment 16•13 years ago
|
||
Bug 868990 fixed this by taking out all the StackIter native call code.
Flags: needinfo?(jdemooij)
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [jsbugmon:testComment=9] → [jsbugmon:testComment=9,update,bisectfix]
| Assignee | ||
Updated•13 years ago
|
Flags: needinfo?(sstangl)
Updated•13 years ago
|
Updated•13 years ago
|
Target Milestone: --- → mozilla23
Updated•13 years ago
|
Whiteboard: [jsbugmon:testComment=9,update,bisectfix] → [jsbugmon:testComment=9,update,bisectfix][adv-main23-]
Updated•12 years ago
|
Group: core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•