cocos-engine
cocos-engine copied to clipboard
libcocos.so android crash!!
Cocos Creator version
3.6.3
System information
android11
Issue description
安卓偶尔闪退!没有规律
Relevant error log output
#01 pc 00000000012edcd0 /data/app.../lib/arm64/libcocos.so (BuildId: ...) #02 pc 00000000012ede28 /data/app.../lib/arm64/libcocos.so (BuildId: ...) #03 pc 00000000012ead2c /data/app.../lib/arm64/libcocos.so (BuildId: ...) #04 pc 00000000012ea358 /data/app.../lib/arm64/libcocos.so (BuildId: ...) #05 pc 00000000012ea2b4 /data/app.../lib/arm64/libcocos.so (__cxa_throw+112) (BuildId: ...) #06 pc 000000000019a4f8 /data/app.../lib/arm64/libcocos.so (BuildId: ...) #07 pc 00000000001af828 /data/app.../lib/arm64/libcocos.so (BuildId: ...) #08 pc 00000000002e88d8 /data/app.../lib/arm64/libcocos.so (BuildId: ...) #09 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
@minggo We also get the same crash info from Google Play Console, it seems out_of range: vector. Please check it.
It is hard to fix it if can not reproduce it.