Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Crash Handling StoreKit:REQUEST_PRODUCTS_COMPLETE — Gideros Forum

Crash Handling StoreKit:REQUEST_PRODUCTS_COMPLETE

troysandaltroysandal Member
edited January 2014 in Bugs and issues
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

  • ar2rsawseenar2rsawseen Maintainer
    edited January 2014
    #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
    when I open storekit.mm that is inside Gideros/All Plugins folder, this lines seems to be off from what is stated in your log report. Do you use different storekit.mm?
  • I modified mine to include a locale specific price string, code I found on another thread here in the forums. Shouldn't be involved in this issue as it's been in there for many weeks but I'll let you decide.
    			NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    			[numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
    			[numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
    			[numberFormatter setLocale:product.priceLocale];
    			NSString *formattedString = [numberFormatter stringFromNumber:product.price];
    			lua_pushstring(L, [formattedString UTF8String]);
    			lua_setfield(L, -2, "priceInLocale");
  • @troysandal no no I don't say it is involved, I say I can't figure out the real lines where the error lies, because your stack traceback does not match my file, could you please add your version of storekit.mm? :)
  • troysandaltroysandal Member
    edited January 2014
    Yes, apologies. Would love to have priceLocale included by the way, otherwise I have to write the same native code using Wax to format price strings. Feature request?

    Thanks for your help on this.
    zip
    zip
    storekit.mm.zip
    3K
  • Aha, I see
    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 ;)
  • Yes, I'm definitely setting some TextField's in that callback and yes I'm using BhWax but not in this code path. The only field from objective-c that I'm passing back to Gideros as text is the Product.priceInLocale field. I'm not wrapping it in toobjc() only because it's a Lua string that I'm passing to TextField:setText() so I shouldn't need to. I can't say with certainty that that's the method that crashes either, but it's the only field from the callback I use.

    Note also that this has only happened to me once, out of hundreds of times I've tested this code path.
Sign In or Register to comment.