Closed Bug 1156929 Opened 7 years ago Closed 1 year ago

TSan: data race dom/media/MediaStreamGraph.cpp:1507 OneIteration


(Core :: Audio/Video: MediaStreamGraph, defect, P3)






(Reporter: froydnj, Unassigned)


(Blocks 2 open bugs)


(Whiteboard: [tsan])


(1 file)

The attached logfile shows a thread/data race detected by TSan (ThreadSanitizer).

* Specific information about this bug

I do not understand this report.  I think, from the writing side of the race, that we are calling:


in ThreadedDriver::RunThread.  That makes sense of the assign_assuming_AddRef call, even though the SetCurrentDriver call is on a different line than what's reported.

The reading side of the race, however, is just a call to MediaStreamGraphImpl::Process(), not a read of an nsRefPtr.  I'm guessing that the compiler must have inlined Process(), and then that the read must come from calling MediaStreamGraphImpl::CurrentDriver() during Process()?

Other theories welcome.

* General information about TSan, data races, etc.

Typically, races reported by TSan are not false positives, but it is possible that the race is benign. Even in this case though, we should try to come up with a fix unless this would cause unacceptable performance issues. Also note that seemingly benign races can possibly be harmful (also depending on the compiler and the architecture) [1][2].

If the bug cannot be fixed, then this bug should be used to either make a compile-time annotation for blacklisting or add an entry to the runtime blacklist.

[2] _How to miscompile programs with "benign" data races_:
Blocks: MSRI
Component: Audio/Video → Audio/Video: MSG/cubeb/GMP
Was this fixed by your recent landings?
Rank: 27
Flags: needinfo?(padenot)
Priority: -- → P2
It ought to, bug I haven't landed anything yet, it's going through try right now.
Flags: needinfo?(padenot)
Mass change P2->P3 to align with new Mozilla triage process.
Priority: P2 → P3

This appears to be fixed, as it seems to be called only on its owning thread now.

Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.