Closed Bug 1760353 Opened 3 years ago Closed 3 years ago

bustage: /builds/worker/checkouts/gecko/comm/mailnews/imap/src/nsImapProtocol.cpp:4495:7: error: mutex 'm_waitForBodyIdsMonitor' is not held on every path through here [-Werror,-Wthread-safety-analysis]

Categories

(Thunderbird :: Upstream Synchronization, defect, P5)

Tracking

(thunderbird_esr91 unaffected)

RESOLVED FIXED
100 Branch
Tracking Status
thunderbird_esr91 --- unaffected

People

(Reporter: intermittent-bug-filer, Assigned: benc)

References

Details

Attachments

(1 file)

Pushed by thunderbird@calypsoblue.org: https://hg.mozilla.org/comm-central/rev/dbccf34ef270 Fix m_waitForBodyIdsMonitor issue after bug 1759501. r=rjl

Ben, can you check how we should fix this properly?

Flags: needinfo?(benc)

Hmm... I think the original code was OK.
Maybe the static analysis was getting confused by the entered_waitForBodyIdsMonitor flag? If so, I'm a little surprised it'd trip up on something so straightforward... maybe there was some subtle complication- the flag being set after the Enter() call, perhaps?

In any case, it was a little shonky, so I've rearranged things to ditch the flag altogether.

try run here:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=0ffb150e743649110843d3d5f0d22cf042106e32

I assume that does the static analysis? If so, and it works, I'll submit it via phab.
What is the magic incantation to run a static analysis locally? I'm sure I've done that in the past, but it eludes me now...

Assignee: nobody → benc
Flags: needinfo?(benc)

(In reply to Ben Campbell from comment #6)

What is the magic incantation to run a static analysis locally? I'm sure I've done that in the past, but it eludes me now...

AFAIK, if you have ac_add_options --enable-warnings-as-errors in your .mozconfig many (all?) of the static analysis error will show up locally when compiling

Other than that, see docs at https://firefox-source-docs.mozilla.org/code-quality/static-analysis/existing.html

Status: NEW → ASSIGNED
Target Milestone: --- → 100 Branch

(In reply to Magnus Melin [:mkmelin] from comment #7)

AFAIK, if you have ac_add_options --enable-warnings-as-errors in your .mozconfig many (all?) of the static analysis error will show up locally when compiling

Thanks - that did the trick nicely! (Although it didn't do much for my build times: now >90mins!)

Confirmed that I got the compile error when I backed out your NO_THREAD_SAFETY_ANALYSIS fix.
And confirmed that the build works with my new patch, so I'm submitted it to phab.
Still not 100% certain why the static analyzer picked it up in the first place, but even if it was erroneous, I think my patch cleans up some cruft as well as satisfying the analyzer.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/55e518879968
Fix possible bogus release of un-held waitForBodyIdsMonitor object in IMAP. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: