godot: App terminate on iOS 11 when enter to background

Operating system or device, Godot version, GPU Model and driver (if graphics related): godot 2.1 iOS 11.0.1

Issue description:

Run any Godot app on a device of iOS 11, then press home button to enter to background, it will crash This only happens on iOS 11, before iOS 11 it work well.

here is the backtrace:

iphone_finish
WARNING: cleanup: ObjectDB Instances still exist!
   At: core/object.cpp:1845.
ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.
   At: core/os/memory.cpp:59.
ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.
   At: core/os/memory.cpp:59.
ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.
   At: core/os/memory.cpp:59.
(lldb) bt
* thread #13, name = 'AURemoteIO::IOThread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x00000001027756d4 godot_opt.iphone`AudioDriverIphone::output_callback(void*, unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) + 304
    frame #1: 0x000000018a71d2a8 AudioToolbox`AUInputElement::PullInput(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 176
    frame #2: 0x000000018a4a8e00 AudioToolbox`AUInputFormatConverter2::InputProc(OpaqueAudioConverter*, unsigned int*, AudioBufferList*, AudioStreamPacketDescription**, void*) + 220
    frame #3: 0x000000018a40fdd4 AudioToolbox`AudioConverterChain::CallInputProc(unsigned int) + 596
    frame #4: 0x000000018a40fa64 AudioToolbox`AudioConverterChain::FillBufferFromInputProc(unsigned int*, CABufferList*) + 128
    frame #5: 0x000000018a3ebe38 AudioToolbox`BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 192
    frame #6: 0x000000018a375538 AudioToolbox`CBRConverter::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 120
    frame #7: 0x000000018a3ebcc8 AudioToolbox`BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 800
    frame #8: 0x000000018a3ebe08 AudioToolbox`BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 144
    frame #9: 0x000000018a6506f8 AudioToolbox`Resampler2Wrapper::RenderOutput(CABufferList*, unsigned int, unsigned int&) + 192
    frame #10: 0x000000018a412a7c AudioToolbox`SampleRateConverter::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 48
    frame #11: 0x000000018a3ebcc8 AudioToolbox`BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 800
    frame #12: 0x000000018a40f65c AudioToolbox`AudioConverterChain::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 120
    frame #13: 0x000000018a3ebcc8 AudioToolbox`BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 800
    frame #14: 0x000000018a5fec98 AudioToolbox`AudioConverterFillComplexBuffer + 1048
    frame #15: 0x000000018a4a864c AudioToolbox`AUConverterBase::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 640
    frame #16: 0x000000018a38d07c AudioToolbox`AURemoteIO::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 104
    frame #17: 0x000000018a722a20 AudioToolbox`AUBase::DoRenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, AUOutputElement*, unsigned int, AudioBufferList&) + 172
    frame #18: 0x000000018a7221ac AudioToolbox`AUBase::DoRender(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) + 948
    frame #19: 0x000000018a38cd28 AudioToolbox`AURemoteIO::PerformIO(unsigned int, unsigned int, unsigned int, AudioTimeStamp const&, AudioTimeStamp const&, AudioBufferList const*, AudioBufferList*, int&) + 756
    frame #20: 0x000000018a38e1a0 AudioToolbox`AURIOCallbackReceiver_PerformIO + 356
    frame #21: 0x000000018a520018 AudioToolbox`_XPerformIO + 104
    frame #22: 0x000000018a70a5ec AudioToolbox`mshMIGPerform + 232
    frame #23: 0x000000018a70a804 AudioToolbox`MSHMIGDispatchMessage + 36
    frame #24: 0x000000018a38d4c0 AudioToolbox`AURemoteIO::IOThread::Run() + 288
    frame #25: 0x000000018a391a40 AudioToolbox`AURemoteIO::IOThread::Entry(void*) + 160
    frame #26: 0x000000018a712630 AudioToolbox`CAPThread::Entry(CAPThread*) + 84
    frame #27: 0x000000018658432c libsystem_pthread.dylib`_pthread_body + 308
    frame #28: 0x00000001865841f8 libsystem_pthread.dylib`_pthread_start + 312
    frame #29: 0x0000000186582c38 libsystem_pthread.dylib`thread_start + 4
(lldb) 

Steps to reproduce:

Link to minimal example project:

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 55 (27 by maintainers)

Commits related to this issue

Most upvoted comments

TEMPORARY FIX The solution in this forum post actually works for Godot as well. https://forums.adobe.com/thread/2387025

No code changes are needed to make this work on compile.

Run the following (tested on 2.1 & 2.1.4-stable branches): scons p=iphone -j 4 target=release tools=no arch=arm64 bits=64 IPHONESDK="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/"

The important part is pointing the iPhoneSDK to the symlinked location instead.

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/

Now when the app is suspended/backgrounded, it will not crash and resumes as expected 😃

compiling problem is gone after updating clang to 4.0 (rc1) 😃

@fuzzeemic, Thanks very much, you are the hero!

It’s really amazing. All the orientation issues are also fixed by this.

Yes, amazing. It’s fixed now!

I think this should be fixed on 2.1 also.