Crash in [@ nsObserverService::EnsureValidCall | nsObserverService::RemoveObserver | LocalesChangedObserver::Unregister]
Categories
(Core :: Widget: Win32, defect, P3)
Tracking
()
People
(Reporter: gsvelto, Assigned: gstoll)
Details
(Keywords: crash, topcrash, Whiteboard: [win:stability])
Crash Data
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Crash report: https://crash-stats.mozilla.org/report/index/dd505b68-cee2-4698-b3be-26bbc0230327
MOZ_CRASH Reason: MOZ_CRASH(Using observer service off the main thread!)
Top 10 frames of crashing thread:
0 xul.dll nsObserverService::EnsureValidCall const xpcom/ds/nsObserverService.cpp:171
0 xul.dll nsObserverService::RemoveObserver xpcom/ds/nsObserverService.cpp:230
1 xul.dll LocalesChangedObserver::Unregister widget/nsBaseWidget.cpp:289
1 xul.dll nsBaseWidget::FreeLocalesChangedObserver widget/nsBaseWidget.cpp:381
1 xul.dll nsBaseWidget::~nsBaseWidget widget/nsBaseWidget.cpp:400
2 xul.dll nsWindow::~nsWindow widget/windows/nsWindow.cpp:782
3 xul.dll nsBaseWidget::Release widget/nsBaseWidget.cpp:130
3 xul.dll mozilla::RefPtrTraits<nsWindow>::Release mfbt/RefPtr.h:50
3 xul.dll RefPtr<nsWindow>::ConstRemovingRefPtrTraits<nsWindow>::Release mfbt/RefPtr.h:381
3 xul.dll RefPtr<nsWindow>::~RefPtr mfbt/RefPtr.h:81
It seems we're destroying a window off the main thread and the cascade of operations is trying to unregister an observer which can only be done in the main thread. I'm not 100% sure who's at fault here so I'm putting this in the widget component for now. This crash signature was probably hidden in bug 1276919.
Reporter | ||
Comment 1•2 years ago
|
||
Added a signature for older Firefox versions.
Updated•2 years ago
|
Comment 2•3 months ago
|
||
The bug is linked to a topcrash signature, which matches the following criterion:
- Top 20 desktop browser crashes on beta
:handyman, could you consider increasing the severity of this top-crash bug?
For more information, please visit BugBot documentation.
Assignee | ||
Updated•3 months ago
|
Assignee | ||
Comment 3•3 months ago
|
||
It looks like UpdateWorkspaceIdTask
(which runs on a background thread) is holding on to a RefPtr<nsWindow>
, which means if it's the last reference to that nsWindow
it will release it on the background thread, leading to this crash. I think making the task just use a WeakPtr
instead should address this.
Assignee | ||
Comment 4•3 months ago
|
||
We avoid this by only holding on to a WeakPtr of the nsWindow so that
the UpdateWorkspaceIdTask will never hold the last reference to the
nsWindow, so it should never Release() it.
Comment 6•3 months ago
|
||
bugherder |
Updated•3 months ago
|
Assignee | ||
Comment 8•2 months ago
|
||
Yeah, I think this is worth doing. Thanks!
Assignee | ||
Comment 9•2 months ago
|
||
We avoid this by only holding on to a WeakPtr of the nsWindow so that
the UpdateWorkspaceIdTask will never hold the last reference to the
nsWindow, so it should never Release() it.
Original Revision: https://phabricator.services.mozilla.com/D243537
Updated•2 months ago
|
Comment 10•2 months ago
|
||
beta Uplift Approval Request
- User impact if declined: users continue to hit a topcrash
- Code covered by automated testing: no
- Fix verified in Nightly: no
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: n/a
- Risk associated with taking this patch: low
- Explanation of risk level: Just taking a weak reference instead of a strong reference. I think it is more likely that this doesn't fix the crash (since we don't have STR), but it should be safe
- String changes made/needed: no
- Is Android affected?: no
Updated•2 months ago
|
Comment 11•2 months ago
|
||
uplift |
Updated•2 months ago
|
Updated•2 months ago
|
Description
•