Closed
Bug 346645
Opened 18 years ago
Closed 18 years ago
Crashes with empty array/object in LHS (destructuring assignment) [@ js_DecompileValueGenerator] [@ FindPropertyValue]
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: brendan)
References
Details
(Keywords: crash, testcase, verified1.8.1)
Crash Data
Attachments
(1 file)
(deleted),
patch
|
mrbkap
:
review+
beltzner
:
approval1.8.1+
|
Details | Diff | Splinter Review |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060730 Minefield/3.0a1
Each of these statements crashes Firefox:
({ a:{} }) = 3
({ a:[] }) = 3
Reporter | ||
Updated•18 years ago
|
Flags: blocking1.9a1?
Reporter | ||
Comment 1•18 years ago
|
||
The array doesn't even have to be empty; this also crashes Firefox:
({ a:[z] }) = 3
Reporter | ||
Comment 2•18 years ago
|
||
In a nightly build, js_DecompileValueGenerator appears at the top.
In a debug build, FindPropertyValue appears at the top.
Thread 0 Crashed:
0 FindPropertyValue + 592 (jsparse.c:1771)
1 CheckDestructuring + 884 (jsparse.c:1894)
2 AssignExpr + 832 (jsparse.c:3356)
3 Expr + 48 (jsparse.c:3276)
4 Statement + 11176 (jsparse.c:3064)
5 Statements + 280 (jsparse.c:1131)
6 js_CompileTokenStream + 212 (jsparse.c:501)
7 CompileTokenStream + 224 (jsapi.c:3808)
8 JS_CompileUCScriptForPrincipals + 148 (jsapi.c:3903)
9 JS_EvaluateUCScriptForPrincipals + 112 (jsapi.c:4325)
...
Summary: Crashes with empty array/object in LHS (destructured assignment) → Crashes with empty array/object in LHS (destructured assignment) [@ js_DecompileValueGenerator] [@ FindPropertyValue]
Assignee | ||
Comment 3•18 years ago
|
||
Works for me in trunk js shell:
js> ({ a:{} }) = 3;
typein:3: SyntaxError: missing variable name:
typein:3: ({ a:{} }) = 3;
typein:3: .....^
js> ({ a:[z] }) = 3;
typein:4: TypeError: undefined has no properties
Are you running trunk or 1.8.1 Firefox?
/be
Assignee | ||
Comment 4•18 years ago
|
||
Sorry, missed the first line of comment 0.
Anyone know how to reproduce in the js shell? From comment 2, this sounds like it may be a dup of bug 346642, but the FindPropertyValue crash is probably separate. Time for valgrind.
/be
Assignee: general → brendan
Depends on: desdec
Comment 5•18 years ago
|
||
This WFM on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060730 Minefield/3.0a1
({ a:{} }) = 3
SyntaxError on line 1: missing variable name
({ a:[] }) = 3
SyntaxError on line 1: missing variable name
({ a:[z] }) = 3
TypeError on line 1: undefined has no properties
Assignee | ||
Comment 6•18 years ago
|
||
WFM in my Minefield build, too.
/be
Assignee | ||
Comment 7•18 years ago
|
||
Could someone else with a PPC Mac build (Minefield or JS shell) please confirm.
/be
Assignee | ||
Updated•18 years ago
|
Summary: Crashes with empty array/object in LHS (destructured assignment) [@ js_DecompileValueGenerator] [@ FindPropertyValue] → Crashes with empty array/object in LHS (destructuring assignment) [@ js_DecompileValueGenerator] [@ FindPropertyValue]
Comment 8•18 years ago
|
||
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060730 Minefield/3.0a1
I get the crash also.
Assignee | ||
Comment 9•18 years ago
|
||
Ok, I could use some help -- the PPC Mac box here has no developer tools, and I'm booked on other bugs. If any kind soul can debug a bit and describe what he or she sees leading to the crash in the debug build case (js shell is easiest, Firefox ok too), and find me on IRC....
/be
Assignee | ||
Comment 10•18 years ago
|
||
Byte-order-dependent unsafe type union bug, can you believe it? No-brainer for 1.8.1.
/be
Attachment #231515 -
Flags: review?(mrbkap)
Attachment #231515 -
Flags: approval1.8.1?
Updated•18 years ago
|
Attachment #231515 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 11•18 years ago
|
||
A double containing the number 3, stored in the pn_u.dval member of the pn_u union, is 0x4008000000000000, which aliases the pn_u.head pointer of the list variant depending on byte order. On little-endian machines, the low 32 bits of zeros alias head and we get a nice null head pointer, which looks like an empty list. On PPC and other big-endian machines, we get 0x40080000 and crash.
This fix must be taken, since other double values could be used to forge pointers, although I'm not sure how far one could forge before crashing. At the limit, this is a read privacy violation.
Big thanks to Josh for debugging help.
/be
Status: NEW → ASSIGNED
Assignee | ||
Comment 12•18 years ago
|
||
Fixed on trunk.
/be
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: blocking1.8.1?
Resolution: --- → FIXED
Comment 13•18 years ago
|
||
Comment on attachment 231515 [details] [diff] [review]
fix
a=drivers, please land this on the MOZILLA_1_8_BRANCH.
Attachment #231515 -
Flags: approval1.8.1? → approval1.8.1+
Comment 15•18 years ago
|
||
Checking in regress-346645-01.js;
/cvsroot/mozilla/js/tests/js1_7/expressions/regress-346645-01.js,v <-- regress-346645-01.js
initial revision: 1.1
done
RCS file: /cvsroot/mozilla/js/tests/js1_7/expressions/regress-346645-02.js,v
done
Checking in regress-346645-02.js;
/cvsroot/mozilla/js/tests/js1_7/expressions/regress-346645-02.js,v <-- regress-346645-02.js
initial revision: 1.1
done
RCS file: /cvsroot/mozilla/js/tests/js1_7/expressions/regress-346645-03.js,v
done
Checking in regress-346645-03.js;
/cvsroot/mozilla/js/tests/js1_7/expressions/regress-346645-03.js,v <-- regress-346645-03.js
initial revision: 1.1
Flags: in-testsuite+
Reporter | ||
Updated•18 years ago
|
Flags: blocking1.9a1?
Flags: blocking1.8.1?
Reporter | ||
Comment 16•18 years ago
|
||
Verified fixed: both trunk debug builds and trunk nightly builds no longer crash on Mac.
Status: RESOLVED → VERIFIED
Comment 17•18 years ago
|
||
verified fixed 1.8, 1.9 windows/mac(ppc|tel)/linux 20060803
Keywords: fixed1.8.1 → verified1.8.1
Updated•13 years ago
|
Crash Signature: [@ js_DecompileValueGenerator]
[@ FindPropertyValue]
You need to log in
before you can comment on or make changes to this bug.
Description
•