Capture every GameThread exception in native_crash.log to identify the real DrawThread killer - #239
Merged
Conversation
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/2e0e3d1e-4954-4a75-be3c-233040b818ef Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
winnerspiros
April 22, 2026 13:38
View session
winnerspiros
marked this pull request as ready for review
April 22, 2026 13:38
There was a problem hiding this comment.
Pull request overview
This PR expands Android crash diagnostics to ensure the actual exception killing the process (especially on osu.Framework GameThreads where Mono may abort via tgkill(SIGSEGV) without reaching AppDomain.UnhandledException) is captured into native_crash.log.
Changes:
- Adjust
FirstChanceExceptionlogging policy to log all exceptions on GameThreads (Draw/Update/Audio/Input/GameThread) while keeping the existing “fatal-ish exception types” filter for other threads. - Add a helper to identify osu.Framework GameThreads by stable thread-name patterns.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+231
to
234
| if (isGameThread || isFatalKind) | ||
| { | ||
| writeManagedException($"FirstChanceException ({e.Exception.GetType().Name})", e.Exception); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The latest tombstone shows the DrawThread dying ~5s into startup with
signal 11 SIGSEGV, code -6 (SI_TKILL), pc=0x0andlrinside a JIT mapping — the Mono-re-raises-a-managed-exception-via-tgkillpattern. UTF-16 fragments left in stack scratch memory ("…argeting a Texture with format ","A TextureView's format must ") match Veldrid'sResourceFactory.CreateTextureViewvalidation throw, butnative_crash.logcontains no managed block for it — theFirstChanceExceptionfilter inCrashDiagnosticsonly logs a fixed set of fatal-ish types (NRE/AVE/TypeInit/DllNotFound/…), andVeldridExceptionis not on the list, so the actual culprit was silently dropped.Without the managed stack we cannot know which
CreateTextureViewcall passes the mismatched format, and patching the renderer from heap residue would be guesswork. This change widens diagnostics so the next crash log pinpoints the call site.Changes
osu.Android/CrashDiagnostics.cs— splitFirstChanceExceptionfiltering by thread:Thread.Namestarts withDraw/Update/Audio/Input, or containsGameThread): log every exception with full stack. These are the threads whose unhandled throws on Android tear the process down via Mono'stgkill(SIGSEGV)path without ever reachingAppDomain.UnhandledException.HidSharp/ `C