Open kmenager opened 8 years ago
Could you please provide a test case for it?
@minggo I have the same issue on iOS, but with more details.
In CCActionInterval.cpp
void RepeatForever::startWithTarget(Node* target)
{
ActionInterval::startWithTarget(target);
_innerAction->startWithTarget(target); // stop here with EXC_BAD_ACCESS (code=1, address=0x3a)
}
Object is not null (_innerAction, target, etc...)
The code is :
_moveUp = MoveTo::create(timeUp, Vec2(_width / 2, top));
_moveDown = MoveTo::create(timeDown, Vec2(_width / 2, _bottomBorder + MARGIN_LINES));
auto callBackUp = CallFunc::create([&]() {
_actionLabel->setString("up");
});
auto callBackDown = CallFunc::create([&]() {
_actionLabel->setString("down");
});
seq = Sequence::create(callBackDown, _moveDown, callBackUp, _moveUp, NULL);
_sprite->runAction(RepeatForever::create(seq));
@minggo up ?
@kmenager sorry, i am busy these days. @slackmoehrle could you please help to reproduce it? Thanks.
@minggo @slackmoehrle I try to debug this code, but I have a random crash which is really hard to debug. The main sigsegv error is SEGV_MAPERR. Generally, it happen because the scheduler destructor is called (I guess the garbage collector is the main reason)
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x3
Routine cocos2d::Scheduler::unscheduleAllWithMinPriority(int) at /cocos2d/cocos/./base/CCScheduler.cpp:622 (discriminator 3)
Routine cocos2d::Scheduler::unscheduleAll() at /cocos2d/cocos/./base/CCScheduler.cpp:584
Routine cocos2d::Scheduler::~Scheduler() at /cocos2d/cocos/./base/CCScheduler.cpp:266
Routine cocos2d::ActionManager::addAction(cocos2d::Action*, cocos2d::Node*, bool) at /cocos2d/cocos/./2d/CCActionManager.cpp:195
Routine cocos2d::Node::runAction(cocos2d::Action*) at ./cocos2d/cocos/./2d/CCNode.cpp:1420
Routine NDKHelper::handleMessage(json_t*, json_t*) at /NDKHelper/NDKHelper.cpp:162
I use this lib NDKHelper with the method
void NDKHelper::handleMessage(json_t *methodName, json_t *methodParams)
{
if (methodName == NULL) {
return;
}
const char *methodNameStr = json_string_value(methodName);
for (unsigned int i = 0; i < NDKHelper::selectorList.size(); ++i) {
if (NDKHelper::selectorList[i].getName().compare(methodNameStr) == 0) {
Value value = NDKHelper::getValueFromJson(methodParams);
FuncNV sel = NDKHelper::selectorList[i].getSelector();
Node *target = NDKHelper::selectorList[i].getTarget();
CallFuncNV *caller = CallFuncNV::create(sel);
caller->setValue(value);
caller->retain();
if (target) {
target->runAction(caller);
caller->release();
}
break;
}
}
}
I try with the last cocos version 3.13 on different Android device and still have the same issue.
I have integrated Cocos in an Android app. I use a NDK Helper which create a sequence from a function like in sample http://cocos2d-x.org/docs/programmers-guide/actions/
When I send to many time this part above (1 called every 16 ms), my app crash with this dump
I try with different frequency like 1 every seconds and I have the same problem.
I guess the error provide from the autorelease from a node. Any help for this problem ?
Thanks