Skip to content

Add Crash Handler for iOS Platform #11544

@iMacHumphries

Description

@iMacHumphries

Describe the project you are working on

I'm working on a mobile game using the Godot Engine. The game targets iOS and Android. Crash handling is critical for debugging and overall stability. The game is a menu-based RPG with multiplayer elements.

https://x.com/HeroicLegendsRB

Describe the problem or limitation you are having in your project

Currently, my app is crashing on launch in release builds only. To debug this issue, I need a way to view the backtrace of the crashing thread.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

The proposed feature is a crash handler for iOS. The handler would work like the existing macOS crash handler:

  1. Capture crashes caused by SIGSEGV, SIGFPE, SIGILL, and SIGTRAP.
  2. Generate backtrace + engine version
  3. Notify crash for node system (NOTIFICATION_CRASH).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

  1. Copy crash_handler_macos.h/mm to crash_handler_iOS.h/mm
  2. Add crash_handler_iOS to platform/ios/SCsub
  3. Import and initialize in os_ios.mm
  4. Implement disable_crash_handler / is_disable_crash_handler
  5. Update docs for NOTIFICATION_CRASH to include iOS.

Testing:

  • Verify backtrace and other information logged by crash handler on an iOS release build.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Crash logging can be disabled with arg --disable-crash-handler.

Is there a reason why this should be core and not an add-on in the asset library?

  1. Cross-Platform Consistency - Match existing functionality on macOS / windows / linux
  2. Developer Utility - Built-in crash handling benefits all developers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions