iPad/iPod arm64 crashes

Hello there,

When Apple guys reviewed my game, it crashed on every iPad device + iPod touch. My sponsor confirmed it was failing on iPad but after a few hours sent me some iPad screenshots. It runs fine randomly, looks like memory allocation problem.

Of course, they gave me a crash log to figure out what’s happening. Sponsor said it runs fine when he’s logged in to GameCenter (I’m using gamecenter extension), but I think it’s a coincidence (though might be a good idea to handle auth failed event too:).

Here’s a part of crashlog. It seems failing on createShader method. Please note that this happened on arm64 architecture, so maybe it has something with the fact, that arm64 support was introduced quite recently. I’ll try to test it on armv7-only asap. Also, I can create an issue on GitHub if someone confirms this is a bug and not just me. Thanks in advance.

It failed on following devices:

  • iPad 2 Wifi running iOS 8.1
  • iPad 4 Wifi running iOS 8.1
  • iPad Air 2 Wifi running iOS 8.1
  • iPad Air Wifi running iOS 8.1
  • iPad Mini 3 Wifi running iOS 8.1
  • iPod Touch Fifth Generation running iOS 8.1

Full crashlog is available here.

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Filtered syslog:
2015-01-19 16:41:04.544 madfist_adfree[187]: <Error> assertion failed: 12B411: libxpc.dylib + 71820 [AD580443-238D-3997-8D09-004C210D0C18]: 0x7d
2015-01-19 16:41:04.612 madfist_adfree[187]: <Error> CoreLocation: Could not get ideal gyro update interval, assuming 0.005000 s
2015-01-19 16:41:04.622 madfist_adfree[187]: <Warning> Authenticating local user...
2015-01-19 16:41:04.640 madfist_adfree[187]: <Warning> Authenticating local user...
2015-01-19 16:41:04.641 madfist_adfree[187]: <Warning> xxxxxxx purchase init
2015-01-19 16:41:04.960 madfist_adfree[187]: <Warning> Game Center: Error occurred authenticating-
2015-01-19 16:41:04.962 madfist_adfree[187]: <Warning>   The operation couldn’t be completed. (NSURLErrorDomain error -1009.)
2015-01-19 16:41:05.087 madfist_adfree[187]: <Error> madfist_adfree(187,0x199a1f310) malloc: *** error for object 0x17013a680: Invalid pointer dequeued from free list
    *** set a breakpoint in malloc_error_break to debug

