Closed
Bug 878543
Opened 12 years ago
Closed 11 years ago
"Assertion failure: !cx->isExceptionPending()" with Proxy that throws itself
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox35 | --- | fixed |
People
(Reporter: jruderman, Unassigned)
References
Details
(Keywords: assertion, regression, testcase, Whiteboard: [fuzzblocker:isExceptionPending] [jsbugmon:update,testComment=11])
var grumpyCat = Proxy.create({
has: function () {
return true;
},
get: function () {
throw grumpyCat;
},
}, {});
grumpyCat.smile;
Assertion failure: !cx->isExceptionPending(), at js/src/jsinterp.cpp:3162
Comment 1•12 years ago
|
||
I think this is a regression from bug 739659. We're calling into getters and setters (and proxy hooks) with an exception already on cx. The code should probably be reworked to set aside the exception as it inspects the exception object and bail if trying to get any of the additional properties throws again.
Blocks: 739659
Comment 2•12 years ago
|
||
In particular, http://hg.mozilla.org/mozilla-central/annotate/8aca531ff163/js/src/jsexn.cpp#l1040 is where we re-set the exception and continue to inspect the object in case of failure.
Updated•12 years ago
|
Flags: needinfo?(luke)
![]() |
||
Comment 3•12 years ago
|
||
Hmm, it's kindof crazy that we are even running content-visible code here at all. I was trying to figure out whether we could technically run user code before bug 739659: seems like 'yes' if the thrown Error object was Object.defineProperty'd to have a getter on 'message', so this isn't really worse.
IIUC, the fix here is just to JS_ClearPendingException again, right before we report the error?
Flags: needinfo?(luke)
Comment 4•12 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #3)
> IIUC, the fix here is just to JS_ClearPendingException again, right before
> we report the error?
The complete fix is going to be to JS_ClearPendingException after any of the calls that run user code (and there's quite a few of them before we actually try to report the exception).
Comment 5•12 years ago
|
||
Well, really we shouldn't be doing anything user-visible at all when reporting an uncaught exception, aside from calling window.onerror if it's been set. That's the primordial sin. Not clearing pending exceptions after ToString, or whatever, does nothing about that incorrect behavior.
![]() |
||
Comment 6•12 years ago
|
||
(In reply to Blake Kaplan (:mrbkap) from comment #4)
Yes, what I said :)
![]() |
||
Comment 7•12 years ago
|
||
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #5)
That was my first reaction, but I thought "eh, we've been doing it forever" ;)
But you're right. Problem is: is using js::HasDataProperty enough, or do we have to whitelist a set of getters that we are willing to call?
Comment 8•12 years ago
|
||
js::HasDataProperty would be enough to safely detect extant properties. For error objects the stuff you might want, like message/etc., only appears via resolve hook -- bug 724768. We'd need to fix that (it's really not too bad, I have half of a patch for it) if effects include .message-getting.
In this case it's a ToString() occurring. We probably need some sort of EffectFreeToString method, or somesuch, to solve that case. It should be easy enough to start it off with just doing obj_toString-like behavior, then extend it to error objects and similar with more informative details. Or for this particular case, since errors are the likeliest thing to be seen, we can hold for correct handling of error objects.
![]() |
||
Comment 9•12 years ago
|
||
Let's see if JSBugMon can track this..
Whiteboard: [fuzzblocker:isExceptionPending] → [fuzzblocker:isExceptionPending][jsbugmon:update]
Updated•12 years ago
|
Whiteboard: [fuzzblocker:isExceptionPending][jsbugmon:update] → [fuzzblocker:isExceptionPending] [jsbugmon:]
Comment 10•12 years ago
|
||
JSBugMon: Cannot process bug: Error: Failed to isolate original revision for test
![]() |
||
Comment 11•12 years ago
|
||
var grumpyCat = Proxy.create({
has: function () {
return true;
},
get: function () {
throw grumpyCat;
},
}, {});
grumpyCat.smile;
Asserts on m-c rev 599100c4ebfe.
Retrying for JSBugMon's sake.
Whiteboard: [fuzzblocker:isExceptionPending] [jsbugmon:] → [fuzzblocker:isExceptionPending] [jsbugmon:update,testComment=11]
Comment 12•11 years ago
|
||
Gary: is this Proxy exception bug still relevant? I can't repro on a debug build of Nightly 31.
Flags: needinfo?(gary)
![]() |
||
Comment 13•11 years ago
|
||
(In reply to Chris Peterson (:cpeterson) from comment #12)
> Gary: is this Proxy exception bug still relevant? I can't repro on a debug
> build of Nightly 31.
Yes, it is still relevant, it still reproduces on m-c rev 5010b38abf18, and is being tracked on JSBugMon.
Flags: needinfo?(gary)
Updated•11 years ago
|
Whiteboard: [fuzzblocker:isExceptionPending] [jsbugmon:update,testComment=11] → [fuzzblocker:isExceptionPending] [jsbugmon:testComment=11]
Comment 14•11 years ago
|
||
JSBugMon: Cannot process bug: Unable to automatically reproduce, please track manually.
Updated•11 years ago
|
Whiteboard: [fuzzblocker:isExceptionPending] [jsbugmon:testComment=11] → [fuzzblocker:isExceptionPending] [jsbugmon:update,testComment=11]
Assignee | ||
Updated•11 years ago
|
Assignee: general → nobody
Updated•11 years ago
|
Whiteboard: [fuzzblocker:isExceptionPending] [jsbugmon:update,testComment=11] → [fuzzblocker:isExceptionPending] [jsbugmon:update,testComment=11,ignore]
Comment 15•11 years ago
|
||
JSBugMon: The testcase found in this bug no longer reproduces (tried revision d070787de8f7).
Reporter | ||
Comment 16•11 years ago
|
||
I bet this was fixed by the patch in bug 1054243. The testcase is similar enough.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
![]() |
||
Updated•11 years ago
|
status-firefox35:
--- → fixed
Keywords: regression
Whiteboard: [fuzzblocker:isExceptionPending] [jsbugmon:update,testComment=11,ignore] → [fuzzblocker:isExceptionPending] [jsbugmon:update,testComment=11]
You need to log in
before you can comment on or make changes to this bug.
Description
•