Closed Bug 542529 Opened 16 years ago Closed 16 years ago

Injection: Assert triggered when small-object allocation occurs during finalization

Categories

(Tamarin Graveyard :: Garbage Collection (mmGC), defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED
flash10.1

People

(Reporter: lhansen, Assigned: lhansen)

Details

Attachments

(2 files, 1 obsolete file)

The slow branch of GCAlloc::AllocSlow calls GCAlloc::Alloc to perform the allocation after setting up a state that is suitable for alloc, but sets up an imperfect state: GCAlloc::Alloc has an invariant, that if gc->collecting is true then the quick list is empty. AllocSlow either temporarily needs to set gc->collecting to false (probably OK given what we're doing but needs serious vetting, because of how mark bits are set etc - it's not appealing) or AllocSlow should not be calling Alloc recursively at that point. We did not catch this in avmshell unit testing because we don't have a test that is sure to allocate during finalization.
Selftest that has a finalizer that allocates a small object, thereby triggering the assert in debug mode.
Attachment #423810 - Flags: review?(treilly)
Attached patch Patch (obsolete) — Splinter Review
Splits GCAlloc::Alloc into a preamble and a new function, AllocFromQuickList, that actually picks the object off the list and returns it after setting everything up. AllocSlow now calls the latter, which removes the reentrancy problem in this bug and the one for greedy mode as well. The new function is made REALLY_INLINE so performance should not suffer.
Attachment #423813 - Flags: review?(treilly)
Flags: flashplayer-qrb?
Priority: -- → P2
Target Milestone: --- → flash10.1
Comment on attachment 423813 [details] [diff] [review] Patch Looks good with exception of SignalFreeWork call no longer being necessary in AllocSlow
Attachment #423813 - Flags: review?(treilly) → review+
Attachment #423810 - Flags: review?(treilly) → review+
Attachment #423813 - Attachment is obsolete: true
redux-argo changeset: 3625:45d0394f4ce3
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: flashplayer-qrb? → flashplayer-qrb+
test added to selftest mmgc_basic in tr-argo 3623:acce1fef425e
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: