cocos2d-js
cocos2d-js copied to clipboard
Crash in ScriptingCore::cleanup() on termination (iOS)
I'm getting an EXC_BAD_ACCESS when the iOS app is terminated.
Offending line is 711 of ScriptingCore.cpp:
for (auto iter = _js_global_type_map.begin(); iter != _js_global_type_map.end(); ++iter)
{
free(iter->second->jsclass); /* Crashes here */
free(iter->second);
}
This is happening in my own project and also js-tests and js-moonwarriors samples. To reproduce run the app from XCode then double tap home key and kill the app.
Have the same problem. Details:
ScriptingCore.cpp line 825
ScriptingCore::cleanup()
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xc84af2c5
Stacktrace:
0
MyApp
ScriptingCore.cpp line 825
ScriptingCore::cleanup()
1
MyApp
ScriptingCore.cpp line 826
ScriptingCore::cleanup()
2
MyApp
ScriptingCore.cpp line 800
ScriptingCore::~ScriptingCore()
3
MyApp
ScriptingCore.cpp line 799
ScriptingCore::~ScriptingCore()
4
MyApp
ScriptingCore.cpp line 799
ScriptingCore::~ScriptingCore()
5
MyApp
CCScriptSupport.cpp line 143
cocos2d::ScriptEngineManager::removeScriptEngine()
6
MyApp
CCScriptSupport.cpp line 127
cocos2d::ScriptEngineManager::~ScriptEngineManager()
7
MyApp
CCScriptSupport.cpp line 126
cocos2d::ScriptEngineManager::~ScriptEngineManager()
8
MyApp
CCScriptSupport.cpp line 161
cocos2d::ScriptEngineManager::destroyInstance()
9
MyApp
AppDelegate.cpp line 45
AppDelegate::~AppDelegate()
10
MyApp
AppDelegate.cpp line 44
AppDelegate::~AppDelegate()
11
libsystem_c.dylib
__cxa_finalize + 160
12
libsystem_c.dylib
exit + 12
13
UIKit
-[UIApplication _terminateWithStatus:] + 344
14
UIKit
-[UIApplication _handleApplicationSuspend:eventInfo:] + 2472
15
UIKit
-[UIApplication handleEvent:withNewEvent:] + 880
16
UIKit
-[UIApplication sendEvent:] + 72
17
UIKit
_UIApplicationHandleEvent + 616
18
GraphicsServices
_PurpleEventCallback + 608
19
GraphicsServices
PurpleEventCallback + 34
20 CoreFoundation
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
26 UIKit
UIApplicationMain + 1136
27
MyApp
main.m line 8
main
825 line, is line in above comment free(iter->second->jsclass);
Hi Comm1x i am getting the same error.. Any clue how to resolve this
This is a known issue, but it's not a priority currently, because when user terminate the app on iOS, the crash doesn't have very bad effect
Hi, @pandamicro i am also seeing a crash cocos2d::SpriteFrame::getTexture()
is it also because of the same issue ? Or this would be seperate..detailed ticket is present here [1]
[1]https://github.com/cocos2d/cocos2d-js/issues/1776
@pandamicro user device will send crash report to apple server, it will count in apple connect. Please fix it
is there a fix for this issue. I have a lot of issues reported on iTunes connect which is increasing my crash to session ratio.. there has to be a fix. it hampers identifying the actual crashes.
lot of crash report! Please fix it! @pandamicro
The issue is not relative to cocos2d-js and should be fixed in cocos2d-x. cocos2d-x issue here https://github.com/cocos2d/cocos2d-x/issues/14092