Closed Bug 1776903 Opened 2 years ago Closed 2 years ago

JaUrl objects still not quite threadsafe

Categories

(MailNews Core :: Backend, defect)

Thunderbird 91
defect

Tracking

(thunderbird_esr102+ fixed)

RESOLVED FIXED
104 Branch
Tracking Status
thunderbird_esr102 + fixed

People

(Reporter: neil, Assigned: neil)

References

Details

(Keywords: crash)

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1727595 +++

Ben seems to be able to crash Thunderbird by releasing a JaUrl object on the cycle collector thread. Although the JaUrl object declares itself as threadsafe, one of its members is a non-threadsafe object, which means that it needs to be released on the main thread. (IMAP URL objects already do something similar for some of their members.)

I've since found some more members that aren't threadsafe. I think this crash can actually occur on Thunderbird 91 although I'm hitting it more often on Thunderbird 102.

Attached patch Proposed patchSplinter Review
Attachment #9283245 - Flags: review?(mkmelin+mozilla)

Comment on attachment 9283245 [details] [diff] [review]
Proposed patch

PDF viewer is using a web worker to do some of its work.

In JsAccount, part of the account is implemented in JS, so in ExQuilla, the URL object contains a JS object. JS objects are created on the main thread and need to be destroyed there.

I've verified in the code JaUrl.h that the added properties here are all applicable properties. The only other properties are C++ objects and don't need to be released on the main thread.

r+

Attachment #9283245 - Flags: review?(mkmelin+mozilla) → review+
Status: NEW → ASSIGNED

Comment on attachment 9283245 [details] [diff] [review]
Proposed patch

[Approval Request Comment]
Regression caused by (bug #):

  • Crash starts appearing when PDFs load in a tab

User impact if declined:

  • Crash when opening PDFs in ExQuilla

Testing completed (on c-c, etc.):

  • Reproducably crashes without the patch
  • Does not crash with the patch

Risk to taking this patch (and alternatives if risky):

  • Only affects Owl and ExQuilla
Attachment #9283245 - Flags: approval-comm-esr102?
Target Milestone: --- → 104 Branch

Pushed by nicolai@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/eb4915ba8c2e
Ensure JaUrl's other unsafe references are released on the main thread. r=BenB

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

Comment on attachment 9283245 [details] [diff] [review]
Proposed patch

[Triage Comment]
Approved for esr102

Attachment #9283245 - 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: