Closed Bug 1859786 Opened 1 year ago Closed 1 year ago

video_capture_impl.cc:122:7: warning: reading variable '_dataCallBacks' requires holding mutex 'api_lock_' [-Wthread-safety-analysis]

Categories

(Core :: WebRTC: Audio/Video, defect, P2)

defect

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox118 --- unaffected
firefox119 --- unaffected
firefox120 --- fixed

People

(Reporter: pehrsons, Assigned: pehrsons)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

This is a warning in Mozilla-specific code inside libwebrtc, that started when _dataCallbacks got annotated with RTC_GUARDED_BY(api_lock_) in a commit on bug 1851693.

Note that this is still safe, since this lack of locking always happens on the only thread that can modify _dataCallbacks.

The annotations were added in M116:
https://hg.mozilla.org/mozilla-central/rev/9cd372df013948ad822ae936752d725d77474fb5

Note that this was never unsafe, since _dataCallbacks is only written on the
same thread that we are patching here. This patch however, adds helpful static
analysis.

clang-tidy says:
'auto dataCallBack' can be declared as 'auto *dataCallBack'

Set release status flags based on info from the regressing bug 1851693

Pushed by mfroman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/56ff441b6444 Fix lock annotation warning in Mozilla-specific edit on top of video_capture_impl.cc. r=webrtc-reviewers,mjf https://hg.mozilla.org/integration/autoland/rev/26c84d214137 Fix clang-tidy warning in video_capture_impl.cc. r=webrtc-reviewers,mjf
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: