Closed Bug 381374 Opened 18 years ago Closed 18 years ago

"Assertion failure: *flagp != GCF_FINAL" with getter, setter, watch, and more

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
critical

Tracking

()

VERIFIED FIXED

People

(Reporter: jruderman, Assigned: mrbkap)

Details

(4 keywords, Whiteboard: [sg:critical?])

Attachments

(4 files)

Attached file testcase
$ ./js ~/gc-crash.js Assertion failure: *flagp != GCF_FINAL, at jsgc.c:2147
This can also trigger: Assertion failure: offsetInArena < GC_THINGS_SIZE, at jsgc.c:513
This is a GC hazard in js_AddScopeProperty in the |overwriting| case when the property we're overwriting has a watchpoint set on it. The problem is that we remove the old property from the property tree, preparing to replace it with a new property, and then we call js_WrapWatchedSetter, which can cause a GC. Because we've removed the property from its property tree, it doesn't get marked, which means that none of its members get marked, which leaves its getter up for grabs.
Attached patch Potential fixSplinter Review
I'm not sure if there's a cleaner way to fix this bug, but this does the trick by ensuring that the overwritten property is marked when we create the new setter for the watchpoint.
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #265579 - Flags: review?(igor)
Comment on attachment 265579 [details] [diff] [review] Potential fix This is exactly the purpose of JS_PUSH_TEMP_ROOT_SPROP. But I would even suggest to remove "if (overwriting)" checks around tvr calls for safer and smaller code.
Attachment #265579 - Flags: review?(igor) → review+
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
Whiteboard: [sg:critical?]
The testcase in the bug calls "gczeal()" which is new on the trunk so I can't test the branch easily, but the patched code looks identical in 1.8.1.x so we probably need this fix there. May want to take gczeal on the branch (bug 308429)
Flags: wanted1.8.1.x?
Flags: wanted1.8.0.x?
Flags: blocking1.8.1.5?
Flags: blocking1.8.0.13?
You might be able to reproduce on branch using TOO_MUCH_GC or WAY_TOO_MUCH_GC.
yeah, that would be the "not easily" way.
Flags: wanted1.8.1.x?
Flags: wanted1.8.1.x+
Flags: wanted1.8.0.x?
Flags: wanted1.8.0.x+
Flags: blocking1.8.1.5?
Flags: blocking1.8.1.5+
Flags: blocking1.8.0.13?
Flags: blocking1.8.0.13+
Comment on attachment 265586 [details] [diff] [review] What I'm about to check in This applies the 1.8 and 1.8.0 branches as-is.
Attachment #265586 - Flags: approval1.8.1.5?
Attachment #265586 - Flags: approval1.8.0.13?
Comment on attachment 265586 [details] [diff] [review] What I'm about to check in approved for 1.8.1.5 and 1.8.0.13, a=dveditz
Attachment #265586 - Flags: approval1.8.1.5?
Attachment #265586 - Flags: approval1.8.1.5+
Attachment #265586 - Flags: approval1.8.0.13?
Attachment #265586 - Flags: approval1.8.0.13+
Fixed on the 1.8 branches.
verified fixed 1.8.1, 1.9.0 windows/linux/macppc opt/debug shell/browser 7/16
Status: RESOLVED → VERIFIED
Can someone with a debug build verify this is fixed with a Firefox 1.5.0.13 candidate? Thanks!
(In reply to comment #15) > Can someone with a debug build verify this is fixed with a Firefox 1.5.0.13 > candidate? Thanks! The test case isn't supported on the 1.8.0 branch. I don't know how it could be verified there.
(In reply to comment #16) > (In reply to comment #15) > > Can someone with a debug build verify this is fixed with a Firefox 1.5.0.13 > > candidate? Thanks! > > The test case isn't supported on the 1.8.0 branch. I don't know how it could be > verified there. Sorry, I really meant a debug build of Thunderbird 1.5.0.13 (using either Thunderbrowse or the Mail Start Page trick), since it has fixed1.5.0.13 as a keyword.
Group: security
/cvsroot/mozilla/js/tests/js1_7/GC/regress-381374.js,v <-- regress-381374.js initial revision: 1.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: