Cocos2d-x ActionManager::update crashes

Greeting guys,

We are seeing so much crashes related to ActionManager::update function. These crashes are irrespective of the platform as we are seeing these crashes in Google Play dashboard and Windows dashboard. We tried to debug it with no success yet. For clarity, I am pasting the stack trace from Google Play dashboard.

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
_ZN7cocos2d13ActionManager6updateEf

backtrace:
  native: pc 000000000095cdd0  /data/app/com.example.appname-1/lib/arm/libcocos2dcpp.so (_ZN7cocos2d13ActionManager6updateEf+156)
  native: pc 00000000008f43cc  /data/app/com.example.appname-1/lib/arm/libcocos2dcpp.so
  native: pc 00000000008f6c98  /data/app/com.example.appname-1/lib/arm/libcocos2dcpp.so (_ZN7cocos2d9Scheduler6updateEf+108)
  native: pc 00000000008e5bb4  /data/app/com.example.appname-1/lib/arm/libcocos2dcpp.so (_ZN7cocos2d8Director9drawSceneEv+336)
  native: pc 00000000008e5bf4  /data/app/com.example.appname-1/lib/arm/libcocos2dcpp.so (_ZN7cocos2d19DisplayLinkDirector8mainLoopEv+40)
  native: pc 000000000108f75d  /data/app/com.example.appname-1/oat/arm/base.odex

Impacted users: https://tinyurl.com/yd9ltbtn
Crash devices: https://tinyurl.com/ydhx55vx

Does anyone have any idea what could be causing it? Please feel free to ask if you need more details.

Regards,
ManishK

What version of Cocos2d-x? What is the target OS?

It seems to me something wrong in your code, probably you somehow manage to destroy an unscheduled action?

cocos2d-x version 3.13. Its same irrespective of the operating system.

May be the case. I’ll try to debug and update here if I find something. Is there anything else apart from destroying an unscheduled function that can cause this crash?

I can’t think of anything else given the amount of info you currently have.

Hey Boby,

Right now we do have this this information only. The thing is, these crashes are consistent since last four years or since we started our app development on cocos2d-x platform. And, these crashes are not easily re-producable as we has always tested our apps before releasing. Nothing crashes at our end while testing our apps. It’s just we see these crashes on platform darshboards only without proper stack trace.

As you have pointed that there is something wrong with our code, it helps us a lot to narrow down things. At least we don’t have to dig into cocos2d-x code and that’s a big relief. We think that’s what we needed to here to motivate us to fix it. Thank you so much for that. :slight_smile:

If we would be able to fix it in the coming days, we’ll update this thread with the proper information so that it can help other developers as well.

Have a great day.

Regards,
ManishK

Glad to hear I can help, at least with the motivation part. Anyway, I can’t be 100% sure that the crash is not in cocos2d-x but I highly doubt it, especially since the ActionManager object is pretty stable in my experience, most crashes I’ve seen so far related to the ActionManager were because of user code, somehow destroyed objects were being handled by the ActionManager. There are many situations that can lead to this problem: manually release an unretained object, autorelease an object without immediately adding it to a parent or another object that knows to retain it while handling it etc.

Hey Boby,

Thank you so much for the pointers.

Regards,
ManishK