cocos2d-js icon indicating copy to clipboard operation
cocos2d-js copied to clipboard

Crash in ScriptingCore::cleanup() on termination (iOS)

Open pandemosth opened this issue 10 years ago • 9 comments

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.

pandemosth avatar Sep 28 '14 04:09 pandemosth

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

comm1x avatar Apr 07 '15 11:04 comm1x

825 line, is line in above comment free(iter->second->jsclass);

comm1x avatar Apr 07 '15 11:04 comm1x

Hi Comm1x i am getting the same error.. Any clue how to resolve this

siddhanth avatar Jun 10 '15 12:06 siddhanth

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

pandamicro avatar Jun 11 '15 01:06 pandamicro

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

siddhanth avatar Jun 30 '15 17:06 siddhanth

@pandamicro user device will send crash report to apple server, it will count in apple connect. Please fix it

kongyuan avatar Dec 06 '15 07:12 kongyuan

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.

mehnis3050 avatar Dec 08 '16 10:12 mehnis3050

lot of crash report! Please fix it! @pandamicro

gitcalculus avatar Jul 21 '17 08:07 gitcalculus

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

Dimon4eg avatar Nov 15 '18 23:11 Dimon4eg