Closed Bug 1852801 Opened 2 years ago Closed 2 years ago

startup Crash in [@ mozilla::widget::WinEventHub::GetWnd]

Categories

(Core :: Widget: Win32, defect)

Unspecified
Windows
defect

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- fixed
firefox117 --- wontfix
firefox118 --- fixed
firefox119 --- fixed

People

(Reporter: aryx, Assigned: bradwerth)

References

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

Not a new crash signature. Approximately 90 crashes for Firefox 116.0.x, all on Windows.

Crash report: https://crash-stats.mozilla.org/report/index/7dc37843-ce1a-4cd2-aaa7-f6be20230911

Reason: EXCEPTION_ACCESS_VIOLATION_READ

Top 10 frames of crashing thread:

0  xul.dll  mozilla::widget::WinEventHub::GetWnd  widget/windows/WinEventObserver.h:45
0  xul.dll  mozilla::widget::SessionChangeObserver::SessionChangeObserver  widget/windows/WinEventObserver.cpp:181
1  xul.dll  mozilla::widget::SessionChangeObserver::Create  widget/windows/WinEventObserver.cpp:171
2  xul.dll  mozilla::widget::WinWindowOcclusionTracker::WinWindowOcclusionTracker  widget/windows/WinWindowOcclusionTracker.cpp:536
3  xul.dll  mozilla::widget::WinWindowOcclusionTracker::Ensure  widget/windows/WinWindowOcclusionTracker.cpp:365
4  xul.dll  gfxPlatform::InitLayersIPC  gfx/thebes/gfxPlatform.cpp:1308
4  xul.dll  gfxPlatform::Init  gfx/thebes/gfxPlatform.cpp:973
5  xul.dll  gfxPlatform::GetPlatform  gfx/thebes/gfxPlatform.cpp:463
6  xul.dll  gfxPlatform::InitializeCMS  gfx/thebes/gfxPlatform.cpp:2107
7  xul.dll  gfxPlatform::EnsureCMSInitialized  gfx/thebes/gfxPlatform.h:968
Flags: needinfo?(bwerth)

Interesting. It seems that [this call to WinEventHub::Ensure() is failing to generate the singleton in WinEventHub::Initialize(). Indeed, the crash report notes a "Last Error Value ERROR_CANNOT_FIND_WND_CLASS" which seems like the sort of error that might be thrown in that case.

But what to do about it? I'll make WinEventHub::Ensure() return a bool, but all that would do is keep mSessionChangeObserver null and turn off occlusion tracking. That will fix the crash, but we'd have no occlusion tracking which would silently lead to other problems. I'll create a patch that does that and if the reviewers see a better solution, I'll refine it.

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

This patch also expands the use of EnsureDisplayStatusObserver and
EnsureSessionChangeObserver, using them during the WinWindowOcclusionTracker
constructor, and also in WinWindowOcclusionTracker::Ensure. This gives another
opportunity for these observers to be created when
WinUtils::EnableWindowOcclusion is called.

Pushed by bwerth@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/59ff0be2d94f Allow WinWindowOcclusionTracker members to fail initialization without crashing. r=rkraesig,win-reviewers
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch

The patch landed in nightly and beta is affected.
:bradwerth, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox118 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(bwerth)

Comment on attachment 9352773 [details]
Bug 1852801: Allow WinWindowOcclusionTracker members to fail initialization without crashing.

Beta/Release Uplift Approval Request

  • User impact if declined: Occasional startup crashes in Windows in unusual situations.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This just null-checks a few areas of code. What would have triggered a crash will now instead trigger some confusion about whether or not the window is fully occluded, which could lead to increased power consumption for fully-occluded windows.
  • String changes made/needed:
  • Is Android affected?: No
Flags: needinfo?(bwerth)
Attachment #9352773 - Flags: approval-mozilla-beta?

Comment on attachment 9352773 [details]
Bug 1852801: Allow WinWindowOcclusionTracker members to fail initialization without crashing.

Approved for landing on mozilla-beta before the merge, will be in the 118.0 release candidate, thanks.

Attachment #9352773 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9352773 - Flags: approval-mozilla-esr115?

Comment on attachment 9352773 [details]
Bug 1852801: Allow WinWindowOcclusionTracker members to fail initialization without crashing.

Approved for 115.3esr

Attachment #9352773 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
See Also: → 1571516
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: