OSPreferences::GetInstanceAddRefed() is not safe to call off-main-thread
Categories
(Core :: Internationalization, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
Details
Attachments
(1 file)
The method gfxDWriteFontFamily::LocalizedName uses OSPreferences::GetInstanceAddRefed to get a reference to the preferences service; but LocalizedName may be called off-main-thread, which is bad because OSPreferences doesn't use thread-safe refcounting.
The bug can be demonstrated by running a debug Windows build with gfx.e10s.font-list.shared set to false, and then opening about:preferences. The thread that intends to populate the Font menu will crash with a thread-safety assertion.
In practice it seems highly unlikely this would cause problems, although maybe opening Preferences and then instantly shutting down the browser might possibly cause a race resulting in incorrect behavior (e.g. a leak or a double-free of the OSPreferences singleton). Nevertheless, we should fix it to avoid any risk.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Comment 3•4 years ago
|
||
bugherder |
Description
•