DescriptionFix threading races on HRTFElevation::audioBusMap
According to the crash report (https://cluster-fuzz.appspot.com/testcase?key=6291334197411840),
there is a threading race in HRTFElevation::getConcatenatedImpulseResponsesForSubject.
static PassRefPtr<AudioBus> getConcatenatedImpulseResponsesForSubject(...) {
typedef HashMap<String, RefPtr<AudioBus> > AudioBusMap;
DEFINE_STATIC_LOCAL(AudioBusMap, audioBusMap, ());
RefPtr<AudioBus> bus;
AudioBusMap::iterator iterator = audioBusMap.find(subjectName); // (A)
if (iterator == audioBusMap.end()) {
...;
audioBusMap.set(subjectName, bus); // (B)
}
}
It's possible that:
(1) Thread 1 executes (A)
(2) Thread 2 executes (A)
(3) Thread 1 executes (B)
(4) Thread 2 executes (B) and crashes.
This CL protects accesses to the AudioBusMap with mutex.
BUG=270758
No tests because the crash depends on threading races and thus not reproducible.
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157273
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #Patch Set 4 : #
Total comments: 1
Messages
Total messages: 12 (0 generated)
|