Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Bug Lot of crashes at il2cpp::vm::Object::GetClass(Il2CppObject*) 2021.3.19f1 LTS

Discussion in 'Android' started by domonyiv, Feb 23, 2023.

  1. domonyiv

    domonyiv

    Joined:
    Oct 1, 2016
    Posts:
    76
    Updated to Unity 2021.3.19f1 and got a lot of il2cpp::vm::Object::GetClass(Il2CppObject*) crashes. The last log in Cloud Diagnostics is always the same:

    Code (CSharp):
    1. Error - Couldn't extract exception string from exception (another exception of class 'ArgumentException' was thrown while processing the stack trace)
    Here is the full stack trace:

    Code (CSharp):
    1. Thread 0 (crashed)
    2. 0   libil2cpp.so                       0x0000006fc99f4ed4 il2cpp::vm::Object::GetClass(Il2CppObject*)
    3. 1   libunity.so                        0x0000006fce18a018 Scripting::LogExceptionFromManaged(ScriptingExceptionPtr, int, char const*, bool, Scripting::LogExceptionFromMangedSettings const*)
    4. 2   libunity.so                        0x0000006fce189188 Scripting::LogException(ScriptingExceptionPtr, int, char const*, bool)
    5. 3   libunity.so                        0x0000006fcdfa65b0 UnityJavaProxy_LogJNIInvokeException(_JNIEnv*, _jobject*, long)
    6. 4   base.odex                          0x0000006fe6b33084 <symbols missing for uuid: 0000000000000000000000000000000000000000>
    The same trace from craslytics:

    Code (CSharp):
    1.  
    2. 0 libil2cpp.so il2cpp::vm::Object::GetClass(Il2CppObject*)
    3. 1 libunity.so Scripting::UnityEngine::DebugProxy::IsLoggingEnabled(ScriptingExceptionPtr*)
    4. 2 libunity.so __emutls_register_common
    5. 3 libunity.so __emutls_register_common
    6. 4 libunity.so __emutls_register_common
    7. 5 libunity.so __emutls_register_common
    8. 6 libil2cpp.so __Il2CppComDelegate_Finalize_mC9F8EA94444C3AF0A43CC723A23EE4D8B7984F8C
    9. 7 libil2cpp.so __Il2CppComDelegate_Finalize_mC9F8EA94444C3AF0A43CC723A23EE4D8B7984F8C
    10. 8 libunity.so Scripting::LogException(ScriptingExceptionPtr, int, char const*, bool)
    11. 9 libunity.so UnityJavaProxy_LogJNIInvokeException(_JNIEnv*, _jobject*, long)
    12.  
    I am using the following packages:
    IAP 4.6.0
    Services Core 1.7.1
    Remote Config 3.3.1
    Analytics 4.3.0

    What can be wrong?
     
    Last edited: Feb 23, 2023
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Thanks for reporting this. This is a known issue that we are correcting now. Unfortunately there is not a public bug report for it, so I cannot provide an issue tracker link. I'll respond here when we correct the bug though.
     
  3. domonyiv

    domonyiv

    Joined:
    Oct 1, 2016
    Posts:
    76
    Thank you, when can we expect the fix?
     
    Last edited: Feb 24, 2023
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    I don't have an ETA yet, but we are actively working on the fix now.
     
    domonyiv likes this.
  5. atruck11

    atruck11

    Joined:
    Jul 24, 2020
    Posts:
    2
    Any update here? I'm also experiencing a large number of crashes since updating to 2021.3.19f1. Here's the stack trace I'm seeing.


    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    pid: 0, tid: 7940 >>> com.UpsideGaming.MobileTennisLeague <<<
    backtrace:
    #00 pc 0x00000000000d5a78 /system/lib64/libandroid_runtime.so
    #01 pc 0x0000000000150998 /system/lib64/libandroid_runtime.so
    #02 pc 0x000000000004c678 /system/lib64/libbinder.so (android::BBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+136)
    #03 pc 0x000000000004b168 /system/lib64/libmedia.so
    #04 pc 0x0000000000160b68 /system/lib64/libstagefright.so (android::ClearMediaHTTP::disconnect()+120)
    #05 pc 0x0000000000167e64 /system/lib64/libstagefright.so (android::NuMediaExtractor::~NuMediaExtractor()+596)
    #06 pc 0x0000000000167bfc /system/lib64/libstagefright.so (android::NuMediaExtractor::~NuMediaExtractor()+16)
    #07 pc 0x000000000000f6e4 /system/lib64/libutils.so (android::RefBase::decStrong(void const*) const+112)
    #08 pc 0x000000000001b974 /system/lib64/libmediandk.so
    #09 pc 0x0000000000568dd0 /data/app/com.UpsideGaming.MobileTennisLeague-QpoI90h9bGZvvryDWeWK_g==/lib/arm64/libunity.so
    #10 pc 0x00000000001ec368 /data/app/com.UpsideGaming.MobileTennisLeague-QpoI90h9bGZvvryDWeWK_g==/lib/arm64/libunity.so
    #11 pc 0x00000000001ec630 /data/app/com.UpsideGaming.MobileTennisLeague-QpoI90h9bGZvvryDWeWK_g==/lib/arm64/libunity.so
    #12 pc 0x00000000001ec79c /data/app/com.UpsideGaming.MobileTennisLeague-QpoI90h9bGZvvryDWeWK_g==/lib/arm64/libunity.so
    #13 pc 0x00000000001ec9dc /data/app/com.UpsideGaming.MobileTennisLeague-QpoI90h9bGZvvryDWeWK_g==/lib/arm64/libunity.so
    #14 pc 0x00000000001ebd0c /data/app/com.UpsideGaming.MobileTennisLeague-QpoI90h9bGZvvryDWeWK_g==/lib/arm64/libunity.so
    #15 pc 0x000000000028ed34 /data/app/com.UpsideGaming.MobileTennisLeague-QpoI90h9bGZvvryDWeWK_g==/lib/arm64/libunity.so
    #16 pc 0x00000000000e6b50 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
    #17 pc 0x0000000000084c6c /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    The bug has been corrected internally, and fixes are on the way to various Unity release versions now.
     
  7. domonyiv

    domonyiv

    Joined:
    Oct 1, 2016
    Posts:
    76
    Hi @JoshPeterson ,

    did the fix make it into 2021.3.20f1? (Released: March 2, 2023)
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Unfortunately no, the fix did not make that release. We're hoping that it will make 2021.3.21 though, which is scheduled to be released by March 18.
     
    domonyiv likes this.
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Sorry I missed this post - I'm unsure if this is the same error. Initially, it looks like different code, so I would guess that it is not related to the same cause. Is this something that you can reproduce?
     
    manhvu0803 likes this.
  10. leandromondevaim

    leandromondevaim

    Joined:
    Oct 31, 2017
    Posts:
    3
    Hi @JoshPeterson,

    Do you know if this bug is happening in 2020.3.17? we are seeing a lot of these crashes too, since we changed to Android 31.
     
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Yes, I think that it was happening in 2020.3.17. It should be fixed in 2020.3.47.
     
  12. leandromondevaim

    leandromondevaim

    Joined:
    Oct 31, 2017
    Posts:
    3
    okay, thank you! I believe currently this version was not released yet and I couldn't find a release date, do you have any information about when that should be available or if there is any other way to avoid this crashes?
     
  13. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Oh sorry, I should have checked to see if that version was out yet. It should be released April 5 - 7.

    Unfortunately I don't have a work around for this problem before that though.
     
  14. leandromondevaim

    leandromondevaim

    Joined:
    Oct 31, 2017
    Posts:
    3
    Okay, thank you
     
  15. darshan_unity09

    darshan_unity09

    Joined:
    May 12, 2020
    Posts:
    3
    I'm also experiencing a large number of crashes since updating to 2021.3.20f1. Here's the stack trace.

    Crashed: Thread: SIGSEGV 0x0000000000000000
    #00 pc 0x6f97e0 libil2cpp.so (BuildId: 806e0c131767b4279bb9e3906aae2a410c008726)
    #01 pc 0x350a34 libunity.so (Scripting::UnityEngine::DebugProxy::IsLoggingEnabled(ScriptingExceptionPtr*)) (BuildId: ac7ab575c85f42f344ecad382536d352bc4534eb)
    #02 pc 0xe09f49 libunity.so (__emutls_register_common) (BuildId: ac7ab575c85f42f344ecad382536d352bc4534eb)
    #03 pc 0xe09f49 libunity.so (__emutls_register_common) (BuildId: ac7ab575c85f42f344ecad382536d352bc4534eb)
    #04 pc 0xe09f49 libunity.so (__emutls_register_common) (BuildId: ac7ab575c85f42f344ecad382536d352bc4534eb)
    #05 pc 0xe09f49 libunity.so (__emutls_register_common) (BuildId: ac7ab575c85f42f344ecad382536d352bc4534eb)
    #06 pc 0x47dfd libc.so (BuildId: d8a8bbfdbc6a933b1d9eb2c4df04bb26)
    #07 pc 0x241f0fc libil2cpp.so (BuildId: 806e0c131767b4279bb9e3906aae2a410c008726)
    #08 pc 0x241effc libil2cpp.so (BuildId: 806e0c131767b4279bb9e3906aae2a410c008726)
    #09 pc 0x2b09e0 libunity.so (Scripting::LogException(ScriptingExceptionPtr, int, char const*, bool)) (BuildId: ac7ab575c85f42f344ecad382536d352bc4534eb)
    #10 pc 0xf25d8 libunity.so (UnityJavaProxy_LogJNIInvokeException(_JNIEnv, _jobject, long)) (BuildId: ac7ab575c85f42f344ecad382536d352bc4534eb)
    #11 pc 0x7967290084
    #12 pc 0x79673af414
    #13 pc 0xa15ffc libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #14 pc 0xa14ffc libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #15 pc 0x71c9bb44
    #16 pc 0x434a00 libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #17 pc 0x5b76a8 libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #18 pc 0x4564 libartpalette-system.so (BuildId: e72b985990f185e2e27112f3f59375bf)
    #19 pc 0x21d0 libartpalette.so (BuildId: 1fc3041db2ca2a751b2ccce1bb4e468f)
    #20 pc 0x4d6d08 libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #21 pc 0xbc288 libgui.so (BuildId: 6593278df1893f32e3e1cc824f5332fe)
    #22 pc 0x4d7374 libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #23 pc 0x7967cbbf24
    #24 pc 0x45e870 libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #25 pc 0x4d56b0 libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #26 pc 0x7967cbbf24
    #27 pc 0x6900 liblog.so (BuildId: 28ea5154585a4fc544f1324fcd9ea010)
    #28 pc 0x1337fc ld-android.so (BuildId: 2b22c97982283ba374e9e01043ccfbee)
    #29 pc 0x80b2bc libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #30 pc 0x7967cbbf24
    #31 pc 0xc39d4 libandroid_runtime.so (BuildId: f97dd389577211df611486f199d3564d)
    #32 pc 0x71b978e4
    #33 pc 0xc3874 libandroid_runtime.so (BuildId: f97dd389577211df611486f199d3564d)
    #34 pc 0x71ba2a6c
    #35 pc 0x20f240 libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #36 pc 0x20087c libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #37 pc 0x79676ee0fa
    #38 pc 0x43dd6c libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #39 pc 0x20087c libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #40 pc 0x79676ef00e
    #41 pc 0x20008c libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #42 pc 0x43dd1c libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #43 pc 0x79676ef00e
    #44 pc 0x20087c libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #45 pc 0x20b0d4 libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #46 pc 0x79676ef00e
    #47 pc 0x71f68654
    #48 pc 0x71f66ee8
    #49 pc 0x7235be74
    #50 pc 0x7235ff28
    #51 pc 0x7235f9ec
    #52 pc 0x72069ed8
    #53 pc 0xa15ffc libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #54 pc 0x434a00 libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
    #55 pc 0x467134 libart.so (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
     
  16. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    It looks like this call stack is not properly symbolicated, so I'm not sure how to interpret it. You can generate debug symbols for Android builds by following the instructions here: https://docs.unity3d.com/Manual/android-symbols.html

    That might help us gain more insight into this issue.
     
  17. JJunior

    JJunior

    Joined:
    May 22, 2019
    Posts:
    53
    @JoshPeterson I am also experiencing a lot of crashes on Android, can't get my app approved by Google Play, I am using 2020.3.43f1. I will try to upgrade my Unity version to 2021 or maybe to 2022, what version do you recommend for a better Android stability? Should I wait for the 2020.3.47?
     
  18. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    I don't have a general feeling about stability of various versions for Android, sorry. I can say that we definitely port more fixes to 2021 and 2022 versions than 2020. Since 2020 is the oldest release cycle we support, we try to limit the changes to it, and only apply fixes that impact many users.

    So I would recommend you try 2021 or 2022.
     
    JJunior likes this.
  19. JJunior

    JJunior

    Joined:
    May 22, 2019
    Posts:
    53
    Yes, I migrate the project to 2021 and now its not crashing on Android anymore, thanks for your reply @JoshPeterson
     
  20. STKMAN

    STKMAN

    Joined:
    Mar 10, 2016
    Posts:
    11
    Unity 2021.3.21 not fix this bug, still crashed....
     
  21. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    I'm worried you might be hitting a different issue. Can you provide specific information about the crash you are seeing?
     
  22. STKMAN

    STKMAN

    Joined:
    Mar 10, 2016
    Posts:
    11
    upload_2023-3-30_21-0-17.jpeg
     
  23. STKMAN

    STKMAN

    Joined:
    Mar 10, 2016
    Posts:
    11
    upload_2023-3-30_21-3-9.png
     
  24. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    This does look like the same issue reported by @darshan_unity09 in this thread, but I think it is different from the original issue. The bug fix here only corrects the original issue.

    So it looks like this is a different problem. I'm wondering, can you symbolicate the full call stack? That might help us understand the cause of this issue.
     
  25. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    Hello @JoshPeterson , we're having (possibly) similar issue with crashes (stacktrace examples with included symbols attached at the end). We've been experiencing this crash possibly since we switched to unity 2021 last year, but the crash rate wasn't significant. With latest releases it exploded to as much as 9% and we had to cancel it.
    I tried using different build settings and updating everything as much as possible, but it didnt help.
    The stacktraces often mention a call (either from or to) Ironsource, but it doesnt seem to be the source of the problem, but only a trigger at most (but I may be wrong).
    I discussed this issue with colleagues working on different projects with different setups, looking for similarities/differences and found two cases worth mentioning.
    For reference, we're using latest unity 2021 version (currently 2021.3.22) and latest version of Ironsource (currently 7.3.0.1).
    Project A has identical Ironsource version (including mediations), much older Unity version (2021.3.11) and has 0 occurrences of this crash.
    Project B has different Ironsource version, slightly older Unity version (2021.3.20) and have this crash as well, although not happening at an alarming rate.
    All three projects use Remote Config, with ours and Project B using it through the UGS, in case that could be significant.
    I managed to trace the occurrence of these crashes back to a release where we switched from Unity 2021.3.13 up to 2021.3.15, if that's helpful.
    Is this something you could possibly help us with? Thanks in advance for any information.

    Example 1:
    Code (CSharp):
    1. backtrace:
    2.   #00  pc 0x00000000004b590c  /data/app/~~leexWkR8Sj8JMceNsudQrQ==/eu.inlogic.footballcup2018.gplay-iFZbfCvX5fi48Z68NTu7-g==/lib/arm/libil2cpp.so (il2cpp::vm::Method::GetParamCount(MethodInfo const*))
    3.   #01  pc 0x000000000021cd51  /data/app/~~leexWkR8Sj8JMceNsudQrQ==/eu.inlogic.footballcup2018.gplay-iFZbfCvX5fi48Z68NTu7-g==/lib/arm/libunity.so (scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool))
    4.   #02  pc 0x00000000002274b9  /data/app/~~leexWkR8Sj8JMceNsudQrQ==/eu.inlogic.footballcup2018.gplay-iFZbfCvX5fi48Z68NTu7-g==/lib/arm/libunity.so (ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool))
    5.   #03  pc 0x000000000009fe13  /data/app/~~leexWkR8Sj8JMceNsudQrQ==/eu.inlogic.footballcup2018.gplay-iFZbfCvX5fi48Z68NTu7-g==/lib/arm/libunity.so (UnityJavaProxy_invoke(_JNIEnv*, _jobject*, long long, _jstring*, _jobjectArray*))
    6.   #04  pc 0x00000000000439fd  /data/app/~~leexWkR8Sj8JMceNsudQrQ==/eu.inlogic.footballcup2018.gplay-iFZbfCvX5fi48Z68NTu7-g==/oat/arm/base.odex (art_jni_trampoline+156)
    7.   #05  pc 0x00000000000d3dd5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
    8.   #06  pc 0x00000000004ec1bd  /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+276)
    9.   #07  pc 0x000000000012c13f  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+166)
    10.   #08  pc 0x000000000023f86f  /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+254)
    11.   #09  pc 0x000000000023752f  /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+738)
    12.   #10  pc 0x00000000004e004f  /apex/com.android.art/lib/libart.so (MterpInvokeStatic+490)
    13.   #11  pc 0x00000000000ce994  /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+20)
    14.   #12  pc 0x00000000004cf354  /data/app/~~leexWkR8Sj8JMceNsudQrQ==/eu.inlogic.footballcup2018.gplay-iFZbfCvX5fi48Z68NTu7-g==/oat/arm/base.vdex (com.unity3d.player.ReflectionHelper.a)
    15.   #13  pc 0x00000000004e02ad  /apex/com.android.art/lib/libart.so (MterpInvokeStatic+1096)
    16.   #14  pc 0x00000000000ce994  /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+20)
    17.   #15  pc 0x00000000004cf234  /data/app/~~leexWkR8Sj8JMceNsudQrQ==/eu.inlogic.footballcup2018.gplay-iFZbfCvX5fi48Z68NTu7-g==/oat/arm/base.vdex (com.unity3d.player.ReflectionHelper$1.invoke+58)
    18.   #16  pc 0x0000000000230529  /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7806112009619474878)+248)
    19.   #17  pc 0x0000000000236c99  /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+120)
    20.   #18  pc 0x00000000004cf083  /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+698)
    21.   #19  pc 0x00000000000d8961  /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+32)
    22.   #20  pc 0x000000000013962d  /apex/com.android.art/javalib/arm/boot.oat (java.lang.reflect.Proxy.invoke+68)
    23.   #21  pc 0x00000000000d3dd5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
    24.   #22  pc 0x00000000004ec1bd  /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+276)
    25.   #23  pc 0x000000000012c13f  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+166)
    26.   #24  pc 0x00000000003f8f8f  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+350)
    27.   #25  pc 0x00000000003f9163  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+42)
    28.   #26  pc 0x00000000002c5c35  /apex/com.android.art/lib/libart.so (art::JNI<false>::CallStaticObjectMethodA(_JNIEnv*, _jclass*, _jmethodID*, jvalue const*)+524)
    29.   #27  pc 0x00000000004a13f9  /apex/com.android.art/lib/libart.so (art::InvokeProxyInvocationHandler(art::ScopedObjectAccessAlreadyRunnable&, char const*, _jobject*, _jobject*, std::__1::vector<jvalue, std::__1::allocator<jvalue> >&)+472)
    30.   #28  pc 0x00000000004cfe69  /apex/com.android.art/lib/libart.so (artQuickProxyInvokeHandler+996)
    31.   #29  pc 0x00000000000d8715  /apex/com.android.art/lib/libart.so (art_quick_proxy_invoke_handler+20)
    32.   #30  pc 0x00000000000d3dd5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
    33.   #31  pc 0x00000000004ec08b  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+282)
    34.   #32  pc 0x000000000012c12d  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+148)
    35.   #33  pc 0x000000000023f86f  /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+254)
    36.   #34  pc 0x000000000023752f  /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+738)
    37.   #35  pc 0x00000000004decd1  /apex/com.android.art/lib/libart.so (MterpInvokeInterface+892)
    38.   #36  pc 0x00000000000cea14  /apex/com.android.art/lib/libart.so (mterp_op_invoke_interface+20)
    39.   #37  pc 0x00000000004cc5e4  /data/app/~~leexWkR8Sj8JMceNsudQrQ==/eu.inlogic.footballcup2018.gplay-iFZbfCvX5fi48Z68NTu7-g==/oat/arm/base.vdex (com.ironsource.unity.androidbridge.AndroidBridge$4.run+24)
    40.   #38  pc 0x0000000000230529  /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.7806112009619474878)+248)
    41.   #39  pc 0x0000000000236c99  /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+120)
    42.   #40  pc 0x00000000004cf083  /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+698)
    43.   #41  pc 0x00000000000d8961  /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+32)
    44.   #42  pc 0x0000000000130221  /apex/com.android.art/javalib/arm/boot.oat (java.lang.Thread.run+64)
    45.   #43  pc 0x00000000000d3dd5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
    46.   #44  pc 0x00000000004ec08b  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+282)
    47.   #45  pc 0x000000000012c12d  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+148)
    48.   #46  pc 0x00000000003f92e7  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+374)
    49.   #47  pc 0x00000000003f93f7  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+42)
    50.   #48  pc 0x000000000043a845  /apex/com.android.art/lib/libart.so (art::Thread::CreateCallback(void*)+1056)
    51.   #49  pc 0x00000000000807b3  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
    52.   #50  pc 0x0000000000039d83  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)
    Example 2:
    Code (CSharp):
    1. backtrace:
    2.   #00  pc 0x00000000004b590c  /data/app/~~xf1IeRn-9rloIbCoB5gLbQ==/eu.inlogic.footballcup2018.gplay--5RzrBYs7esx4HfESPqDfw==/lib/arm/libil2cpp.so (il2cpp::vm::Method::GetParamCount(MethodInfo const*))
    3.   #01  pc 0x000000000021cd51  /data/app/~~xf1IeRn-9rloIbCoB5gLbQ==/eu.inlogic.footballcup2018.gplay--5RzrBYs7esx4HfESPqDfw==/lib/arm/libunity.so (scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool))
    4.   #02  pc 0x00000000002274b9  /data/app/~~xf1IeRn-9rloIbCoB5gLbQ==/eu.inlogic.footballcup2018.gplay--5RzrBYs7esx4HfESPqDfw==/lib/arm/libunity.so (ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool))
    5.   #03  pc 0x000000000009fe13  /data/app/~~xf1IeRn-9rloIbCoB5gLbQ==/eu.inlogic.footballcup2018.gplay--5RzrBYs7esx4HfESPqDfw==/lib/arm/libunity.so (UnityJavaProxy_invoke(_JNIEnv*, _jobject*, long long, _jstring*, _jobjectArray*))
    6.   #04  pc 0x00000000000409fd  /data/app/~~xf1IeRn-9rloIbCoB5gLbQ==/eu.inlogic.footballcup2018.gplay--5RzrBYs7esx4HfESPqDfw==/oat/arm/base.odex (art_jni_trampoline+156)
    7.   #05  pc 0x00000000000d39d5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
    8.   #06  pc 0x00000000004eaecd  /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+276)
    9.   #07  pc 0x000000000012bd3f  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+166)
    10.   #08  pc 0x000000000023f4af  /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+254)
    11.   #09  pc 0x000000000023716f  /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+738)
    12.   #10  pc 0x00000000004ded5f  /apex/com.android.art/lib/libart.so (MterpInvokeStatic+490)
    13.   #11  pc 0x00000000000ce594  /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+20)
    14.   #12  pc 0x0000000000519e54  /data/app/~~xf1IeRn-9rloIbCoB5gLbQ==/eu.inlogic.footballcup2018.gplay--5RzrBYs7esx4HfESPqDfw==/oat/arm/base.vdex (com.unity3d.player.ReflectionHelper.a)
    15.   #13  pc 0x00000000004defbd  /apex/com.android.art/lib/libart.so (MterpInvokeStatic+1096)
    16.   #14  pc 0x00000000000ce594  /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+20)
    17.   #15  pc 0x000000000051982e  /data/app/~~xf1IeRn-9rloIbCoB5gLbQ==/eu.inlogic.footballcup2018.gplay--5RzrBYs7esx4HfESPqDfw==/oat/arm/base.vdex (com.unity3d.player.ReflectionHelper$1.invoke+58)
    18.   #16  pc 0x0000000000230169  /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.9340319512448905645)+248)
    19.   #17  pc 0x00000000002368d9  /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+120)
    20.   #18  pc 0x00000000004cdd93  /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+698)
    21.   #19  pc 0x00000000000d8561  /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+32)
    22.   #20  pc 0x0000000000136245  /apex/com.android.art/javalib/arm/boot.oat (java.lang.reflect.Proxy.invoke+68)
    23.   #21  pc 0x00000000000d39d5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
    24.   #22  pc 0x00000000004eaecd  /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+276)
    25.   #23  pc 0x000000000012bd3f  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+166)
    26.   #24  pc 0x00000000003f82bf  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+350)
    27.   #25  pc 0x00000000003f8493  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+42)
    28.   #26  pc 0x00000000002c588d  /apex/com.android.art/lib/libart.so (art::JNI<false>::CallStaticObjectMethodA(_JNIEnv*, _jclass*, _jmethodID*, jvalue const*)+524)
    29.   #27  pc 0x00000000004a0109  /apex/com.android.art/lib/libart.so (art::InvokeProxyInvocationHandler(art::ScopedObjectAccessAlreadyRunnable&, char const*, _jobject*, _jobject*, std::__1::vector<jvalue, std::__1::allocator<jvalue> >&)+472)
    30.   #28  pc 0x00000000004ceb79  /apex/com.android.art/lib/libart.so (artQuickProxyInvokeHandler+996)
    31.   #29  pc 0x00000000000d8315  /apex/com.android.art/lib/libart.so (art_quick_proxy_invoke_handler+20)
    32.   #30  pc 0x00000000000d39d5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
    33.   #31  pc 0x00000000004ead9b  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+282)
    34.   #32  pc 0x000000000012bd2d  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+148)
    35.   #33  pc 0x000000000023f4af  /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+254)
    36.   #34  pc 0x000000000023716f  /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+738)
    37.   #35  pc 0x00000000004dd9e1  /apex/com.android.art/lib/libart.so (MterpInvokeInterface+892)
    38.   #36  pc 0x00000000000ce614  /apex/com.android.art/lib/libart.so (mterp_op_invoke_interface+20)
    39.   #37  pc 0x0000000000516638  /data/app/~~xf1IeRn-9rloIbCoB5gLbQ==/eu.inlogic.footballcup2018.gplay--5RzrBYs7esx4HfESPqDfw==/oat/arm/base.vdex (com.ironsource.unity.androidbridge.LevelPlayRewardedVideoWrapper$2.run+12)
    40.   #38  pc 0x0000000000230169  /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.9340319512448905645)+248)
    41.   #39  pc 0x00000000002368d9  /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+120)
    42.   #40  pc 0x00000000004cdd93  /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+698)
    43.   #41  pc 0x00000000000d8561  /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+32)
    44.   #42  pc 0x000000000012d2b9  /apex/com.android.art/javalib/arm/boot.oat (java.lang.Thread.run+64)
    45.   #43  pc 0x00000000000d39d5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
    46.   #44  pc 0x00000000004ead9b  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+282)
    47.   #45  pc 0x000000000012bd2d  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+148)
    48.   #46  pc 0x00000000003f8617  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+374)
    49.   #47  pc 0x00000000003f8727  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+42)
    50.   #48  pc 0x0000000000439825  /apex/com.android.art/lib/libart.so (art::Thread::CreateCallback(void*)+1056)
    51.   #49  pc 0x00000000000aaf93  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
    52.   #50  pc 0x0000000000064203  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)
     
  26. royi-mat

    royi-mat

    Joined:
    Jan 23, 2021
    Posts:
    7
    Hi @JoshPeterson can you please confirm this issue is indeed solved in version 2021.3.21? i can't find it in the version release notes.
     
  27. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Is there a way you can submit a project that causes this with a bug report? A crash rate of 9% seems to be high enough that we can track down the cause, even when it is intermittent. That is like the best option for us to investigate the issue in this case.
     
  28. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    I've made the mistake on this forum thread of not mentioning the original bug report number, so honestly I'm not sure how to point you to the proper release notes entry for this.

    It does look like there are at least two issues here. I think the one originally reported has been corrected, but there is another lurking that seem to be becoming more prevalent.
     
  29. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    Hello, thanks for the reply.
    I don't think how I could, just the assets folder of our project is over 1GB. Also, my experience with unity bug reporting is that unless I can provide a way to reproduce this issue, which I can't, it gets discarded quickly.
    So there's nothing in the provided stacktraces that'd suggest the problem?

    Yesterday we released another test build with the latest unity version (2021.3.23f, since the changelog mentions a couple of fixes related to il2cpp) and updated mediations, but no luck.

    Edit: I went through a bunch of devices we have currently available for testing and found out that for example with Xiaomi Redmi 9A, of all the reported events currently on gplay console, this crash occurred with over 90% of users.
     
    Last edited: Apr 18, 2023
  30. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    I have some ideas about the cause of the problem based on the stack traces, but none of them are actionable enough to make a fix. I'd really like to be able to see this happen so we can confirm that a change will actually fix it.

    If you are willing to submit the project to us and you have some sense about the user actions that might trigger this, I can work with our QA team to get this through the bug process so that it is not rejected, even without a 100% reproduction case.
     
  31. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    It's not about willingness to submit the whole project, it's that so far we have close to zero sense about the user actions that might trigger this, apart from what I've posted above. Our bug report will most likely contain just the project and the stacktraces. Is that enough? If yes, I'll work with our team on that.

    Could you meanwhile share some of those ideas about the cause of the problem, so we can try those out? Assuming that it's something we can do in the project.
    Thanks for replying.
     
  32. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    We do need some indication about how to trigger this in order to investigate it.

    Base on the call stacks, it looks like there is a background thread that is running some Java code, which is trying to call into a C# method. The first part of that callback process involves getting the number of arguments for the C# method, and that is where the crash happens. I suspect that the C# method is only called from Java via the callback mechanism, and might be removed by the managed code stripping system, which in turn causes the crash when the Java code tries to call it.
     
  33. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    I got my hands on the mentioned Redmi 9A, and will try to replicate it somehow, but so far no luck.

    We have managed stripping levels set to minimal, is there a way to influence it in other ways?

    But this reminded me of something I'd like to have clarity about. Recently, every time I make a build, link.xml is arbitrarily added to the project (into seemingly random folder - Assets/Animations/Player/link.xml). I'm aware of what this file is used for, but I'm used to it being in Library/PackageCache folder, not being automatically added directly to random folder within Assets. The contents of the file are rather random as well, it's mix of rules from other packages (such as addressables or newtonsoft.json) and some of our own classes, but we don't use the annotations used for stripping control, so I have no idea why are those particular classes selected.
    Is it possible this is somehow related? I checked with our other projects and they don't have this issue.
     
  34. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Yes, that might be related. The link.xml file tells the managed stripping system what code to preserve, even if it would be otherwise stripped. You can find full details here: https://docs.unity3d.com/Manual/ManagedCodeStripping.html

    Even with minimal stripping enabled, it is possible that C# code used only via reflection is stripped, so this might be the cause.
     
  35. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    I understand, but why does the link.xml get auto-created now and in that particular arbitrary folder? Is this now the default behaviour if the project does not have any link.xml file setup beforehand?
    Also, how and why does it select the classes it includes in the link.xml file? The list seems random. As I said, we don't use any stripping-related annotations.
     
  36. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    I'm not sure what is generating that file, to be honest. Can you send me an example it (maybe via DM)? That might help us understand what is generating it.
     
  37. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    Sent via 'conversation'. Thank you for looking into this.
     
    JoshPeterson likes this.
  38. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Based on the link.xml contents, I think the Addressables system in Unity is producing this file. I don't think that it will have an impact on this crash though, as it is likely used most for serialization.

    The biggest questions I have are: How does the user trigger this crash? What is the art::interpreter code that we see on the call stack?

    It seems like some code is executing at runtime that tries to call a C# method (maybe part of the Unity API), that has been stripped.
     
  39. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    ART is 'android runtime', which has apparently been used instead of Dalvik for some time. I'm not a native android developer, so I don't really know how it works, but some (maybe most) of the methods from the stacktrace can be found here (https://android.googlesource.com/pl...61b/runtime/interpreter/interpreter_common.cc) and at related files.

    How does the user trigger the crash is still unknown to me. But from what I've just read about the ART, it uses AOT to compile application into native code upon installation. Is it possible the stripping causing the crash happens then?
     
  40. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    I don't think so. If stripping is causing this issue, it is Unity's stripping that is removing the code.

    I think the key question is which C# method is the Android runtime trying to call here? If we can determine that, we can see if that method is stripped or not.
     
  41. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    So in other words, I need to go over the Assembly-CSharp.dll from temp and/or Library folders and find a method that's missing, right? Assuming it really is a c# method that's missing.
     
  42. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    The managed stripping system does not remove any code from Assembly-CSharp.dll when the "Minimal" level is used. At that level, it should only be removing code in the .NET base class library (e.g. mscorlib.dll, System.dll, etc.) and UnityEngine.*.dll files. So I don't think that you need to review Assembly-CSharp.dll.

    But if it is possible to see what is stripped from UnityEngine.*.dll files, that might help. Alternatively, you could attempt to make a link.xml that preserves all UnityEngine.*.dll files. But without being able to know how to reproduce this locally, it is really difficult to troubleshoot.
     
  43. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    You mean sending you all the UnityEngine.*dll files from the ManagedStripped folder? Or can I find what was stripped myself ?
     
  44. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    In theory it is possible to see what was stripped by comparing the stripped versions of the UnityEngine.*.dll files with the unstripped versions in the Unity installation. But I don't think that will help, because many things will likely be stripped.

    But if you can preserve all of the UnityEngine.*.dll files with a link.xml file, and then we can see the results of that - do the crashes go away? With that information, we can know if stripping is the cause of the issue or not.
     
  45. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    Is this the correct way to do it?
    Code (CSharp):
    1. <linker>
    2.   <assembly fullname="UnityEngine">
    3.     <type fullname="UnityEngine.*" preserve="all"/>
    4.   </assembly>
    5. </linker>
    I just did a test build with that and looks like the sizes of files in stripped folder are considerably bigger, but still smaller than those coming with Unity installation. Is that expected?

    If that's all it takes, I'll try to roll out a small release tomorrow and compare.
     
    Last edited: Apr 19, 2023
    rdzavoronok likes this.
  46. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    Unfortunately this won't preserve all UnityEngine.*.dll assemblies. In fact, there is no way to do a wildcard at the assembly level. So you will need to have a link.xml file that lists each UnityEngine.*.dll assembly separately.
     
  47. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    We tried the link.xml setup I posted above anyway, but didn't help. So, if it is indeed caused by stripped parts of system libraries, it's either still unstripped or not from UnityEngine.* at all. I'll try to list every assembly, as you mentioned, and try again.

    Could this somehow be also related to Api Compatibility Level? We've still been using .net standard 2.1, while at least one of the projects I mentioned I compared settings with, has been using .net framework.
     
  48. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,926
    It seems unlikely that Api Compatibility Level matters for this case, but it might be worth a try, as we don't have much information about the cause yet.
     
  49. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    Meanwhile, we sent an inquiry to Ironsource support if they could shed some light into what is happening with the callbacks. Depending on if/when they reply, we might try another build with a different Api Compatibility and/or more comprehensive link.xml as recommended above.
    I also discussed this issue more with my colleagues and found out that the other project that does not have issues with these crashes is using Playfab, which comes with its own link.xml containing explicit rules to preserve various parts of System assembly. We might try using those as well, if the first attempt fails. This project also has the different Api Compatibility level.
     
    JoshPeterson likes this.
  50. ikuriscak

    ikuriscak

    Joined:
    Feb 15, 2018
    Posts:
    20
    Upon further inspection, it indeed is unlikely that api level has something to do with this. See attached for reference a stacktrace from a different project that has this crash as well. But, instead of a call from/through Ironsource, it's coming from/through a billing library. From the billing call up to the end it looks identical. This project indeed has Api level of .net framework, BUT they don't use Playfab and thus they don't use this link.xml to prevent stripping from core libraries:
    Code (CSharp):
    1. <linker>
    2.   <assembly fullname="System">
    3.     <namespace fullname="System.Net" preserve="all"/>
    4.     <namespace fullname="System.Net.Configuration" preserve="all"/>
    5.     <namespace fullname="System.ComponentModel" preserve="all"/>
    6.     <namespace fullname="System.Runtime.ConstrainedExecution" preserve="all"/>
    7.     <namespace fullname="System.Runtime.InteropServices" preserve="all"/>
    8.     <namespace fullname="System.Runtime.Serialization" preserve="all"/>
    9.     <namespace fullname="System.Configuration" preserve="all"/>
    10.   </assembly>
    11.   <assembly fullname="mscorlib">
    12.     <namespace fullname="System.Security.Cryptography" preserve="all"/>
    13.   </assembly>
    14.   <assembly fullname="Mono.Security">
    15.     <namespace fullname="Mono.Security.Protocol.Tls" preserve="all"/>
    16.     <namespace fullname="Mono.Security.X509" preserve="all"/>
    17.   </assembly>
    18.   <assembly fullname="PlayFab" preserve="all"/>
    19. </linker>
    I'm going to add this a see what happens.

    Attached stacktrace:
    Code (CSharp):
    1. backtrace:
    2.   #00  pc 0x00000000007eb164  /data/app/XXX-CdyOF0NLzhNLjZnqkQMZwg==/lib/arm64/libil2cpp.so (il2cpp::vm::Method::GetParamCount(MethodInfo const*))
    3.   #01  pc 0x0000000000302684  /data/app/XXX-CdyOF0NLzhNLjZnqkQMZwg==/lib/arm64/libunity.so (scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool))
    4.   #02  pc 0x0000000000310474  /data/app/XXX-CdyOF0NLzhNLjZnqkQMZwg==/lib/arm64/libunity.so (ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool))
    5.   #03  pc 0x000000000011a704  /data/app/XXX-CdyOF0NLzhNLjZnqkQMZwg==/lib/arm64/libunity.so (UnityJavaProxy_invoke(_JNIEnv*, _jobject*, long, _jstring*, _jobjectArray*))
    6.   #04  pc 0x0000000000053030  /data/app/XXX-CdyOF0NLzhNLjZnqkQMZwg==/oat/arm64/base.odex (com.unity3d.player.ReflectionHelper.nativeProxyInvoke+208)
    7.   #05  pc 0x0000000000558c4c  /system/lib64/libart.so (art_quick_invoke_static_stub+604)
    8.   #06  pc 0x00000000000cfce8  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
    9.   #07  pc 0x0000000000280438  /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
    10.   #08  pc 0x000000000027a440  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968)
    11.   #09  pc 0x0000000000528d70  /system/lib64/libart.so (MterpInvokeStatic+204)
    12.   #10  pc 0x000000000054b094  /system/lib64/libart.so (ExecuteMterpImpl+14612)
    13.   #11  pc 0x00000000009f244c  /data/app/XXX-CdyOF0NLzhNLjZnqkQMZwg==/oat/arm64/base.vdex (com.unity3d.player.ReflectionHelper.a)
    14.   #12  pc 0x0000000000254144  /system/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool) (.llvm.1630342527)+488)
    15.   #13  pc 0x0000000000259c38  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
    16.   #14  pc 0x000000000027a424  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
    17.   #15  pc 0x0000000000528d70  /system/lib64/libart.so (MterpInvokeStatic+204)
    18.   #16  pc 0x000000000054b094  /system/lib64/libart.so (ExecuteMterpImpl+14612)
    19.   #17  pc 0x00000000009f1e26  /data/app/XXX-CdyOF0NLzhNLjZnqkQMZwg==/oat/arm64/base.vdex (com.unity3d.player.ReflectionHelper$1.invoke+58)
    20.   #18  pc 0x0000000000254144  /system/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool) (.llvm.1630342527)+488)
    21.   #19  pc 0x0000000000518100  /system/lib64/libart.so (artQuickToInterpreterBridge+1020)
    22.   #20  pc 0x0000000000561afc  /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
    23.   #21  pc 0x00000000002677bc  /system/framework/arm64/boot.oat (java.lang.reflect.Proxy.invoke+92)
    24.   #22  pc 0x0000000000558c4c  /system/lib64/libart.so (art_quick_invoke_static_stub+604)
    25.   #23  pc 0x00000000000cfce8  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
    26.   #24  pc 0x000000000045edac  /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
    27.   #25  pc 0x000000000045fa68  /system/lib64/libart.so (art::InvokeWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+408)
    28.   #26  pc 0x000000000035703c  /system/lib64/libart.so (art::JNI::CallStaticObjectMethodA(_JNIEnv*, _jclass*, _jmethodID*, jvalue*)+636)
    29.   #27  pc 0x00000000004f9c3c  /system/lib64/libart.so (art::InvokeProxyInvocationHandler(art::ScopedObjectAccessAlreadyRunnable&, char const*, _jobject*, _jobject*, std::__1::vector<jvalue, std::__1::allocator<jvalue>>&)+604)
    30.   #28  pc 0x0000000000518ec8  /system/lib64/libart.so (artQuickProxyInvokeHandler+996)
    31.   #29  pc 0x000000000056156c  /system/lib64/libart.so (art_quick_proxy_invoke_handler+76)
    32.   #30  pc 0x0000000000558988  /system/lib64/libart.so (art_quick_invoke_stub+584)
    33.   #31  pc 0x00000000000cfcc8  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
    34.   #32  pc 0x0000000000280438  /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
    35.   #33  pc 0x000000000027a440  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968)
    36.   #34  pc 0x00000000005287e8  /system/lib64/libart.so (MterpInvokeInterface+1392)
    37.   #35  pc 0x000000000054b114  /system/lib64/libart.so (ExecuteMterpImpl+14740)
    38.   #36  pc 0x000000000022e4f8  /data/app/XXX-CdyOF0NLzhNLjZnqkQMZwg==/oat/arm64/base.vdex (com.android.billingclient.api.zzaa.call+48)
    39.   #37  pc 0x0000000000254144  /system/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool) (.llvm.1630342527)+488)
    40.   #38  pc 0x0000000000518100  /system/lib64/libart.so (artQuickToInterpreterBridge+1020)
    41.   #39  pc 0x0000000000561afc  /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
    42.   #40  pc 0x0000000000371c7c  /system/framework/arm64/boot.oat (java.util.concurrent.FutureTask.run+204)
    43.   #41  pc 0x00000000003daa14  /system/framework/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+996)
    44.   #42  pc 0x00000000003d7790  /system/framework/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+64)
    45.   #43  pc 0x000000000025e1c8  /system/framework/arm64/boot.oat (java.lang.Thread.run+72)
    46.   #44  pc 0x0000000000558988  /system/lib64/libart.so (art_quick_invoke_stub+584)
    47.   #45  pc 0x00000000000cfcc8  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
    48.   #46  pc 0x000000000045edac  /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
    49.   #47  pc 0x000000000045fe68  /system/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+424)
    50.   #48  pc 0x000000000048b288  /system/lib64/libart.so (art::thread::CreateCallback(void*)+1120)
    51.   #49  pc 0x0000000000091a14  /system/lib64/libc.so (__pthread_start(void*)+36)
    52.   #50  pc 0x0000000000023f78  /system/lib64/libc.so (__start_thread+68)
     
    Last edited: Apr 25, 2023
    JoshPeterson likes this.