Closed
Bug 431248
Opened 17 years ago
Closed 17 years ago
Crash [@ DecompileExpression] with defineGetter, watch and yield
Categories
(Core :: JavaScript Engine, defect, P1)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.9
People
(Reporter: gkw, Assigned: brendan)
References
Details
(Keywords: crash, testcase, Whiteboard: [sg:critical?])
Crash Data
Attachments
(4 files, 1 obsolete file)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
igor
:
review+
damons
:
approval1.9+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
text/plain
|
Details |
Stephen Donner found this bug, I reduced it and Jesse Ruderman helped to reduce it even more. This causes js opt shell to crash at 0x00000000fffffff0 and debug js shell to show this assertion "Assertion failure: 0, at jsopcode.c:1852".
this.__defineGetter__('y', ({}).watch);
var g = (function () { (yield 3) + (this.y); })();
g.next();
g.next();
I nominate this bug for blocking1.9 because it crashes at 0x00000000fffffff0, so it is likely to be exploitable.
Bug 407230 and bug 380432 trigger the same assertion in debug builds, but in opt builds, those bugs don't cause a crash.
This bug (both the assertion happening with this testcase, and the crash) is a regression from within the last three days or so.
Flags: blocking1.9?
Assignee | ||
Comment 1•17 years ago
|
||
The assertion is a regression from bug 420919's patch -- should block until we know more.
/be
Assignee: general → brendan
Blocks: 420919
Assignee | ||
Updated•17 years ago
|
OS: Mac OS X → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.9
Comment 2•17 years ago
|
||
If bug 420919 isn't a blocker, wouldn't we just back the other one out rather than make this one a blocker?
Comment 3•17 years ago
|
||
I still feel (as I argued there) that bug deserved blocker-status.
Comment 4•17 years ago
|
||
Shaver, care to address Crowder's plea for blocking status on bug 420919 and therefor this one?
Assignee | ||
Comment 5•17 years ago
|
||
Ignoring the comment fixes (I was led on a merry chase through js_Invoke re-learning how the offending value is decompiled for the "is not a function" error from obj_watch), this fix just leaves JSOP_GETTHISPROP handled by its own case in the rewrite-op-if-up-against-dvgfence logic, which case does not rewrite op to JSOP_THIS.
The result for this bug's reduced testcase from comment 0 is slighly confusing, but much better than crashing, and better still than "(void 0) is not a function":
typein:10: TypeError: this.y is not a function
Might want to say "this.y is not a watchpoint function". Even better would be something like "this.y has a getter that calls Object.prototype.watch with too few arguments" but I'll save that for next time.
/be
Attachment #318524 -
Flags: review?(igor)
Assignee | ||
Comment 6•17 years ago
|
||
Let's move forward. The mistake made in the patch for bug 420919 is trivial to correct. The assertion did its job and smoked out the forgotten way that a getter can call a native function such as obj_watch in a way that reports an error, in the course of which the faulting pc's opcode is blamed -- requiring that that op have a case of its own in the switch patched here in jsopcode.c.
Bug 420919 is important since common errors should decompile the value-generating expression for bad values such as null and undefined, not say "null is not a function" or "(void 0) is not a function". JS developers prefer Firefox in part due to better diagnostics, and we see competing browsers working to catch up and overtake.
This can be a ride-along non-blocker if such a thing is possible. Main point is to move forward, not backward. There won't be a followup for another regression here. How JSOP_GETTHISPROP is handled is the only issue.
/be
Non-blocking, but we should take the fix if it reviews and tests well. Diagnostics are a big differentiator and productivity enhancement for developers, and this is a low-risk patch.
Flags: wanted1.9+
Flags: blocking1.9?
Flags: blocking1.9+
(If we don't take it for 1.9, we should be sure to take it in 1.9.0.1.)
Sorry, flag-click-o.
Flags: blocking1.9+ → blocking1.9-
Updated•17 years ago
|
Attachment #318524 -
Flags: review?(igor) → review+
Assignee | ||
Updated•17 years ago
|
Attachment #318524 -
Flags: approval1.9?
Comment 10•17 years ago
|
||
Comment on attachment 318524 [details] [diff] [review]
Don't rewrite JSOP_GETTHISPROP when it is against the dvgfence
a1.9+=damons
Attachment #318524 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 11•17 years ago
|
||
Filed followup bug 431569 (to be fixed post-mozilla1.9) and commented about it in jsopcode.c.
/be
Assignee | ||
Comment 12•17 years ago
|
||
Fixed:
js/src/jsinterp.c 3.496
js/src/jsopcode.c 3.315
/be
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 13•17 years ago
|
||
Updated•17 years ago
|
Flags: in-testsuite+
Flags: in-litmus-
Comment 14•17 years ago
|
||
I'm still getting Assertion failure: 0, at mozilla/js/src/jsopcode.c:1863 on mac os x i386 at least.
Assignee | ||
Comment 15•17 years ago
|
||
(In reply to comment #14)
> I'm still getting Assertion failure: 0, at mozilla/js/src/jsopcode.c:1863 on
> mac os x i386 at least.
You have out of date source -- the patched line is 1873.
/be
Comment 16•17 years ago
|
||
confirmed luser error.
Updated•16 years ago
|
Whiteboard: [sg:critical?]
Comment 18•16 years ago
|
||
Attachment #318685 -
Attachment is obsolete: true
Comment 19•15 years ago
|
||
when this bug is opened, the test should be checked in.
Flags: in-testsuite+ → in-testsuite?
Updated•13 years ago
|
Crash Signature: [@ DecompileExpression]
Updated•10 years ago
|
Group: core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•