Closed Bug 627032 Opened 15 years ago Closed 15 years ago

We should assert on allocations during shutdown

Categories

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

defect

Tracking

(Not tracked)

RESOLVED FIXED
Q2 11 - Wasabi

People

(Reporter: treilly, Assigned: pnkfelix)

Details

(Whiteboard: WE:2799636)

Attachments

(1 file)

We do assert but later on when we delete the GCAlloc instances and there's allocations. Better to assert when the allocation happens.
When we do this, let's add a way to signal "might allocate"... ie, say we have void foo() { if (something) gc->Alloc()... } we want *every* call to foo() to warn us if called during finalization. So maybe add a debug-only trigger so we could write it as void foo() { GC_MIGHT_ALLOC(); if (something) gc->Alloc()... } this would be useful to put in methods that don't obviously allocate and might be tempting to call from finalizers (eg List::clear)
Attached patch add assertSplinter Review
Attachment #506763 - Flags: review?(lhansen)
Attachment #506763 - Flags: review?(lhansen) → review+
changeset: 5836:2901a5e58c3e user: Tommy Reilly <treilly@adobe.com> summary: Bug 627032 - We should assert on allocations during shutdown (r=lhansen) http://hg.mozilla.org/tamarin-redux/rev/2901a5e58c3e
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
(In reply to comment #1) > When we do this, let's add a way to signal "might allocate"... ie, say we have > > void foo() { if (something) gc->Alloc()... } > > we want *every* call to foo() to warn us if called during finalization. So > maybe add a debug-only trigger so we could write it as > > void foo() { GC_MIGHT_ALLOC(); if (something) gc->Alloc()... } > > this would be useful to put in methods that don't obviously allocate and might > be tempting to call from finalizers (eg List::clear) Why not just do: AvmAssertMsg(!gc->Destroying(), "Don't call clear shutdown finalizer");
(In reply to comment #4) > AvmAssertMsg(!gc->Destroying(), "Don't call clear shutdown finalizer"); Sure, that would work, but encapsulating it in a purpose-built macro makes for cleaner code. #define GC_MIGHT_ALLOC() vmAssertMsg(!gc->Destroying(), "Not legal to call during GC shutdown");
Flags: flashplayer-bug-
(In reply to comment #1) > When we do this, let's add a way to signal "might allocate"... ie, say we have > > void foo() { if (something) gc->Alloc()... } > > we want *every* call to foo() to warn us if called during finalization. So > maybe add a debug-only trigger so we could write it as > > void foo() { GC_MIGHT_ALLOC(); if (something) gc->Alloc()... } > > this would be useful to put in methods that don't obviously allocate and might > be tempting to call from finalizers (eg List::clear) I've been mulling over trying to layer an ad-hoc "effect system" (a la Lucassen+Gifford '88) atop dehydra, so that we could determine these sorts of thing statically. It is probably the sort of thing that would be too much work for one off cases like this, but if it were sufficiently generalized it could also catch e.g. allocations from finalizers.
Clearer error message should beadded and the change submitted to both Wasabi and Serrano. Targeting Wasabi, assigned to Felix.
Assignee: treilly → fklockii
Status: RESOLVED → REOPENED
Flags: flashplayer-qrb+
Flags: flashplayer-injection-
Resolution: FIXED → ---
Target Milestone: Q3 11 - Serrano → Q2 11 - Wasabi
Pushed fix to Wasabi. P4 CL 877496.
Whiteboard: WE:2799636
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Fix submitted to Wasabi with P4 CL: 877921, Verified fixed by player qe with player 10.3.180.77 I will check with Tommy to see if there is a shell testcase that makes sense to add here.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: