Treehydra: weird JS faults in strict mode

RESOLVED WONTFIX

Status

Firefox Build System
Source Code Analysis
RESOLVED WONTFIX
10 years ago
5 months ago

People

(Reporter: dmandelin, Unassigned)

Tracking

Trunk

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
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.

Comment 1

10 years ago
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.
(Reporter)

Updated

10 years ago
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
Last Resolved: 6 years ago
Resolution: --- → WONTFIX

Updated

5 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.