Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcocos.so android crash!! #16709

Open
luoting677 opened this issue Jan 30, 2024 · 2 comments
Open

libcocos.so android crash!! #16709

luoting677 opened this issue Jan 30, 2024 · 2 comments
Labels
Bug Needs Triage Needs to be assigned by the team

Comments

@luoting677
Copy link

Cocos Creator version

3.6.3

System information

android11

Issue description

安卓偶尔闪退!没有规律

Relevant error log output

#1 pc 00000000012edcd0 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#2 pc 00000000012ede28 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#3 pc 00000000012ead2c /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#4 pc 00000000012ea358 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#5 pc 00000000012ea2b4 /data/app.../lib/arm64/libcocos.so (__cxa_throw+112) (BuildId: ...)
#6 pc 000000000019a4f8 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#7 pc 00000000001af828 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#8 pc 00000000002e88d8 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#9 pc 00000000002e8080 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#10 pc 00000000002e84d8 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#11 pc 00000000002e84d8 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#12 pc 00000000002e84d8 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#13 pc 00000000002e84d8 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#14 pc 00000000002e84d8 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#15 pc 00000000002e84d8 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#16 pc 00000000002e904c /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#17 pc 00000000002edeb8 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#18 pc 000000000047c188 /data/app.../lib/arm64/libcocos.so (BuildId: ...)
#19 pc 0000000000d8f510 /data/app.../lib/arm64/libcocos.so (BuildId: ...)

Steps to reproduce

根据崩溃地址定位到引擎的代码处是:“const auto& pass = curdrawBatch->getPasses().at(0);”vector越界
void Batcher2d::generateBatch(RenderEntity* entity, RenderDrawInfo* drawInfo) {
if (drawInfo == nullptr) {
return;
}
if (drawInfo->getEnumDrawInfoType() == RenderDrawInfoType::MIDDLEWARE) {
generateBatchForMiddleware(entity, drawInfo);
return;
}
if (_currMaterial == nullptr) {
return;
}
gfx::InputAssembler* ia = nullptr;
if (drawInfo->getIsMeshBuffer()) {
// Todo MeshBuffer RenderData
ia = drawInfo->requestIA(getDevice());
_meshRenderDrawInfo.emplace_back(drawInfo);
} else {
UIMeshBuffer* currMeshBuffer = drawInfo->getMeshBuffer();

    currMeshBuffer->setDirty(true);

    ia = currMeshBuffer->requireFreeIA(getDevice());
    uint32_t indexCount = currMeshBuffer->getIndexOffset() - _indexStart;
    if (ia == nullptr) {
        return;
    }

    ia->setFirstIndex(_indexStart);
    ia->setIndexCount(indexCount);
    _indexStart = currMeshBuffer->getIndexOffset();
}

_currMeshBuffer = nullptr;

// stencilStage
gfx::DepthStencilState* depthStencil = nullptr;
ccstd::hash_t dssHash = 0;
StencilStage entityStage = entity->getEnumStencilStage();
depthStencil = _stencilManager->getDepthStencilState(entityStage, _currMaterial);
dssHash = _stencilManager->getStencilHash(entityStage);

auto* curdrawBatch = _drawBatchPool.alloc();
curdrawBatch->setVisFlags(_currLayer);
curdrawBatch->setInputAssembler(ia);
curdrawBatch->fillPass(_currMaterial, depthStencil, dssHash);
const auto& pass = curdrawBatch->getPasses().at(0);

if (entity->getUseLocal()) {
    drawInfo->updateLocalDescriptorSet(entity->getRenderTransform(), pass->getLocalSetLayout());
    curdrawBatch->setDescriptorSet(drawInfo->getLocalDes());
} else {
    curdrawBatch->setDescriptorSet(getDescriptorSet(_currTexture, _currSampler, pass->getLocalSetLayout()));
}
_batches.push_back(curdrawBatch);

}

Minimal reproduction project

No response

@luoting677 luoting677 added Bug Needs Triage Needs to be assigned by the team labels Jan 30, 2024
@luoting677 luoting677 changed the title libcocos.so 安卓闪退 libcocos.so android crash!! Jan 30, 2024
@chitakkk
Copy link

chitakkk commented Feb 1, 2024

@minggo We also get the same crash info from Google Play Console, it seems out_of range: vector. Please check it.
gplog1

@minggo
Copy link
Contributor

minggo commented Feb 5, 2024

It is hard to fix it if can not reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

3 participants