Search Unity

Question The game crashes on release builds. On development builds - no

Discussion in 'Android' started by stream_in_space_, Jun 2, 2023.

  1. stream_in_space_

    stream_in_space_

    Joined:
    Dec 22, 2015
    Posts:
    13
    My app has native crashes. In the process of investigating this issue, I noticed one exciting point.
    When making a development build I can not catch crashes at all.
    For example, during gameplay, I have random crashes. Usually, they can appear after 5-10-20 min of gameplay.
    But if I make a build with the same code, but with a development build enabled I can not catch crashes. I played from 1 to 3 hours on different devices, and not seeing crashes. Hard to believe this is a coincidence, especially after reading similar tread https://forum.unity.com/threads/my-...n-release-build-but-not-on-dev-build.1040170/

    My question is, does anybody can tell me why this behavior happens? What difference between development and release build builds? Maybe I can change something in settings to get the same result but on the release build.
    Or probably give me advice on which direction I have to investigate to solve my crashes. Just in case, additional information is below.

    Unity version :
    2023.1.0b12.3067.3607

    My testing devices :
    Galaxy Tab S7 (android 12), Galaxy S10 Lite (android 13)

    Crashes that I'm trying to solve. Logs are taken from Firebase Crashlytics :
    1.

    Crashed: Thread: SIGSEGV 0x000000000000002c
    #00 pc 0x47c2b4 libunity.so (MeshRenderingData::PrepareDraw(GfxDevice&, VertexInputMasks, VertexDeclaration*&, MeshBuffers&, DrawBuffersRange&, int) const) (BuildId: 124e10067e81168a)
    #01 pc 0xb81b5c libunity.so (BatchRenderer::ApplyShaderPass(ShaderPassContext&, SharedMaterialData const*, Shader*, BatchRenderer::PassInfo&, BatchingFlags, bool, bool, ShaderLab::GrabPasses const*, DeviceRenderStateBlock const*)) (BuildId: 124e10067e81168a)
    #02 pc 0x47c17c libunity.so (DrawUtil::DrawMeshRawFromNodeQueue(RenderNodeQueue const&, unsigned int, VertexInputMasks, int)) (BuildId: 124e10067e81168a)
    #03 pc 0xae43c8 libunity.so (XRDisplay::IsLateLatchSupported()) (BuildId: 124e10067e81168a)
    #04 pc 0xb82254 libunity.so (BatchRenderer::RenderBatch(BatchInstanceData const*, unsigned long, VertexInputMasks) const) (BuildId: 124e10067e81168a)
    #05 pc 0xb858bc libunity.so (ForwardShaderRenderLoop::StartRenderJobs(JobFence&, bool, bool, ShaderPassContext&)) (BuildId: 124e10067e81168a)

    2.

    Crashed: Thread: SIGSEGV 0x000000000000004b
    #00 pc 0xe03dc4 libunity.so (Mesh::GetSubMeshBuffer16(int)) (BuildId: 124e10067e81168a)
    #01 pc 0x3ef124 libunity.so (FindEnabledAncestorSortingGroup(Unity::Component*)) (BuildId: 124e10067e81168a)
    #02 pc 0x1336ffc libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #03 pc 0x133756c libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #04 pc 0x3efbc0 libunity.so (UpdateSortingGroupStatusForRenderer(Renderer*)) (BuildId: 124e10067e81168a)
    #05 pc 0x483c30 libunity.so (Renderer::AddToScene()) (BuildId: 124e10067e81168a)
    #06 pc 0x136b39c libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #07 pc 0x13a8ffc libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #08 pc 0xd312cc libunity.so (ParticleSystemRenderer::AwakeFromLoad(AwakeFromLoadMode)) (BuildId: 124e10067e81168a)
    #09 pc 0x61ddd0 libunity.so (AwakeFromLoadQueue::AwakeFromLoadAllQueues(AwakeFromLoadMode, bool)) (BuildId: 124e10067e81168a)
    #10 pc 0x136b39c libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #11 pc 0x61ded0 libunity.so (AwakeFromLoadQueue::InvokeAwakeFromLoad(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode)) (BuildId: 124e10067e81168a)
    #12 pc 0x61ddac libunity.so (AwakeFromLoadQueue::AwakeFromLoadAllQueues(AwakeFromLoadMode, bool)) (BuildId: 124e10067e81168a)
    #13 pc 0x61d978 libunity.so (AwakeFromLoadQueue::Add(Object&, TypeTree const*, bool, AwakeFromLoadMode)) (BuildId: 124e10067e81168a)
    #14 pc 0x42b2dc libunity.so (AwakeAndActivateClonedObjects(Object**, vector_map<int, int, std::__ndk1::less<int>, stl_allocator<std::__ndk1::pair<int, int>, (MemLabelIdentifier)1, 16> > const&)) (BuildId: 124e10067e81168a)
    #15 pc 0x136b39c libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #16 pc 0x4872c0 libunity.so (void Renderer::Transfer<StreamedBinaryRead>(StreamedBinaryRead&)) (BuildId: 124e10067e81168a)
    #17 pc 0x134cffd libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #18 pc 0x41cffd libunity.so (void ProcessShadowCasterNodeVisibilityAndCullWithoutUmbra_Kernel<(CullingParameters::LayerCull)2, 4>(IndexList&, CullingParameters const&, LODDataArray const*, SceneNode const*, AABB const*, unsigned long, unsigned long, float __vector(4)*)) (BuildId: 124e10067e81168a)
    #19 pc 0x41cffd libunity.so (void ProcessShadowCasterNodeVisibilityAndCullWithoutUmbra_Kernel<(CullingParameters::LayerCull)2, 4>(IndexList&, CullingParameters const&, LODDataArray const*, SceneNode const*, AABB const*, unsigned long, unsigned long, float __vector(4)*)) (BuildId: 124e10067e81168a)
    #20 pc 0x3ecffd libunity.so (DrawSpriteBatchedFromNodeQueue(RenderNodeQueue const&, RenderMultipleData const&, VertexInputMasks)) (BuildId: 124e10067e81168a)
    #21 pc 0x3ecffd libunity.so (DrawSpriteBatchedFromNodeQueue(RenderNodeQueue const&, RenderMultipleData const&, VertexInputMasks)) (BuildId: 124e10067e81168a)
    #22 pc 0x134cffd libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #23 pc 0x134cffd libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #24 pc 0x13cffd libunity.so (BuildId: 124e10067e81168a)
    #25 pc 0x42baa0 libunity.so (CloneObject(Object&, Transform&, bool)) (BuildId: 124e10067e81168a)
    #26 pc 0x15f961 libunity.so (BuildId: 124e10067e81168a)
    #27 pc 0x5c123c libunity.so (scripting_unity_engine_object_new(ScriptingClassPtr, Object*)) (BuildId: 124e10067e81168a)
    #28 pc 0x5d1160 libunity.so (Scripting::ScriptingWrapperFor(Object*)) (BuildId: 124e10067e81168a)
    #29 pc 0x2c1a804 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #30 pc 0x3b62a4 libunity.so (Object_CUSTOM_Internal_CloneSingleWithParent_Injected(void*, void*, unsigned char)) (BuildId: 124e10067e81168a)
    #31 pc 0x3fe6ffc libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #32 pc 0x37f7fa8 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #33 pc 0x1c409a4 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #34 pc 0x3fdbffc libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #35 pc 0x2cb4bf0 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #36 pc 0x3dfccd4 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #37 pc 0x3dce9d4 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #38 pc 0x18c69dc libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #39 pc 0x3dd11ac libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #40 pc 0x323ce48 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #41 pc 0x3fe2ffc libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #42 pc 0x369c138 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #43 pc 0x3fdbffc libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #44 pc 0x3dd11ac libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #45 pc 0x1e418a8 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #46 pc 0x1df3efc libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #47 pc 0x37ee0e4 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #48 pc 0x1956c7c libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #49 pc 0x1956bc8 libil2cpp.so (BuildId: 11ca5d308a9735d0)
    #50 pc 0x5c10f8 libunity.so (scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)) (BuildId: 124e10067e81168a)
    #51 pc 0x5d0910 libunity.so (ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)) (BuildId: 124e10067e81168a)
    #52 pc 0x13bb35c libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #53 pc 0x4dbee0 libunity.so (AsyncOperation::InvokeCoroutine()) (BuildId: 124e10067e81168a)
    #54 pc 0x34de10 libart.so (BuildId: 12e00d030bcfeb51f978c01791e0cd24)
    #55 pc 0xe13e08 libunity.so (tlsf_free) (BuildId: 124e10067e81168a)
    #56 pc 0xe13e08 libunity.so (tlsf_free) (BuildId: 124e10067e81168a)
    #57 pc 0x3fd89c libunity.so (DualThreadAllocator<DynamicHeapAllocator>::TryDeallocate(void*)) (BuildId: 124e10067e81168a)
    #58 pc 0x1351f22 libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #59 pc 0x136564c libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #60 pc 0x13659cc libunity.so (__unw_getcontext) (BuildId: 124e10067e81168a)
    #61 pc 0xf3d0fd libunity.so (ParticleSystemTrailGeometryJob::ConfigurePerParticleTrailParams(ParticleLineParameters&, ParticleSystemParticles const*, unsigned long, ParticleSystemTrailGeometryJob const&, float)) (BuildId: 124e10067e81168a)
    #62 pc 0x4f0060 libunity.so (PreloadManager::UpdatePreloadingSingleStep(PreloadManager::UpdatePreloadingFlags, int)) (BuildId: 124e10067e81168a)
    #63 pc 0x4f0a50 libunity.so (PreloadManager::UpdatePreloading()) (BuildId: 124e10067e81168a)

    3. This one appears during the game reloading

    Crashed: Thread: SIGSEGV 0x00756c615679007c
    #00 pc 0xe139b8 libunity.so (tlsf_remove_pool) (BuildId: 124e10067e81168a)
    #01 pc 0xe13e08 libunity.so (tlsf_free) (BuildId: 124e10067e81168a)
    #02 pc 0x5c2ae0 libunity.so (Il2cppMemoryWrapper::Deallocate(void*)) (BuildId: 124e10067e81168a)
     
  2. stream_in_space_

    stream_in_space_

    Joined:
    Dec 22, 2015
    Posts:
    13
    Any suggestions? Each day I'm receiving those crashes and I wish to solve it asap.
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,911
  4. stream_in_space_

    stream_in_space_

    Joined:
    Dec 22, 2015
    Posts:
    13
    Thank you for your answer. So as I can see there is no way to understand why I cannot see crashes in development mode.

    I do not understand how to use this StacktraceUiility. Can you please little bit explain about StacktraceUiility?
    Is this the correct workflow with StacktraceUtility? :
    1. Create a build.
    2. In Android Logcat settings add a path to created .symbols (I have enabled Strip Engine Code)
    3. Keep playing until a crash appears
    4. Copy the crash log from Android Logcat and paste it into Stacktrace Utility
    5. Press Resolve Stacktrace to see additional information

    I've been trying to catch crashes, but for now, I can not catch them on my device, need more time. If this is the correct way of using the utility, ill continue playing until crashes.

    Also, I tried to add a path of my release .symbols (production version) into Android Logcat settings and Copy the crash log from Firebase (e.g Crashed: Thread: SIGSEGV 0x000000000000004b ) and paste it into Stacktrace Utility. But in this way, I didn't reach any success, probably this is not the correct way of Using Stacktrace Utility
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,911
    Yes that's correct.

    StacktraceUtility uses regex to resolve address which to use for resolving stacktrace, it's possible Firebase prints unresolved stacktrace in format which is not understood by StacktraceUtility, without example it's hard to say.
     
  6. stream_in_space_

    stream_in_space_

    Joined:
    Dec 22, 2015
    Posts:
    13
    Thank you for clarifying. Unfortunately, when im getting a crash, the error message doesn't appear in the Android log cat. So in my case, Stacktrace Utility doesn't help.
     
  7. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,911
    Can you show the log from your crash?
     
  8. stream_in_space_

    stream_in_space_

    Joined:
    Dec 22, 2015
    Posts:
    13
    In Android Logcat crash errors did not appear, at least I didn't find them.
    But I have good news, after moving a project to a new unity version 2023.1.0f1, the first and second errors from the first post are gone. A third crash sometimes still appears, but I noticed it happens only when the game is reloading, and it happens pretty rarely, so this is no longer a big problem for me.
     
  9. rzer

    rzer

    Joined:
    Aug 26, 2014
    Posts:
    3
  10. stream_in_space_

    stream_in_space_

    Joined:
    Dec 22, 2015
    Posts:
    13
    I changed the Unity version, and I'm not getting this error exactly. However, according to Crashlytics during the past 90 days, I still have similar errors.
    Example :
    1
    null pointer dereference: SIGSEGV  0x0000000000000018
    #00 pc 0x10d5288 libunity.so (remove_free_block) (BuildId: 6bc50e5bf6eeb0cd)
    #01 pc 0x10d56d4 libunity.so (tlsf_free) (BuildId: 6bc50e5bf6eeb0cd)
    #02 pc 0x8a3960 libunity.so (Il2cppMemoryWrapper::Deallocate(void*)) (BuildId: 6bc50e5bf6eeb0cd)

    2
    null pointer dereference: SIGSEGV  0x0000000000000016
    #00 pc 0x2d4dcfc libil2cpp.so (BuildId: 357713e580936444)


    Honestly, I don't think that we can somehow fix those errors. It seems they are related to the Unity version and it is a bug on their side. Probably those errors will gone with the new Unity versions
     
    rzer likes this.