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)
Tamarin Graveyard
Garbage Collection (mmGC)
Tracking
(Not tracked)
RESOLVED
FIXED
Q2 11 - Wasabi
People
(Reporter: treilly, Assigned: pnkfelix)
Details
(Whiteboard: WE:2799636)
Attachments
(1 file)
|
513 bytes,
patch
|
lhansen
:
review+
|
Details | Diff | Splinter Review |
We do assert but later on when we delete the GCAlloc instances and there's allocations. Better to assert when the allocation happens.
Comment 1•15 years ago
|
||
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)
| Reporter | ||
Comment 2•15 years ago
|
||
Attachment #506763 -
Flags: review?(lhansen)
Updated•15 years ago
|
Attachment #506763 -
Flags: review?(lhansen) → review+
Comment 3•15 years ago
|
||
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
| Reporter | ||
Updated•15 years ago
|
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 4•15 years ago
|
||
(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");
Comment 5•15 years ago
|
||
(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");
Updated•15 years ago
|
Flags: flashplayer-bug-
| Assignee | ||
Comment 6•15 years ago
|
||
(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
| Assignee | ||
Comment 8•15 years ago
|
||
Pushed fix to Wasabi. P4 CL 877496.
| Assignee | ||
Updated•15 years ago
|
Whiteboard: WE:2799636
| Assignee | ||
Updated•15 years ago
|
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
Comment 9•15 years ago
|
||
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.
Description
•