I compiled ios can not run directly flash back please help me!

  • Problems such as:

  • i used fpcupdeluxe to let it automatically download FPC 3.2.2 and lazarus 2.2.2 and download the compiler :arm(ios) aarch64(ios) x86_64 (I-SIM)

  • And using castle-editor successfully compiled arm 32bit and arm 64bit Mach-O(a) files automatically generated a freetype third-party library Xcode project

  • But when I used it for real debugging my program exited without using Xcode’s (main.m) entry function and reported the following exception message

An unhandled exception occurred at $000000010447AA74:

EStackOverflow: Stack overflow

$000000010447AA74

$00000001043E4E14

  • I’m using xocde with the latest version of xcode15 and my ios phone is ios16.6.1

  • I have tried my best to find information to solve this problem. But I can’t help it. I don’t know much about mac and ios. I hope you can help me

Thanks for reporting! Can you try building in “release” mode? If you build using CGE editor, just select “Run → Release Mode” from menu before packaging for iOS. Then package and run the game as before on iOS device.

Reason:

I just tested building and running application with the latest CGE on iPhone. I used our example “examples/mobile/simple_3d_demo/”, tested in release and debug modes, build as IPA and deployed on my device using TestFairy. In release mode, the application runs perfectly. In debug mode, I experience a crash.

I’m not sure whether it’s the same issue as you experience, as I have a bit weird setup (I didn’t connect my device physically to mac, I only debug remotely using TestFairy, and it seems it crashed before receiving any log). It may be the same issue.

I wasn’t able today to debug the crash and I have to fall to sleep very soon :), so I’ll leave this for now, and will get back to it later in the week.

I’m testing with Xcode 13.4.1 on macOS 12.4 (Intel-based mac).

I’ll test later:

  • Can I get any logs through TestFairy; failing that, get my hands on physical mac machine to debug
  • Do other CGE examples also exhibit the same behavior (debug crashes, release works)
  • You send me privately Xcode project; thank you, I’ll test that too
  • I thought of a bunch of ways but did not think that the debug mode and release mode would affect its crash. Thank you very much for your patience and help. I can now enter the game screen
  • But I have encountered some other problems, I plan to rely on my own to solve for the time being, if not, I will post a request for help!
1 Like

Cool, I’m happy that it helped.

This is still something I definitely want to fix in CGE – we don’t want debug builds on iOS to crash. But at least for now we have a workaround: run a release build.

I’ll let here know when I’ll investigate more and/or solve the crash with debug builds.

If you get stuck, you’re welcome to post other questions :slight_smile:

I have finally found and fixed (well, workarounded) this problem. Making a “debug” build of CGE application on iOS will no longer crash.

Details: fpcupdeluxe (and maybe other ways of installing FPC?) puts in the default fpc.cfg instructions to activate -Ct (Stack Checking) when DEBUG is defined. For some reason, it crashes on iOS. Our workaround just disables it (passing “-Ct-” on the command-line) as you likely don’t need it anyway.

We’ve done this week a few other improvements to iOS (building and docs on iOS | Manual | Castle Game Engine ), stay tuned for news this weekend on Castle Game Engine – Open-Source 3D and 2D Game Engine about it :slight_smile: