Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve VM crash dumping #1637

Merged
merged 4 commits into from
Apr 13, 2025
Merged

Conversation

slipher
Copy link
Member

@slipher slipher commented Apr 2, 2025

  • Produce NaCl crash dumps when there is a fatal C++ exception. Previously it was printing the exception but failing to trigger a crash dump.
  • Fix MSVC native exe terminate handler which could never be called.
  • Add a cvar sgame.nativeExeCrashHandler (likewise for cgame) which can be used to disable the crash handler in order to produce traditional core dumps for native exe gamelogic.

Note: to test NaCl crash handling on amd64 Linux, you need the fixed nacl_loader from #1504 (comment).

slipher added 4 commits April 1, 2025 02:38
It turns out that using SetUnhandledExceptionFilter clobbers the
standard library's mechanism for calling std::terminate on unhandled
exceptions.
Now we can both produce a crash dump, and report the exception message
with SendMsg<ErrorMsg> (which sets the text in the UI error message).
6ebd858 was supposed to do that, but I messed up the final version of
the commit and called SendMsg<ErrorMsg> too early, so the crash dump was
not produced.
So server owners who want to get Unix core dumps for native exe
gamelogic could set sgame.nativeExeCrashHandler to 0. Doing this stops
the crash handler from being installed. In case of a fatal C++ exception
we still install the terminate handler so we can log the exception
message, but afterward, if the cvar is off, we call abort() instead of
shutting down with the ErrorMsg IPC.
@slipher
Copy link
Member Author

slipher commented Apr 13, 2025

I guess I will merge this in honor of merging without review day.

@slipher slipher merged commit 7297309 into DaemonEngine:master Apr 13, 2025
9 checks passed
@slipher slipher deleted the error-handling branch April 13, 2025 20:41
@illwieckz
Copy link
Member

Yes, we better merge that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants