Closed Bug 298459 Opened 20 years ago Closed 20 years ago

Crash @gc_root_marker (JS_ASSERT)

Categories

(Core :: DOM: Navigation, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: csthomas, Assigned: bryner)

References

Details

(Keywords: crash)

Attachments

(1 file)

I'm hitting the JS_ASSERT at jsgc.c:1474 JS_ASSERT(root_points_to_gcArenaPool); The console shows: JS API usage error: the address passed to JS_AddNamedRoot currently holds an invalid jsval. This is usually caused by a missing call to JS_RemoveRoot. The root's name is "WindowStateHolder::mJSObj". I first hit this with 20050616 or 0618, and did not notice it in 0613. browser.sessionhistory.max_viewers is 5. I don't know steps to reproduce.
Severity: normal → major
We talked about this on IRC, remember? It's an API user error, not a JS engine bug, when you see this assertion. Looking at nsGlobalWindow.cpp, though, I don't see how the WindowStateHolder dtor can not be called, yet the memory go free (or really, mJSObj become invalid). Cc'ing bryner. Since this is suite, is there any code not checked in that is in your build? We need to see all the sources. /be
Assignee: general → general
Component: JavaScript Engine → History: Session
Maybe an allocation and then a GC (or two GCs) are nesting in the ctor. I said to bryner on IRC that I should have noticed during review the lateness of the call to JS_AddNamedRoot (the last thing the ctor does). Moving that up to be first may just fix this bug, although it would be even better to understand how the mJSObj root comes to dangle. /be
Moved AddNamedRoot earlier in WindowStateHolder's ctor after talking this over with brendan. Checking in nsGlobalWindow.cpp; /cvsroot/mozilla/dom/src/base/nsGlobalWindow.cpp,v <-- nsGlobalWindow.cpp new revision: 1.746; previous revision: 1.745 done marking fixed.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Just had this happen. I'm running an optimized trunk build. Is there a missing virtual dtor or something? /be
Status: RESOLVED → UNCONFIRMED
Flags: blocking-aviary1.1+
Resolution: FIXED → ---
THis is real, it's still happening. Need to figure out why. Theories, speculation welcome. /be
Status: UNCONFIRMED → NEW
Ever confirmed: true
QA Contact: general → general
Blocks: 299159
Blocks: 300681
Keywords: crash
*** Bug 302236 has been marked as a duplicate of this bug. ***
No longer blocks: 299159
*** Bug 299159 has been marked as a duplicate of this bug. ***
*** Bug 303900 has been marked as a duplicate of this bug. ***
Attached patch fixSplinter Review
Something on this page is making us unhappy, and among other things we hit the case where we fail to copy a property. The cleanup deletes the state object as an nsISupports*, which fails to run the WindowStateHolder dtor. This fixes that by using Release() via an nsCOMPtr.
Assignee: general → bryner
Status: NEW → ASSIGNED
Attachment #192038 - Flags: review?(darin)
Attachment #192038 - Flags: review?(darin) → review+
Comment on attachment 192038 [details] [diff] [review] fix requesting approval, this is a dead-simple fix
Attachment #192038 - Flags: approval1.8b4?
Comment on attachment 192038 [details] [diff] [review] fix I should have seen this, it was just what it should have been to cause the symptom. /be
Attachment #192038 - Flags: superreview+
Attachment #192038 - Flags: approval1.8b4?
Attachment #192038 - Flags: approval1.8b4+
Flags: blocking1.8b4+
checked in
Status: ASSIGNED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
*** Bug 300681 has been marked as a duplicate of this bug. ***
Component: History: Session → Document Navigation
QA Contact: general → docshell
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: