Closed Bug 593431 Opened 14 years ago Closed 6 years ago

Thread safety hazards in Traits

Categories

(Tamarin Graveyard :: Verifier, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: edwsmith, Unassigned)

References

Details

(Whiteboard: loose-end)

Attachments

(1 file)

Each instance of Traits has a 1-bit wide commonBase field, which is just a flag used during Verifier::findCommonBase(). With upcoming background compilation, that single bit is not threadsafe. It isn't worth locking around it; findCommonBase() should be rewritten so that it doesn't mutate the Traits objects being analyzed.
Blocks: 538185
m_supertype_cache and m_supertype_neg_cache are mutated by suptypeof(), so might not be threadsafe. This fact might be useful for a two-finger walk in Verifier::findCommonBase(): If the type is a normal class (not an interface) and its inheritance depth is < MAX_PRIMARY_SUPERTYPE, then we can compute its inheritance depth without a tree walk, from m_supertype_offset.
Summary: Traits::commonBase is not threadsafe → Thread safety hazards in Traits
Blocks: 600723
(In reply to comment #0) > Each instance of Traits has a 1-bit wide commonBase field, which is just a flag > used during Verifier::findCommonBase(). > > With upcoming background compilation, that single bit is not threadsafe. It > isn't worth locking around it; findCommonBase() should be rewritten so that it > doesn't mutate the Traits objects being analyzed. I've already included a thread-safe version of findCommonBase in the main patch of bug 600723. See section 5, 'Thread-Safety' in the design notes on comment 3 (https://bugzilla.mozilla.org/show_bug.cgi?id=600723#c3) Taking another look though, I might not be handling interfaces correctly. Will take a look and report back...
(In reply to comment #2) > > Taking another look though, I might not be handling interfaces correctly. Will > take a look and report back... I wasn't doing this correctly. Latest patch of bug 600723 contains a fix.
Assignee: nobody → siwilkin
Flags: flashplayer-qrb+
Assignee: siwilkin → edwsmith
Factored the thread-safe implementation of Verifier::findCommonBase from bug 600723 into this patch.
Target Milestone: --- → Future
Whiteboard: loose-end
Assignee: edwsmith → nobody
Tamarin is a dead project now. Mass WONTFIX.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: