Closed xjtulk closed 1 year ago
The crash source code stacks parsed with android ndk address-2-line are listed below:
_ZNK2cc7Message7getNextEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/base/threading/MessageQueue.h:61 _ZN2cc12MessageQueue13flushMessagesEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/base/threading/MessageQueue.cpp:216 _ZNSt6ndk110unique_ptrINS_15thread_structENS_14default_deleteIS1EEE5resetEPS1 /Users/lukang/Library/Android/sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/memory:2649 ?? ??:0
_ZN2cc6Engine9restartVMEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/engine/Engine.cpp:238 _ZN2cc6Engine4tickEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/engine/Engine.cpp:201 _ZN2cc15AndroidPlatform4loopEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/platform/android/AndroidPlatform.cpp:83 operator() /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/platform/android/AndroidPlatform.cpp:62
_ZNKSt6ndk114defaultdeleteIN2v88internal3LogEEclEPS3 :? _ZN2v88internal6LoggerD1Ev :? _ZN2v88internal6LoggerD0Ev :? _ZN2v88internal7IsolateD2Ev :? ZN2v88internal7Isolate6DeleteEPS1 :? _ZNSt6ndk16vectorINS_8functionIFvvEEENS_9allocatorIS3_EEE5beginEv /Users/lukang/Library/Android/sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/vector:1511 _ZN2cc3gfx13DeviceManager7destroyEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/GFXDeviceManager.h:102 _ZN2cc6Engine4tickEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/engine/Engine.cpp:201 _ZN2cc15AndroidPlatform4loopEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/platform/android/AndroidPlatform.cpp:83 operator() /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/platform/android/AndroidPlatform.cpp:62
_ZN2cc3gfxL20getSwapchainIfExistsERKNSt6ndk16vectorIPNS0_19GLES3GPUTextureViewENS1_9allocatorIS4_EEEEPKjm /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-gles3/GLES3Commands.cpp:1545 _ZNSt6ndk111__wrap_iterIPN2cc3gfx11SubpassInfoEEppEv /Users/lukang/Library/Android/sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/iterator:1390 _ZN2cc3gfx22GLES3GPUFramebufferHub6updateEPNS0_15GLES3GPUTextureE /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-gles3/GLES3Commands.cpp:3110 _ZN2cc3gfx12GLES3Texture8doResizeEjjj /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-gles3/GLES3Texture.cpp:121 _ZNK2cc3gfx7Texture13isTextureViewEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-base/GFXTexture.h:49 _ZN2cc3gfx14GLES3Swapchain8doResizeEjjNS0_16SurfaceTransformE /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-gles3/GLES3Swapchain.cpp:146 _ZN2cc12MessageQueue15executeMessagesEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/base/threading/MessageQueue.cpp:231 _ZN2cc12MessageQueue13flushMessagesEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/base/threading/MessageQueue.cpp:216
_ZN2cc3gfx19doBufferTextureCopyINS0_6DeviceEEEvPKPKhPNS0_7TextureEPKNS0_17BufferTextureCopyEjPNS12MessageQueueEPT /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-agent/DeviceAgent.cpp:307 _Z36js_gfx_Device_copyTexImagesToTextureRN2se5StateE :? _Z44js_gfx_Device_copyTexImagesToTextureRegistryRKN2v820FunctionCallbackInfoINS_5ValueEEE /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/bindings/manual/jsb_gfx_manual.cpp:186 _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE :? _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE :? _ZN2v88internalL26Builtin_Impl_HandleApiCallENS0_16BuiltinArgumentsEPNS0_7IsolateE :? Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit :?
You can have a try:
static constexpr bool DETACH_DEVICE_THREAD{true}; // set to false to disable it in GFXDeviceManager.h
Ok, i will first try the second way on next application release to see if problems solved, thanks.
You are welcome. So you can not reproduce it?
I can only reproduce the first crash in auto test offline by far.
Ok, i will first try the second way on next application release to see if problems solved, thanks.
@xjtulk Any progress?
Sorry for the late reply, I disable multi-thread in the newest version and it seems most of the crash disappear, only few left, and the crash rate decrease a lot, thanks very much for your help.The left crash looks like below.
_ZN2cc3gfx25GLES3PrimaryCommandBuffer4drawERKNS0_8DrawInfoE /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-gles3/GLES3PrimaryCommandBuffer.cpp:93 _ZN2cc3gfx13CommandBuffer4drawEPNS0_14InputAssemblerE /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-base/GFXCommandBuffer.h:157 operator() /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/pipeline/forward/ForwardStage.cpp:231 _ZN2cc10framegraph10FrameGraph7executeEv /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/frame-graph/DevicePass.cpp:123 _ZN2cc8pipeline15ForwardPipeline6renderERKNSt6__ndk16vectorIPNS_5scene6CameraENS2_9allocatorIS6_EEEE /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/pipeline/forward/ForwardPipeline.cpp:110 _ZL33js_pipeline_RenderPipeline_renderRN2se5StateE /Applications/CocosCreator/Creator/3.5.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/bindings/auto/jsb_pipeline_auto.cpp:1231
@xjtulk thanks for your feedback. We fixed some crashed caused by multi-thread and others in v3.6. So i keep this issue open. And if you upgrade your game to v3.6, please let me know if it has effect. Thanks.
Ok, it may takes us some time to upgrade to v3.6.I will notify you when we get it done.
Thanks.
@xjtulk have you upgrade to v3.6?
Close this issue as not response.
Cocos Creator version
3.5.2
System information
android
Issue description
Our team develop an android application with a game inside.
Our little modifies about the engine are collected in the commit below https://github.com/xjtulk/cocos-engine/commit/98015262bfadcbf481a80862589575c2784aaabd
After the application published on google play, we receive some online crash report and the crash rate related to cocos engine has reached 1% (a pretty high rate).Here are some main crash stacks below, after spending some time analyze the crash, we get nothing so we hope you can give some advice about the problem.(The first crash is a bit similar to the problem mentioned in https://github.com/cocos/cocos-engine/pull/11348 and we are testing if the crash fixed after apply the modify on our branch)
backtrace:
00 pc 0000000000a61bf4 /data/app/com.netease.ruffgo-t8xbfhzlG0d6FdzmY06kvw==/split_config.arm64_v8a.apk!/lib/arm64-v8a/libcocos.so (_ZN2cc12MessageQueue15executeMessagesEv+120)
backtrace:
00 pc 00000000007b23ec /data/app/com.netease.ruffgo-GWUc51vxmORF-XwIjAcVjQ==/split_config.arm64_v8a.apk!/lib/arm64-v8a/libcocos.so (_ZN2cc6Engine9restartVMEv+44)
backtrace:
00 pc 000000000004deec /apex/com.android.runtime/lib64/bionic/libc.so
backtrace:
00 pc 0000000000a94e1c /data/app/com.netease.ruffgo-EErd9D-3HXQXAdJ_dcwEgg==/split_config.arm64_v8a.apk!/lib/arm64-v8a/libcocos.so
backtrace:
00 pc 000000000001c6d8 /system/lib64/libc.so (memcpy+232)
Relevant error log output
No response
Steps to reproduce
The crash may not be easy to reproduce offline, we use auto test tools to frequently enter and exit game page and sometimes the crash happens with low probability.
Minimal reproduction project
We create a demo project without some business code but the main logic is same as release version. The so filein the project is not stripped and with debug symbols so you can analyze the crash stack above with it.
https://github.com/xjtulk/Cocosdemo/tree/main