Closed Bug 1826374 Opened 1 year ago Closed 1 year ago

Hang when quickly switching between tabs with signed S/MIME messages

Categories

(MailNews Core :: Security: S/MIME, defect)

defect

Tracking

(thunderbird_esr102 fixed, thunderbird113 fixed)

RESOLVED FIXED
113 Branch
Tracking Status
thunderbird_esr102 --- fixed
thunderbird113 --- fixed

People

(Reporter: KaiE, Assigned: KaiE)

Details

Attachments

(2 files)

I have several tabs open with signed S/MIME messages.
I used the keyboard shortcut to cycle between them quickly.
While doing so, Thunderbird hung.

I saw that we had two different threads processing code from SMimeVerificationTask,
the main thread in CallCallback, and the transport thread in CalculateResult.

It were different objects, but all objects share a mutex, so it was a deadlock.

I think we can avoid that deadlock, while still sharing the global mutex.

In SMimeVerificationTask::CallCallback, we don't need to hold the lock while calling mListener->Notify. We can release the objects from the member variables while holding the locks, then release the lock, then make the call.

Assignee: nobody → kaie
Status: NEW → ASSIGNED

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/c669d228b56a
Avoid a deadlock in SMimeVerificationTask. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch

Comment on attachment 9326921 [details]
Bug 1826374 - Avoid a deadlock in SMimeVerificationTask. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #): no
User impact if declined: hang
Testing completed (on c-c, etc.): yes
Risk to taking this patch (and alternatives if risky): low

Attachment #9326921 - Flags: approval-comm-esr102?

Comment on attachment 9326921 [details]
Bug 1826374 - Avoid a deadlock in SMimeVerificationTask. r=mkmelin

[Triage Comment]
Approved via Matrix for 102 by wsmwk

Attachment #9326921 - Flags: approval-comm-esr102? → approval-comm-esr102+
Attachment #9329272 - Flags: approval-comm-esr102?
Attachment #9329272 - Flags: approval-comm-beta?

We need to backout the original patches, it introduced bug 1828558.

I've attached a better fix, a lock introduced in bug 1811298 was unnecessary.

Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/ebef1793369d
Remove unnecessary lock that was added in bug 1811298. r=rjl

Comment on attachment 9329272 [details]
Bug 1826374 - Remove unnecessary lock that was added in bug 1811298. r=mkmelin

[Triage Comment]
Approved for beta by wsmwk and kaie via Matrix

Attachment #9329272 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9329272 [details]
Bug 1826374 - Remove unnecessary lock that was added in bug 1811298. r=mkmelin

[Triage Comment]
Approved for esr102

Attachment #9329272 - Flags: approval-comm-esr102? → approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: