Closed Bug 429535 Opened 16 years ago Closed 11 years ago

Treehydra: weird JS faults in strict mode

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dmandelin, Unassigned)

References

Details

When code a.x is executed, and a has no property x, and running in Treehydra in strict mode with warnings as errors, sometimes instead of an exception, SpiderMonkey aborts with some kind of breakpoint trap with an error message that suggests an exception is thrown while another exception is still pending. I haven't found a way to duplicate the bug in a small test case, but I'm pretty sure I know what the problem is.

When a property lookup fails on a lazy object, Treehydra calls unhandledLazyProperty, a JS function in treehydra.js, to handle the error. In almost all cases, unhandledLazyProperty throws an exception. My guess is that in strict mode, there is already an exception pending from the lookup, and this second exception causes the abort. Or the other way around. It is certainly true that commenting out the body of unhandledLazyProperty fixes the problem in all cases: you get the normal strict mode exception.
Well, this sounds like a good argument against using a JS function for that. Lets go back to doing that check in C. Since you have something you can reproduce, please post a patch.
Depends on: 425845
Throwing with an exception pending is legal, in the general case (pretty sure it's in our test suite, even) -- without a stack, it's pretty hard to tell if what you're seeing is just a simple bug in your code or SpiderMonkey, or a reason to not use JS.

Don't necessarily need a minimal test case if you have a stack and clear steps for a SM developer to reproduce, even if it involves setting up treehydra...
Dehydra and treehydra are no longer maintained by Mozilla.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.