Thread 0 name:  Dispatch queue: OpenGL Caching
Thread 0 Crashed:
0   libsystem_kernel.dylib            0x0000000195e5b270 0x195e40000 + 111216
1   libsystem_pthread.dylib           0x0000000195ef9224 0x195ef4000 + 21028
2   libsystem_c.dylib                 0x0000000195dd2b14 0x195d70000 + 404244
3   libsystem_malloc.dylib            0x0000000195e963e0 0x195e84000 + 74720
4   libsystem_malloc.dylib            0x0000000195e9654c 0x195e84000 + 75084
5   libsystem_malloc.dylib            0x0000000195e95060 0x195e84000 + 69728
6   libsystem_malloc.dylib            0x0000000195e853e0 0x195e84000 + 5088
7   libsystem_malloc.dylib            0x0000000195e89a00 0x195e84000 + 23040
8   libCoreFSCache.dylib              0x0000000188730aa4 0x188730000 + 2724
9   libCoreFSCache.dylib              0x00000001887309c4 0x188730000 + 2500
10  libGLProgrammability.dylib        0x0000000188888024 0x188794000 + 999460
11  libGLProgrammability.dylib        0x0000000188877774 0x188794000 + 931700
12  libdispatch.dylib                 0x0000000195d19368 0x195d18000 + 4968
13  libdispatch.dylib                 0x0000000195d226e4 0x195d18000 + 42724
14  libGLProgrammability.dylib        0x0000000188877404 0x188794000 + 930820
15  GLEngine                          0x00000001886c7fb8 0x188624000 + 671672
16  GLEngine                          0x0000000188667234 0x188624000 + 274996
17  madfist_adfree                    0x000000010010c20c nme::OGLProg::createShader(unsigned int, char const*) + 56
18  madfist_adfree                    0x000000010010be78 nme::OGLProg::recreate() + 80
19  madfist_adfree                    0x000000010010bdf0 nme::OGLProg::OGLProg(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 112
20  madfist_adfree                    0x000000010010ca68 nme::GPUProg::create(unsigned int) + 1076
21  madfist_adfree                    0x000000010010a5f0 nme::OGLContext::RenderData(nme::HardwareData const&, nme::ColorTransform const*, float const (&) [4][4]) + 636
22  madfist_adfree                    0x00000001001237b4 nme::Graphics::Render(nme::RenderTarget const&, nme::RenderState const&) + 384
23  madfist_adfree                    0x0000000100134384 nme::DisplayObject::Render(nme::RenderTarget const&, nme::RenderState const&) + 400
24  madfist_adfree                    0x0000000100136d04 nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&) + 100
25  madfist_adfree                    0x0000000100137bbc nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&) + 3868
26  madfist_adfree                    0x0000000100137bbc nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&) + 3868
27  madfist_adfree                    0x0000000100137bbc nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&) + 3868
28  madfist_adfree                    0x00000001001394e0 nme::Stage::RenderStage() + 412
29  madfist_adfree                    0x0000000100146544 nme_render_stage(_value*) + 84
30  madfist_adfree                    0x00000001004b748c ExternalPrimitive::__run(Dynamic const&) + 112
31  madfist_adfree                    0x0000000100345eac openfl::_v2::display::Stage_obj::__render(bool) + 252
32  madfist_adfree                    0x0000000100341a28 openfl::_v2::display::Stage_obj::__checkRender() + 124
33  madfist_adfree                    0x0000000100341ddc openfl::_v2::display::Stage_obj::__doProcessStageEvent(Dynamic) + 884
34  madfist_adfree                    0x00000001003428cc openfl::_v2::display::Stage_obj::__processStageEvent(Dynamic) + 40
35  madfist_adfree                    0x0000000100342904 openfl::_v2::display::__Stage_obj__processStageEvent(hx::Object*, Dynamic const&) + 32
36  madfist_adfree                    0x00000001004c4334 hx::CMemberFunction1::__run(Dynamic const&) + 16
37  madfist_adfree                    0x00000001004a01ec val_call1 + 56
38  madfist_adfree                    0x0000000100146044 external_handler(nme::Event&, void*) + 464
39  madfist_adfree                    0x0000000100138e5c nme::Stage::HandleEvent(nme::Event&) + 1320
40  madfist_adfree                    0x00000001001055a0 IOSStage::OnPoll() + 260
41  QuartzCore                        0x0000000188d5127c 0x188cf4000 + 381564
42  QuartzCore                        0x0000000188d51114 0x188cf4000 + 381204
43  IOKit                             0x0000000185d498cc 0x185d44000 + 22732
44  CoreFoundation                    0x0000000184ba0cdc 0x184ad8000 + 822492
45  CoreFoundation                    0x0000000184bb58f8 0x184ad8000 + 907512
46  CoreFoundation                    0x0000000184bb5858 0x184ad8000 + 907352
47  CoreFoundation                    0x0000000184bb37d8 0x184ad8000 + 899032
48  CoreFoundation                    0x0000000184ae11f0 0x184ad8000 + 37360
49  GraphicsServices                  0x000000018dd075a0 0x18dcfc000 + 46496
50  UIKit                             0x0000000189412780 0x18939c000 + 485248
51  madfist_adfree                    0x0000000100105428 nme::CreateMainFrame(void (*)(nme::Frame*), int, int, unsigned int, char const*, nme::Surface*) + 168
52  madfist_adfree                    0x0000000100145d30 nme_create_main_frame(_value**, int) + 244
53  madfist_adfree                    0x00000001004b7264 ExternalPrimitive::__Run(Array<Dynamic> const&) + 136
54  madfist_adfree                    0x00000001004c21a8 Dynamic::operator()(Dynamic const&, Dynamic const&, Dynamic const&, Dynamic const&, Dynamic const&, Dynamic const&) + 368
55  madfist_adfree                    0x0000000100491f88 openfl::_v2::Lib_obj::create(Dynamic, int, int, hx::Null<double>, hx::Null<int>, hx::Null<int>, String, hx::ObjectPtr<openfl::_v2::display::BitmapData_obj>, hx::ObjectPtr<Class_obj>) + 1092
56  madfist_adfree                    0x000000010049d784 ApplicationMain_obj::main() + 396
57  madfist_adfree                    0x000000010049edb0 __hxcpp_lib_main + 40
58  madfist_adfree                    0x00000001004bbd58 hxRunLibrary + 28
59  madfist_adfree                    0x00000001000ebb78 main (Main.mm:73)
60  libdyld.dylib                     0x0000000195d42a04 0x195d40000 + 10756

Hmm, I will wonder if this is renderer related, or if it is something else in a different thread (like GameCenter)

Were you able to reproduce yourself? I would wonder if there’s a way to isolate the issue. You could possibly do a GameCenter-free version for them to test as well

Hi again,

So, at this point I’ve made builds only for armv7 architecture. Sponsor uploaded it to Testflight, they reviewed it (that’s why it took some time). He said everything was running smoothly on iPad, but then informed me that it crashed again after he tried to restart the game a couple of times (5 tries or so). Will get crashlog tomorrow, so I’ll confirm if it’s still the same problem and if it’s not arm64 related this time.

My friend (who compiled builds for me on his Macbook) told me, that he found some threads with the same crashlog, but not related to OpenFL or Haxe at all. As I understood it has something with “trying too free memory that was already cleaned at that point”. Also, it seems that problem occurs on iPad devices only. Sponsors restarted it many times on iPhone - no problems whatsoever. Looks like it failing on render thread, at least to me.

I’ll get my hands on my mac tomorrow and will try to reproduce or isolate things on a simulator. I wonder if it can be something in my game code. Though it runs flawlessly on Android. And iPhone is fine too. Weird nasty bug =(

I did resolve a bug when using Capabilities.language, not sure if it would be that, or perhaps something similar. That was a “double free” bug, but should be resolved in the current releases

A-and, I’m here again. I’ve built Gamecenter-free version for testing as you suggested, and it’s working just fine. Seems that GC extension is a problem here. Though, arm64-free build crashes far less frequently, and this time Apple’s review team rejected the game because of absence of “Restore purchases” button :/. It didn’t crash during review (4 builds). Also, I noticed that with gamecenter the game hangs in iOS simulator as well. I can do lazy init of gamecenter service ingame to quickly confirm that it causes the problem. Maybe it has something with recent issue on your repo? Thanks

Check out the repo again, there’s a patch in there that helps resolve problems, such as when the user does not have Gamecenter set up.

We’ll be doing a new release soon if this resolves the issues :slight_smile: