Closed Bug 1057580 Opened 10 years ago Closed 10 years ago

Assertion failure: resumePointsEmpty(), at jit/MIRGraph.cpp:897

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla35
Tracking Status
firefox33 --- unaffected
firefox34 --- affected
firefox35 --- affected

People

(Reporter: decoder, Assigned: nbp)

References

Details

(Keywords: assertion, regression, testcase, Whiteboard: [fuzzblocker][jsbugmon:update])

Attachments

(4 files, 2 obsolete files)

The following testcase asserts on mozilla-central revision cd2acc7ab2f8 (run with --no-threads --fuzzing-safe --ion-eager):


function testApplyCallHelper(f) {
    for (var i = 0; i < 10; ++i)
        f.call(this);
}
function testApplyCall() {
    var r = testApplyCallHelper(
        function (a0,a1,a2,a3,a4,a5,a6,a7) { 
	    x = [a0,a1,a2,a3,a4,a5,a6,a7]; 
        }
    );
    r += testApplyCallHelper(x);
}
testApplyCall();
Whiteboard: [jsbugmon:update,bisect]
Whiteboard: [jsbugmon:update,bisect] → [jsbugmon:update]
JSBugMon: Bisection requested, result:
autoBisect shows this is probably related to the following changeset:

The first bad revision is:
changeset:   https://hg.mozilla.org/mozilla-central/rev/9e5f711e25f7
user:        Nicolas B. Pierron
date:        Thu Aug 21 20:47:04 2014 +0200
summary:     Bug 1042729 part 4 - Keep a reference to outer resume point on basic blocks, and make discarding resume point precise. r=jandem

This iteration took 607.376 seconds to run.
Needinfo from nbp based on comment 2 :)
Flags: needinfo?(nicolas.b.pierron)
I hit this assertion following a link to imgur.com
Jan, is it possible for you to take a look at this since :nbp is away? This is hit by fuzzers, and also real world sites as shown by :dbaron's comments above.
Blocks: 1042729
Flags: needinfo?(jdemooij)
Keywords: regression
Whiteboard: [jsbugmon:update] → [fuzzblocker][jsbugmon:update]
(FWIW, I commented the assert out of my local build so I wouldn't crash every half hour running debug builds, so you won't see any more reports from me.)
(In reply to Gary Kwong [:gkw] [:nth10sd] GMT-5 Aug 25-29 from comment #6)
> Jan, is it possible for you to take a look at this since :nbp is away? This
> is hit by fuzzers, and also real world sites as shown by :dbaron's comments
> above.

I looked a bit into this. The resume point it's complaining about is the one created in annotateGetPropertyCache, in the "if (inlinePropTable->numEntries() > 0)" branch. We should consider rewriting the polymorphic inlining code, it's the most complicated part of IonBuilder IMO. I'll think about it but I don't see an easy fix.

npp will be back in a few days, I think it's best to wait for him.
Flags: needinfo?(jdemooij)
Assignee: nobody → nicolas.b.pierron
Attachment #8482877 - Flags: review?(jdemooij)
Flags: needinfo?(nicolas.b.pierron)
From jandem on IRC #ionmonkey:
> why do we need to call the function in processThrow and processReturn? it's not clear to me why or when the calls are inserted

The calls are added in processThrow and processReturn to clear the remaining prior resume points which have not been used in a a call.  So these are just to ensure that we discard the remaining resume points before finishing the MIR Graph of one JSScript.
(In reply to Nicolas B. Pierron [:nbp] from comment #10)
> The calls are added in processThrow and processReturn to clear the remaining
> prior resume points which have not been used in a a call.  So these are just
> to ensure that we discard the remaining resume points before finishing the
> MIR Graph of one JSScript.

Can we call the discard function in IonBuilder::build? Not all scripts end with a processReturn or processThrow call, for example when there's an infinite loop at the end it also terminates the CFG.
Comment on attachment 8482877 [details] [diff] [review]
Ensure that no prior resume point survive.

Canceling review for now, see comment 4.
Attachment #8482877 - Flags: review?(jdemooij)
[Tracking Requested - why for this release]:
OS: Linux → All
Hardware: x86 → All
We also hit this on octane-typescript in the shell running in a debug (optimized) build
(In reply to Jan de Mooij [:jandem] from comment #12)
> Comment on attachment 8482877 [details] [diff] [review]
> Ensure that no prior resume point survive.
> 
> Canceling review for now, see comment 4.

I do not see any other explanation for comment 4, except that this might be a non-verbose assertion caught by the signal handler.  I suggest we go with the current patch as it fix the issue reported by the fuzzer in comment 0.  And as fuzzers are running debug builds, they will also find the second issue if there is any.
Attachment #8487172 - Flags: review?(jdemooij)
Attachment #8482877 - Attachment is obsolete: true
Comment on attachment 8487172 [details] [diff] [review]
IonMonkey: Ensure that no prior resume point survive.

Review of attachment 8487172 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jit/IonBuilder.cpp
@@ +1330,5 @@
>      }
>  
> +  break_outer_loop:
> +    // Discard unreferenced & pre-allocated resume points.
> +    replaceMaybeFallbackFunctionGetter(nullptr);

Instead of adding gotos to an already-very-complicated function, just add this call after the traverseBytecode() call in IonBuilder::build() and maybe buildInline. r=me with that.
Attachment #8487172 - Flags: review?(jdemooij) → review+
(With suggestion applied)
Attachment #8488585 - Flags: review+
Attachment #8487172 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/8998fb69e28f
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: