Closed Bug 1759501 Opened 9 months ago Closed 9 months ago

Turn on clang thread-safety analysis

Categories

(Developer Infrastructure :: Source Code Analysis, enhancement)

enhancement

Tracking

(firefox100 fixed)

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: jesup, Assigned: jesup)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Bug 1207753 is landing very soon; this is to turn on thread-safety analysis by default. As part of this landing, we'll be sending email to dev.platform requiring people to resolve all thread-safety warnings to land code (and to add thread-safety annotations to any new Mutexes and Monitors).

Depends on: threadsafety

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::Source Code Analysis' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Source Code Analysis
Attachment #9267653 - Attachment description: WIP: Bug 1759501: turn on clang thread-safety checking → Bug 1759501: turn on clang thread-safety checking r=mhentges
Pushed by rjesup@wgate.com:
https://hg.mozilla.org/integration/autoland/rev/64ec4c736bb4
turn on clang thread-safety checking r=firefox-build-system-reviewers,mhentges

Backed out changeset 64ec4c736bb4 (bug 1759501) for causing build bustages in dom/base/BodyStream.cpp

Backout link: https://hg.mozilla.org/integration/autoland/rev/73c7e32cb77b953cda162a92f291ece2e71a1b5b

Push with failures

Failure log

INFO -  In file included from Unified_cpp_dom_base0.cpp:74:
[task 2022-03-17T23:42:54.816Z] 23:42:54    ERROR -  /builds/worker/checkouts/gecko/dom/base/BodyStream.cpp:534:21: error: releasing mutex 'mMutex' that was not held [-Werror,-Wthread-safety-analysis]
[task 2022-03-17T23:42:54.816Z] 23:42:54     INFO -      MutexAutoUnlock unlock(mMutex);
[task 2022-03-17T23:42:54.816Z] 23:42:54     INFO -                      ^
[task 2022-03-17T23:42:54.816Z] 23:42:54    ERROR -  /builds/worker/checkouts/gecko/dom/base/BodyStream.cpp:763:19: error: releasing mutex 'mMutex' that was not held [-Werror,-Wthread-safety-analysis]
[task 2022-03-17T23:42:54.816Z] 23:42:54     INFO -    MutexAutoUnlock unlock(mMutex);
Flags: needinfo?(rjesup)
Attachment #9267653 - Attachment description: Bug 1759501: turn on clang thread-safety checking r=mhentges → Bug 1759501: turn on clang thread-safety checking r=#firefox-build-system-reviewers
Pushed by rjesup@wgate.com:
https://hg.mozilla.org/integration/autoland/rev/5da7ce787cba
turn on clang thread-safety checking r=firefox-build-system-reviewers,mhentges,andi
Flags: needinfo?(rjesup)
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch

This busted our Linux and macOS builds: https://treeherder.mozilla.org/jobs?repo=comm-central&revision=4e025c3a344db820d3515ed8263ee385570d4175
Any pointers on how to fix it, if this needs porting or is our code the culprit?

See Also: → 1760353
Blocks: threadsafety
No longer depends on: threadsafety
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.