Closed Bug 628355 Opened 15 years ago Closed 14 years ago

GCMember's inheriting from GCRef opens us up for missing write barriers

Categories

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

defect

Tracking

(Not tracked)

RESOLVED FIXED
Q3 11 - Serrano

People

(Reporter: treilly, Assigned: treilly)

References

Details

Attachments

(5 files)

Say I have a function: void retrieve(GCRef<Foo>& t); I can do: GCRef<Foo> t; retrieve(t); But I can also pass a GCMember since GCMember inherits from GCRef and blamo, missing write barrier.
Flags: flashplayer-bug+
Priority: P2 → P3
Priority: P3 → P4
Priority: P4 → P3
Blocks: 565664
Priority: P3 → --
Target Milestone: Q3 11 - Serrano → Future
Assignee: nobody → treilly
Priority: -- → P2
Target Milestone: Future → Q3 11 - Serrano
Memo to all: descriptive bug titles makes it easier to understand whether a bug is important, when skimming a bug list...
Summary: Should GCMember inherit from GCRef? → GCMember's inheriting from GCRef opens us up for missing write barriers
Spotted in the wild WE #2869733
Status: NEW → ASSIGNED
Okay I spent some time searching for a way to solve this w/o making GCRef not inherit from GCMember and none occurred to me or worked.
(In reply to comment #3) > Okay I spent some time searching for a way to solve this w/o making GCRef > not inherit from GCMember and none occurred to me or worked. What do we actually need to support the majority of the use cases? Could we get away with removing the inheritance relationship and putting in a cast operator, i.e. operator (GCMember<T>)()?
Attached file v2 this seems to work
Attached file v3 me likey
Use asserts to fix this issue, I could find no solution that made GCMember not inherit from GCRef that didn't involve fixing hundreds of compile errors in the player (that would have required .staticCast<T>() to downcast things where it isn't needed today). An assert is almost as good.
Attachment #533044 - Flags: review?(lhansen)
Comment on attachment 533044 [details] [diff] [review] Assert when a GCRef or GCRef_Union is used to write to GC memory I fear we're heading down the wrong path here. The reality appears to be that GCRef and GCMember are simply two different things, and should not be related by (sub)type. That C++ cannot express their relationship reasonably well is unfortunate but should that force us to invent a relationship that does not exist?
I agree (otherwise I wouldn't have spent days trying to come up with a solution) but I didn't want to spend even more time changing hundreds of lines of player code to make this change. The asserts were effective at catching the two places we did this in the code (we #2782301 and #2869733).
Comment on attachment 533044 [details] [diff] [review] Assert when a GCRef or GCRef_Union is used to write to GC memory R+ then.
Attachment #533044 - Flags: review?(lhansen) → review+
changeset: 6338:15cf30169408 user: Tommy Reilly <treilly@adobe.com> summary: Bug 628355 - Assert when a GCRef is used to write to GC memory bypassing write barrier (r=lhansen) http://hg.mozilla.org/tamarin-redux/rev/15cf30169408
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
(In reply to comment #13) > changeset: 6338:15cf30169408 > user: Tommy Reilly <treilly@adobe.com> > summary: Bug 628355 - Assert when a GCRef is used to write to GC memory > bypassing write barrier (r=lhansen) > > http://hg.mozilla.org/tamarin-redux/rev/15cf30169408 Reopening bug, patch has not landed in tamarin-redux-serrano for this serrano targeted bug
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: