Crash report with Lua

Hi guys, I wrote a game with cocos2d-x using mostly Lua.
I used crashlytics to report crashes on players’ devices. However the reports only contain stacktrace of C++ code, no information related to Lua is logged, so I can hardly guess what happened.

Is there anyway I can includle Lua stacktrace (and/or variable values) in crashlytics report when a crash happened in C++ code?

Thank you

I think you could use lua_getstack and lua_getinfo in your crashlytics codes.

@samuele3hu nice idea. I wonder where to put this code? I’m using crashlytics and dunno if we have a “callback” when a crash happens

I have this and similar error in the console during development:
[LUA-print] ----------------------------------------
[LUA-print] LUA ERROR: [string “wheatScene.lua”]:60: invalid ‘cobj’ in function ‘lua_cocos2dx_Node_getPositionX’

[LUA-print] stack traceback:
[string “src/main.lua”]:19: in function <[string “src/main.lua”]:16>
[C]: in function ‘getPositionX’
[string “wheatScene.lua”]:60: in function <[string “wheatScene.lua”]:49>
[LUA-print] ----------------------------------------

When using android debug mode everything’s ok, but in release mode, it crashes the application. How do you fix it?

@stnguyenvn, sorry for replying lately, i don’t know which crash analytical framework you use. Can you capture signal when crash.

@Apollo245, Which cocos2d-x version did you use. From the error message, i think that the node object was released, so it trigger this error. Can you give me the reproduct codes, thanks.