Changeset 281001 in webkit
- Timestamp:
- Aug 12, 2021, 6:13:17 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/audio/cocoa/CARingBuffer.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r280988 r281001 1 2021-08-12 David Kilzer <ddkilzer@apple.com> 2 3 ThreadSanitizer: data race in WebCore::CARingBufferStorageVector::setCurrentFrameBounds() / getCurrentFrameBounds() 4 <https://webkit.org/b/229014> 5 <rdar://problem/81817224> 6 7 Reviewed by Chris Dumez. 8 9 This turned out to be a false-positive since reads and writes 10 are protected differently, and it's okay if a read returns data 11 from the ring buffer that is one slot older than the current 12 write. 13 14 Covered by layout tests running with TSan: 15 fast/mediastream/getUserMedia-webaudio.html 16 fast/mediastream/mediastreamtrack-audio-clone.html 17 imported/w3c/web-platform-tests/webrtc/RTCDTMFSender-insertDTMF.https.html 18 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https.html 19 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-track-stats.https.html 20 imported/w3c/web-platform-tests/webrtc/protocol/missing-fields.html 21 webrtc/audio-peer-connection-g722.html 22 webrtc/audio-peer-connection-webaudio.html 23 webrtc/audio-replace-track.html 24 webrtc/peer-connection-audio-mute.html 25 webrtc/peer-connection-audio-mute2.html 26 webrtc/peer-connection-createMediaStreamDestination.html 27 webrtc/peer-connection-remote-audio-mute.html 28 webrtc/peer-connection-remote-audio-mute2.html 29 30 * platform/audio/cocoa/CARingBuffer.cpp: 31 (WebCore::CARingBufferStorageVector::getCurrentFrameBounds): 32 (WebCore::CARingBufferStorageVector::currentStartFrame const): 33 (WebCore::CARingBufferStorageVector::currentEndFrame const): 34 - Add SUPPRESS_TSAN attribute since reads are protected by 35 std::atomic<int32_t> m_timeBoundsQueuePtr only being 36 incremented after the next m_timeBoundsQueue slot is updated. 37 Writes are potected by 38 Locker locker { m_currentFrameBoundsLock }. 39 1 40 2021-08-12 Alex Christensen <achristensen@webkit.org> 2 41 -
trunk/Source/WebCore/platform/audio/cocoa/CARingBuffer.cpp
r278755 r281001 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 326 326 } 327 327 328 void CARingBufferStorageVector::getCurrentFrameBounds(uint64_t& startFrame, uint64_t& endFrame)328 SUPPRESS_TSAN void CARingBufferStorageVector::getCurrentFrameBounds(uint64_t& startFrame, uint64_t& endFrame) 329 329 { 330 330 uint32_t curPtr = m_timeBoundsQueuePtr.load(); … … 358 358 } 359 359 360 uint64_t CARingBufferStorageVector::currentStartFrame() const360 SUPPRESS_TSAN uint64_t CARingBufferStorageVector::currentStartFrame() const 361 361 { 362 362 uint32_t index = m_timeBoundsQueuePtr.load() & kGeneralRingTimeBoundsQueueMask; … … 369 369 } 370 370 371 uint64_t CARingBufferStorageVector::currentEndFrame() const371 SUPPRESS_TSAN uint64_t CARingBufferStorageVector::currentEndFrame() const 372 372 { 373 373 uint32_t index = m_timeBoundsQueuePtr.load() & kGeneralRingTimeBoundsQueueMask;
Note:
See TracChangeset
for help on using the changeset viewer.