Closed Bug 1932088 Opened 1 year ago Closed 4 months ago

Crash in [@ mozilla::CollectSingleStepData<T>]

Categories

(Core :: Widget: Win32, defect, P3)

Unspecified
Windows 11
defect

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox-esr140 --- wontfix
firefox151 --- wontfix
firefox152 --- wontfix
firefox153 --- fixed

People

(Reporter: gsvelto, Assigned: yannis)

Details

(Keywords: crash, topcrash, topcrash-startup)

Crash Data

Attachments

(1 file)

Crash report: https://crash-stats.mozilla.org/report/index/926ee853-666b-40e8-b903-e2f8f0241113

Reason:

EXCEPTION_STACK_BUFFER_OVERRUN / FAST_FAIL_GUARD_ICALL_CHECK_FAILURE

Top 10 frames:

0  ntdll.dll  LdrpICallHandler
1  ntdll.dll  RtlpExecuteHandlerForException
2  ntdll.dll  RtlDispatchException
3  ntdll.dll  KiUserExceptionDispatch
4  ntdll.dll  LdrpDispatchUserCallTarget
5  mozglue.dll  mozilla::CollectSingleStepData<void (*)()>(void (*)(), std::function<bool (vo...  mozglue/misc/WindowsDiagnostics.h:131
6  mozglue.dll  mozilla::CollectStackWalkLocks(mozilla::Array<void*, 2>&)  toolkit/xre/dllservices/mozglue/WindowsStackWalkInitialization.cpp:102
6  mozglue.dll  mozilla::WindowsStackWalkInitialization()  toolkit/xre/dllservices/mozglue/WindowsStackWalkInitialization.cpp:59
7  xul.dll  mozilla::BackgroundHangMonitor::Startup()  toolkit/components/backgroundhangmonitor/BackgroundHangMonitor.cpp:606
8  xul.dll  NS_InitXPCOM(nsIServiceManager**, nsIFile*, nsIDirectoryServiceProvider*, bool)  xpcom/build/XPCOMInit.cpp:509

Looks like some kind of stack corruption while we collect single-step data. This was caught by WER but I noticed it by looking at crash ping data.

Flags: needinfo?(yjuglaret)

FYI in terms of pings this looks like 100's of crashes all coming from a single user, but the crashes we have on file on Socorro appear to be from two distinct ones.

(In reply to Gabriele Svelto [:gsvelto] from comment #1)

FYI in terms of pings this looks like 100's of crashes all coming from a single user, but the crashes we have on file on Socorro appear to be from two distinct ones.

The two crashes in Socorro have different listed causes:

  • The first is EXCEPTION_SINGLE_STEP. I assume this one came in through WER? If I had to guess, I'd guess that the process was being run under a debugger, and that our exception handler and theirs got crossed somehow. I don't actually see how that could happen, though.

  • The second is EXCEPTION_STACK_BUFFER_OVERRUN / FAST_FAIL_GUARD_ICALL_CHECK_FAILURE. That one went off the rails when the indirection-check for the debugging function reported it to be a bad destination address. I have no hypothesis as to why, other than a single-event upset; I can't test that hypothesis, though, because it doesn't look like the address it was trying to jump to was stored in the minidump. (Or at least I couldn't find it.)

Severity: -- → S3
Priority: -- → P3

It's the EXCEPTION_STACK_BUFFER_OVERRUN / FAST_FAIL_GUARD_ICALL_CHECK_FAILURE that came via WER, because it's failing via __fastfail() so the regular exception handle can't catch it. The EXCEPTION_SINGLE_STEP one on the other hand is the one that has hundreds of crash pings corresponding to it.

Closing because no crashes reported for 12 weeks.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME

This seems to be spiking again on Nightly recently (currently the #1 overall topcrash by volume). But it looks like a huge number of reports coming from a single install, so I'm not entirely sure what to make of it.

Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---

The bug is linked to a topcrash signature, which matches the following criterion:

  • Top 10 desktop browser crashes on nightly

:gstoll, could you consider increasing the severity of this top-crash bug?

For more information, please visit BugBot documentation.

Flags: needinfo?(gstoll)
Keywords: topcrash

:yannis, any idea what might be going on here?

It's unfortunate that this is marked as a topcrash if only one person is hitting this, though...

Flags: needinfo?(gstoll)

The bug is linked to a topcrash signature, which matches the following criterion:

  • Top 10 desktop browser crashes on nightly (startup)

For more information, please visit BugBot documentation.

These crashes all come from users of the Panda Security antivirus. We can see their DLLs (PSNInjHookMS64.dll, PSNInjTools64.dll, PSNInjComm64.dll, PSNInjHookPlg64.dll) being injected into Firefox processes, even in old crashes not from the recent single-user spike. They are likely interfering with vectored exception handlers in some way (in our case, we set up our SingleStepExceptionHandler and rely on it being called).

I'll see if I can reproduce locally by messing with vectored exception handlers myself, and write a patch to also catch the exception via SEH as a fallback.

This impacts Nightly more than other channels because this code path is used by the Background Hang Reporter. For Beta and Release, only using the Firefox Profiler can trigger this code path, so I won't be asking for uplifts.

Flags: needinfo?(yjuglaret)

On Windows, we use single-step execution to collect the addresses of
some ntdll-internal locks that are required for deadlock-free profiling.
We achieve this by setting up a vectored exception handler that handles
single-step exceptions.

Based on crash data, third-party antivirus software can get in the way
of our handler, preventing it from running and thus letting the
single-step exception escape the VEH chain. When that happens, the user
will crash.

This patch thus adds a SEH handler to catch the single-step exception
and fail cleanly in case the exception escapes the VEH chain.

Assignee: nobody → yjuglaret
Pushed by yjuglaret@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2b304ea0d98f https://hg.mozilla.org/integration/autoland/rev/d9b42d8bb5f4 Fail cleanly via SEH if a single-step exception escapes the VEH chain. r=win-reviewers,gstoll
Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6cd7c2aacba6 https://hg.mozilla.org/integration/autoland/rev/b5786c639e2e Revert "Bug 1932088 - Fail cleanly via SEH if a single-step exception escapes the VEH chain. r=win-reviewers,gstoll" for causing failures at WindowsDiagnostics.h.
Attachment #9586646 - Attachment description: Bug 1932088 - Fail cleanly via SEH if a single-step exception escapes the VEH chain. r=#win-reviewers → WIP: Bug 1932088 - Fail cleanly via SEH if a single-step exception escapes the VEH chain. r=#win-reviewers

Thanks for the backout. I'll fix the spidermonkey build issue.

Flags: needinfo?(yjuglaret)
Attachment #9586646 - Attachment description: WIP: Bug 1932088 - Fail cleanly via SEH if a single-step exception escapes the VEH chain. r=#win-reviewers → Bug 1932088 - Fail cleanly via SEH if a single-step exception escapes the VEH chain. r=#win-reviewers
Pushed by yjuglaret@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f2ec13393e45 https://hg.mozilla.org/integration/autoland/rev/1a58a41533c6 Fail cleanly via SEH if a single-step exception escapes the VEH chain. r=win-reviewers,gstoll
Status: REOPENED → RESOLVED
Closed: 1 year ago → 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
QA Whiteboard: [qa-triage-done-c154/b153]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: