Closed
Bug 563125
Opened 14 years ago
Closed 14 years ago
"Assertion failure: m != TT_INT32 || isInt32(*vp)" with array.length
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: dvander)
Details
(Keywords: assertion, regression, testcase, Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
1.62 KB,
patch
|
n.nethercote
:
review+
|
Details | Diff | Splinter Review |
var array = new Array(4294967295); for (var j = 0; j < 2; ++j) { '' + array.length; } Assertion failure: m != TT_INT32 || isInt32(*vp), at ../jstracer.cpp:3859 Opt does not crash, but I'm filing this as security-sensitive anyway because tracer bugs scare me.
Reporter | ||
Comment 1•14 years ago
|
||
This assertion failure happens in both 64-bit and 32-bit builds, fwiw.
Assignee | ||
Comment 2•14 years ago
|
||
this feels pretty lame but i don't have any better ideas. i dont think this is exploitable since the worst that can happen is the tracer interpreters a uint32 as an int32 (leads to correctness bugs) - but andreas should confirm.
Comment 3•14 years ago
|
||
This should have been asserting ever since tracing was enabled. I assert with -j as far back as Nov 2008 - http://hg.mozilla.org/tracemonkey/rev/04c360f123e5
blocking2.0: --- → ?
Keywords: regression
OS: Linux → All
Hardware: x86 → All
Version: unspecified → Trunk
Reporter | ||
Updated•14 years ago
|
Whiteboard: [sg:nse?]
Updated•14 years ago
|
blocking2.0: ? → final+
Updated•14 years ago
|
blocking1.9.1: --- → ?
blocking1.9.2: --- → ?
Comment 4•14 years ago
|
||
Unless this is exploitable it's not going to block stable branch releases.
Comment 5•14 years ago
|
||
WFM in f1a334334d13.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Assignee | ||
Comment 6•14 years ago
|
||
You need to up the post-JM loop count.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Assignee | ||
Comment 7•14 years ago
|
||
Assignee: general → dvander
Attachment #442891 -
Attachment is obsolete: true
Status: REOPENED → ASSIGNED
Attachment #492018 -
Flags: review?
Assignee | ||
Updated•14 years ago
|
Attachment #492018 -
Flags: review? → review?(nnethercote)
Comment 9•14 years ago
|
||
Comment on attachment 492018 [details] [diff] [review] refreshed >- v_ins = w.i2d(w.lduiObjPrivate(obj_ins)); >+ v_ins = w.lduiObjPrivate(obj_ins); >+ if (obj->getArrayLength() <= JSVAL_INT_MAX) { >+ guard(true, w.leui(v_ins, w.immi(JSVAL_INT_MAX)), BRANCH_EXIT); >+ v_ins = w.i2d(v_ins); >+ } else { >+ v_ins = w.ui2d(v_ins); >+ } Wouldn't this suffice? v_ins = w.ui2d(w.lduiObjPrivate(obj_ins));
Assignee | ||
Comment 10•14 years ago
|
||
Then the value wouldn't be demoted since IsPromoteInt() would return false.
Comment 11•14 years ago
|
||
(In reply to comment #10) > Then the value wouldn't be demoted since IsPromoteInt() would return false. Which IsPromoteInt() call are you referring to? Should it be IsPromote() or isPromoteUint() instead?
Assignee | ||
Comment 12•14 years ago
|
||
Yes and no... IsPromoteInt is called in the forward pipeline to demote float math to integer math (and float stores to integer stores). It can't be IsPromoteUint because there is no TT_* for an unsigned integer, so when leaving trace the very large value would be boxed incorrectly as a signed integer. Code that checks IsPromoteInt() but not IsPromoteUint() should probably be looking at both, but that's a separate bug. Here I just want to keep performance the same, that is (x < array.length) should use integer math not float.
Comment 13•14 years ago
|
||
Comment on attachment 492018 [details] [diff] [review] refreshed (In reply to comment #12) > > Here I just want to keep performance the same, that is (x < array.length) > should use integer math not float. There's an extra guard, but that's probably better than using float math.
Attachment #492018 -
Flags: review?(nnethercote) → review+
Assignee | ||
Comment 14•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/e020c8f1099d
Whiteboard: fixed-in-tracemonkey
Comment 15•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/e020c8f1099d
Status: ASSIGNED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → FIXED
Comment 16•11 years ago
|
||
A testcase for this bug was automatically identified at js/src/jit-test/tests/basic/bug563125.js.
Flags: in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•