Fix Android 'Swapchain lost' crash and mitigate log flooding - #241
Conversation
- Fixed OsuGameActivity orientation to Landscape in manifest and OnCreate to prevent startup surface recreation. - Delayed surface readiness signal to SurfaceChanged with width/height validation. - Added explicit surface handle cleanup in SurfaceDestroyed to prevent stale usage. - Implemented exception deduplication in CrashDiagnostics to prevent 1GB log files during crash loops. - Suppressed HidSharp macOS-specific noise exceptions in managed hooks.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR addresses the "Swapchain's underlying surface has been lost" crash observed on Android devices (specifically S23 Ultra) during startup. The crash was caused by a race condition where the Vulkan renderer attempted to initialize using a surface handle that was immediately invalidated by the initial orientation rotation.
Key fixes:
surfaceEvent.Set()) is now delayed untilSurfaceChangedconfirms valid dimensions.SurfaceDestroyedto prevent stale handle usage.Landscapein manifest and forced it inOnCreateto suppress the "Portrait -> Landscape" hop on startup.CrashDiagnosticsto prevent 1GB log files during crash loops by rate-limiting repeated exceptions to 10 entries each.HidSharpexceptions that were cluttering Android logs.PR created automatically by Jules for task 690584439121913596 started by @winnerspiros