Below is the callstack I just hit in xcode when my app was handling StoreKit:REQUEST_PRODUCTS_COMPLETE. It's similar to other crashes that happen when doing a lot of UI work in response to a system level event like this, e.g. responding to CLLocationManager or Parse background events. If I wrap my response in a Timer.delayedCall(1, doUIWork) it goes away but I thought the
@atilim would like to see this stack.
Thread 1, Queue : com.apple.main-thread
#0 0x2e2211a6 in agxuEndRenderCommand ()
#1 0x2e2423d8 in eAGXBlitStatus agxuBlitRender(AGXContextRec*, AGXResourceDescriptor const&, AGXResourceDescriptor const&, AGXBlitState const&, GLTRectangleRec const&, GLTRectangleRec const&) ()
#2 0x2e24333e in eAGXBlitStatus agxuBlit(AGXContextRec*, AGXResourceDescriptor const&, AGXResourceDescriptor const&, AGXBlitState const&, GLTRectangleRec const&, GLTRectangleRec const&) ()
#3 0x2e21b15a in glrWriteTextureData ()
#4 0x3153857a in glTexImage2D_Exec ()
#5 0x00925284 in tex_image2D(__GLIContextRec*, unsigned int, int, unsigned int, int, int, int, unsigned int, unsigned int, void const*) ()
#6 0x315e87e0 in glTexImage2D ()
#7 0x001603d0 in g_private::TextureManager::genAndUploadTexture(g_private::CommonElement*, void const*) at /Users/atilim/myprojects/gideros/libgid/src/gtexture.cpp:666
#8 0x0015f84e in g_private::TextureManager::create(int, int, int, int, int, int, void const*, void const*, unsigned long) at /Users/atilim/myprojects/gideros/libgid/src/gtexture.cpp:146
#9 0x0015f6b0 in gtexture_create at /Users/atilim/myprojects/gideros/libgid/src/gtexture.cpp:706
#10 0x001bb260 in TextureManager::createTextureFromDib(Dib const&, TextureParameters const&) at /Users/atilim/myprojects/gideros/2dsg/texturemanager.cpp:250
#11 0x001c17ea in TTTextField::createGraphics() at /Users/atilim/myprojects/gideros/2dsg/tttextfield.cpp:78
#12 0x001e5e04 in TextFieldBinder::setText(lua_State*) at /Users/atilim/myprojects/gideros/luabinding/textfieldbinder.cpp:129
#13 0x000e4f46 in luaD_precall at /Users/atilim/myprojects/gideros/lua/src/ldo.c:319
#14 0x000e57f8 in luaV_execute at /Users/atilim/myprojects/gideros/lua/src/lvm.c:587
#15 0x000e27ae in luaD_call at /Users/atilim/myprojects/gideros/lua/src/ldo.c:377
#16 0x000e274a in lua_call at /Users/atilim/myprojects/gideros/lua/src/lapi.c:782
#17 0x001dac00 in eventClosureWithData(lua_State*) at /Users/atilim/myprojects/gideros/luabinding/eventdispatcherbinder.cpp:902
#18 0x000e4f46 in luaD_precall at /Users/atilim/myprojects/gideros/lua/src/ldo.c:319
#19 0x000e27a4 in luaD_call at /Users/atilim/myprojects/gideros/lua/src/ldo.c:376
#20 0x000e274a in lua_call at /Users/atilim/myprojects/gideros/lua/src/lapi.c:782
#21 0x001da700 in CppLuaBridge::luaEvent(LuaEvent*) at /Users/atilim/myprojects/gideros/luabinding/eventdispatcherbinder.cpp:803
#22 0x001a78ae in EventDispatcher::dispatchEvent(Event*) at /Users/atilim/myprojects/gideros/ios/iosplayer/../../libgideros/eventdispatcher.h:203
#23 0x001da362 in EventDispatcherBinder::dispatchEvent(lua_State*) at /Users/atilim/myprojects/gideros/luabinding/eventdispatcherbinder.cpp:1102
#24 0x000e4f46 in luaD_precall at /Users/atilim/myprojects/gideros/lua/src/ldo.c:319
#25 0x000e57f8 in luaV_execute at /Users/atilim/myprojects/gideros/lua/src/lvm.c:587
#26 0x000e27ae in luaD_call at /Users/atilim/myprojects/gideros/lua/src/ldo.c:377
#27 0x000e274a in lua_call at /Users/atilim/myprojects/gideros/lua/src/lapi.c:782
#28 0x001dac00 in eventClosureWithData(lua_State*) at /Users/atilim/myprojects/gideros/luabinding/eventdispatcherbinder.cpp:902
#29 0x000e4f46 in luaD_precall at /Users/atilim/myprojects/gideros/lua/src/ldo.c:319
#30 0x000e27a4 in luaD_call at /Users/atilim/myprojects/gideros/lua/src/ldo.c:376
#31 0x000e274a in lua_call at /Users/atilim/myprojects/gideros/lua/src/lapi.c:782
#32 0x001da700 in CppLuaBridge::luaEvent(LuaEvent*) at /Users/atilim/myprojects/gideros/luabinding/eventdispatcherbinder.cpp:803
#33 0x001a78ae in EventDispatcher::dispatchEvent(Event*) at /Users/atilim/myprojects/gideros/ios/iosplayer/../../libgideros/eventdispatcher.h:203
#34 0x001da362 in EventDispatcherBinder::dispatchEvent(lua_State*) at /Users/atilim/myprojects/gideros/luabinding/eventdispatcherbinder.cpp:1102
#35 0x000e4f46 in luaD_precall at /Users/atilim/myprojects/gideros/lua/src/ldo.c:319
#36 0x000e57f8 in luaV_execute at /Users/atilim/myprojects/gideros/lua/src/lvm.c:587
#37 0x000e27ae in luaD_call at /Users/atilim/myprojects/gideros/lua/src/ldo.c:377
#38 0x000e274a in lua_call at /Users/atilim/myprojects/gideros/lua/src/lapi.c:782
#39 0x001dac00 in eventClosureWithData(lua_State*) at /Users/atilim/myprojects/gideros/luabinding/eventdispatcherbinder.cpp:902
#40 0x000e4f46 in luaD_precall at /Users/atilim/myprojects/gideros/lua/src/ldo.c:319
#41 0x000e27a4 in luaD_call at /Users/atilim/myprojects/gideros/lua/src/ldo.c:376
#42 0x000e274a in lua_call at /Users/atilim/myprojects/gideros/lua/src/lapi.c:782
#43 0x001da700 in CppLuaBridge::luaEvent(LuaEvent*) at /Users/atilim/myprojects/gideros/luabinding/eventdispatcherbinder.cpp:803
#44 0x001a78ae in EventDispatcher::dispatchEvent(Event*) at /Users/atilim/myprojects/gideros/ios/iosplayer/../../libgideros/eventdispatcher.h:203
#45 0x001da362 in EventDispatcherBinder::dispatchEvent(lua_State*) at /Users/atilim/myprojects/gideros/luabinding/eventdispatcherbinder.cpp:1102
#46 0x000e4f46 in luaD_precall at /Users/atilim/myprojects/gideros/lua/src/ldo.c:319
#47 0x000e27a4 in luaD_call at /Users/atilim/myprojects/gideros/lua/src/ldo.c:376
#48 0x000e4b96 in luaD_rawrunprotected at /Users/atilim/myprojects/gideros/lua/src/ldo.c:116
#49 0x000e2856 in luaD_pcall at /Users/atilim/myprojects/gideros/lua/src/ldo.c:463
#50 0x000e2812 in lua_pcall at /Users/atilim/myprojects/gideros/lua/src/lapi.c:821
#51 0x00080f60 in dispatchEvent(lua_State*, char const*, NSError*, NSArray*, NSArray*, SKPaymentTransaction*) at xcode/GiderosiOSPlayer/GiderosiOSPlayer/Plugins/storekit.mm:197
#52 0x00081140 in -[StoreKitHelper productsRequest:didReceiveResponse:] at xcode/GiderosiOSPlayer/GiderosiOSPlayer/Plugins/storekit.mm:247
#53 0x31af5136 in __34-[SKProductsRequest _handleReply:]_block_invoke ()
#54 0x39c200c2 in _dispatch_call_block_and_release ()
#55 0x39c200ae in _dispatch_client_callout ()
#56 0x39c229a8 in _dispatch_main_queue_callback_4CF ()
#57 0x2f3a55b0 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#58 0x2f3a3e7c in __CFRunLoopRun ()
#59 0x2f30e470 in CFRunLoopRunSpecific ()
#60 0x2f30e252 in CFRunLoopRunInMode ()
#61 0x340422ea in GSEventRunModal ()
#62 0x31bc3844 in UIApplicationMain ()
#63 0x000736ae in main
#64 0x00073638 in start ()
Comments
Thanks for your help on this.
basically it seems to relate to this same problem:
http://www.giderosmobile.com/forum/discussion/comment/30514
You are setting text inside REQUEST_PRODUCTS_COMPLETE callback
and you are using objective c bridge, right?
And somehow they does not sync.
Do you use toobjc somewhere in that block?
Either way, will set this a higher priority in our issue tracker
Note also that this has only happened to me once, out of hundreds of times I've tested this code path.