Cocos2d-x 3.11 JS Crash For Action Sequence

We are calling a sequence and crashing. Here is the call stack for the crash. The crash seems to be because of a sequence. This crash is frustrating please help!

hey, I had the same isssue, have u solved it ???

@slackmoehrle pleasse help us

Can you post your actual code for me?

We are not sure where the crash is since the game crashes at random points (right now we suspect its because of the way we are using action and sequence, but not sure)

Here is an example of playing a sequence of audio rapidly:

_playActivationSounds: function(selectedLength) {
	if(NJ.settings.sounds) {

		var activationSound = activationSounds[selectedLength - 3];
		var startingDelay = activationSound.startingDelay;
		var midDelay = activationSound.midDelay;
		var data = activationSound.data;
		var actionList = [];

		actionList.push(cc.delayTime(startingDelay));
		actionList.push(cc.callFunc(function() {
			cc.audioEngine.playEffect(bloops[data[0]]);
		}));

		for(var i = 1; i < data.length; ++i) {
			(function() {
				var soundData = data[i];

				actionList.push(cc.delayTime(midDelay));
				actionList.push(cc.callFunc(function() {
					cc.audioEngine.playEffect(bloops[soundData]);
				}));
			})();
		}

		this._backgroundLayer.runAction(cc.sequence(actionList));
	}
},

Note that this code worked perfectly (no crashes) in 3.8, before we upgraded to 3.11

If it helps I read a similar thread saying that it might have something to do with the null pointer not being at the end of the multiple actions in the sequence. However again this was not a problem in 3.8. Has something changed since then?

try to use stopAllActions() before run new Actions, It may be help.

I narrowed down the problem enough to a single function. This function is called many times in my game when spawning new objects.

// Move scene block sprite into place.
		moveBlockIntoPlace: function(moveBlock) {

			var blockTargetY = this._levelBounds.y + this._levelCellSize.height * (moveBlock.row + 0.5);
			var blockTargetX = this._levelBounds.x + this._levelCellSize.width * (moveBlock.col + 0.5);
			var duration = 0.7;
			var easing = cc.easeQuinticActionInOut();
			var moveAction = cc.moveTo(duration, cc.p(blockTargetX, blockTargetY)).easing(easing);

			//moveBlock.stopAllActions();
			/*
			moveBlock.runAction(cc.sequence(moveAction, cc.callFunc(function() {
				moveBlock.isFalling = false;
			})));*/

			moveBlock.setPosition(cc.p(blockTargetX, blockTargetY));
		},

The commented out code represents the problem. Running action causes the crash mentioned, I replaced it with the uncommented code and no crash.

Can someone please help, @slackmoehrle?

I still don’t know the exact cause but it seems to only happen because of the use of cc.callFunc(). We are presenting game tomorrow and need updated build, @nite any help?

Hi @chosendeath

I’m trying to track down the same crash. Do you get any change in behaviour if you remove the easing from the moveTo action?

Removing the easing does not matter, what does matter is using actions in a sequence. The error doesn’t happen always, it happens at seemingly random (but consistent) points. For example right now always in my game’s tutorial it will crash at a certain point. Not sure if this is related to memory or what. It also doesn’t seem to matter what actions you use, the main thing is using the actions in a sequence.

@nite @slackmoehrle is this issue being looked at? We need a fix soon.

@pandamicro @zhangxm
Please help us. please

I had the same isssue. :sob:

@pandamicro @zhangxm
please help

The best thing to do is make a Github issue out of it so everyone can see it easily.

@slackmoehrle it exists now https://github.com/cocos2d/cocos2d-x/issues/15851

Thanks. I’ll tag engineers in it.