Closed
Bug 349653
Opened 18 years ago
Closed 18 years ago
"Assertion failure: OBJ_GET_CLASS(cx, obj) == &js_ArrayClass" with ternary and array comprehension
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: brendan)
Details
(Keywords: crash, testcase, verified1.8.1, Whiteboard: [sg:investigate] js1.7)
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
mrbkap
:
review+
beltzner
:
approval1.8.1+
|
Details | Diff | Splinter Review |
Steps to reproduce:
In a debug build,
javascript:void ({y: true ? [1 for (x in [2])] : 3 })
Result:
Assertion failure: OBJ_GET_CLASS(cx, obj) == &js_ArrayClass, at js/src/jsinterp.c:6090
Comment 1•18 years ago
|
||
I can't reproduce this anymore. I'm optimistically marking it as a dupe of bug 349493.
*** This bug has been marked as a duplicate of 349493 ***
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
Reporter | ||
Comment 2•18 years ago
|
||
I can still reproduce sometimes with the original steps. Also, I can reproduce reliably with...
Steps to reproduce:
In a debug build,
javascript:let (a) true ? [2 for each (z in function(id) { return id })] : 3;
Result:
jsinterp.c:6081 crashes or asserts.
JS_ASSERT(OBJ_GET_CLASS(cx, obj) == &js_ArrayClass);
obj has been observed to be 0x00000000 or 0x80000000 (causing a segfault). When it asserts, I'm guessing it "obj" is just a bogus address that can be dereferenced without segfaulting.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Whiteboard: [sg:investigate]
Assignee | ||
Comment 3•18 years ago
|
||
So the constant folder has to update the unique down-pointer from parent to child when it moves a JSParseNode due to a constant condition selecting a then or else expression or clause. But for TOK_ARRAYCOMP, there's an up-pointer several nodes down in the TOK_ARRAYPUSH node, pn_array, that needs fixing.
Otherwise we never point from two nodes to one -- the AST is a tree except for this cyclic up link, and there's no need for multiple connections in general. So I'm not going to mark a FIXME here, since I do not expect more up-pointers to be added to JSParseNode, so there's no point in generalizing.
/be
Updated•18 years ago
|
Attachment #236194 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 4•18 years ago
|
||
This preserves the single-pointer-to-JSParseNode-from-any-other-JSParseNode (where the other node is always the parent, and pn_next does not count for the constant ? or if condition case) property. If you like it better too, please retract r+ on other patch and obsolete it, and r+ this one. It fixes the bug, using the nearest C equivalent to a statically scoped outer function variable (cg->arrayCompSlot).
/be
Attachment #236340 -
Flags: review?(mrbkap)
Comment 5•18 years ago
|
||
Comment on attachment 236340 [details] [diff] [review]
altern-patch I like better
Yeah, this is better.
Attachment #236340 -
Flags: review?(mrbkap) → review+
Updated•18 years ago
|
Attachment #236194 -
Attachment is obsolete: true
Attachment #236194 -
Flags: review+
Assignee | ||
Comment 6•18 years ago
|
||
Fixed on trunk.
/be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•18 years ago
|
Attachment #236340 -
Flags: approval1.8.1?
Comment 7•18 years ago
|
||
(In reply to comment #2)
>
> obj has been observed to be 0x00000000 or 0x80000000 (causing a segfault).
i believe in some cases 0x80000000 may point to used heap - if one consumes enough memory.
Comment 8•18 years ago
|
||
Comment on attachment 236340 [details] [diff] [review]
altern-patch I like better
a=beltzner on behalf of 181drivers
Attachment #236340 -
Flags: approval1.8.1? → approval1.8.1+
Comment 9•18 years ago
|
||
on linux 2.6 creating 2 js with byte size 256MB each makes 0x80000000 mapped on the heap.
Comment 10•18 years ago
|
||
Checking in regress-349653.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-349653.js,v <-- regress-349653.js
initial revision: 1.1
Flags: in-testsuite+
Comment 13•18 years ago
|
||
verified fixed 1.8 2006090118 windows/mac*/linux
Keywords: fixed1.8.1 → verified1.8.1
Comment 14•18 years ago
|
||
the test was originally misplaced.
Removing js1_5/Regress/regress-349653.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-349653.js,v <-- regress-349653.js
new revision: delete; previous revision: 1.1
done
RCS file: /cvsroot/mozilla/js/tests/js1_7/block/regress-349653.js,v
done
Checking in js1_7/block/regress-349653.js;
/cvsroot/mozilla/js/tests/js1_7/block/regress-349653.js,v <-- regress-349653.js
initial revision: 1.1
done
Updated•18 years ago
|
Flags: blocking1.8.0.8?
Updated•18 years ago
|
Flags: blocking1.8.0.8? → blocking1.8.0.8-
Whiteboard: [sg:investigate] → [sg:investigate] js1.7
You need to log in
before you can comment on or make changes to this bug.
Description
•