Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug Unity PubNub 7.1.3 crash [libil2cpp.so] il2cpp::vm::Class::Init(Il2CppClass*)

Discussion in 'Android' started by andrewhvs, Apr 23, 2024.

  1. andrewhvs

    andrewhvs

    Joined:
    Jan 25, 2019
    Posts:
    3
    We've been trying to track down the cause of an issue for quite some time now, but can't seem to figure it out.
    We have this crash in what seems to be part of a thread executed with our PubNub implementation that gets reported by many of our players, but despite our best efforts, we can't seem to repro this internally.

    Strangely, it seems like most of the crash reports come from Android devices using either the Cortex-A53 or Cortex-A55 CPU (Most common are the Motorola HawaiiP, Samsung A04 and A03)

    We're currently using Unity 2022.3.15 and the Unity PubNub SDK v7.1.3.

    We thought it might be something with the code stripping, so we tried using this link.xml file:

    Code (CSharp):
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <linker>
    3.     <assembly fullname="PubnubApiUnity" preserve="all" />
    4.     <assembly fullname="PubNubAPI" preserve="all" />
    5.     <assembly fullname="Newtonsoft.Json" preserve="all" />
    6. </linker>
    But no dice, unfortunately.

    Any and all insights would help tremendously! Thanks so much in advance.

    This is the stack trace that we see cropping up:

    Code (CSharp):
    1. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    2. pid: 0, tid: 14625 >>> com.game.name <<<
    3.  
    4. backtrace:
    5.   #00  pc 0x000000000170d3a0  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (il2cpp::vm::Class::Init(Il2CppClass*)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    6.   #01  pc 0x0000000001750640  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (il2cpp::vm::Type::GetNameInternal(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>&, Il2CppType const*, Il2CppTypeNameFormat, bool)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    7.   #02  pc 0x0000000001750a54  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (il2cpp::vm::Type::GetName(Il2CppType const*, Il2CppTypeNameFormat)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    8.   #03  pc 0x00000000016e00a4  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (il2cpp::vm::RaiseExceptionForNotFoundInterface(Il2CppClass const*, Il2CppClass const*, unsigned short)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    9.   #04  pc 0x00000000016e0070  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (il2cpp::vm::ClassInlines::GetInterfaceInvokeDataFromVTableSlowPath(Il2CppObject*, Il2CppClass const*, unsigned short)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    10.   #05  pc 0x0000000002dc2f48  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (JContainer_Add_mA8F552B852765618919FCB3FF97C7C9C3E732160) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    11.   #06  pc 0x0000000002dc3a50  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (JContainer_ReadProperty_mF361C88D805D4D7C709EE31688A718EAD753EDE7) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    12.   #07  pc 0x0000000002dc36f4  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (JContainer_ReadContentFrom_m7824C54775FAB81872033ABBB131B1A66CDB690B) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    13.   #08  pc 0x0000000002dbf734  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (JContainer_ReadTokenFrom_m866C27A2735BE11C2369C02407B191EC29C3425B) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    14.   #09  pc 0x0000000002dc7a08  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (JObject_Load_mBFB13BABDB5082B495040AF48A8C691516D2D2E7) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    15.   #10  pc 0x0000000002dc7b74  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (JObject_Parse_mBF13328E82E184AE1D3E1AA56ED3A2879618719B) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    16.   #11  pc 0x0000000002e9bd44  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (NewtonsoftJsonDotNet_IsValidJson_mC19D0A7711BE1AAB367F2703B8B7CDBA2B4888C8) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    17.   #12  pc 0x0000000002e9bfa4  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (NewtonsoftJsonDotNet_IsDictionaryCompatible_mF9A71A8BD2325A34362B7912CD1379A27ACC55A9) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    18.   #13  pc 0x0000000001f697a0  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (PubnubCoreBase_GetStatusIfError_TisRuntimeObject_m250D3742956BAA1C0889D4C9BAA1F258D5EAF15A_gshared) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    19.   #14  pc 0x0000000002457a50  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (U3CUrlProcessRequestU3Ed__160_1_MoveNext_mF702D68B0302493F768481E46B4A904AE0453E90_gshared) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    20.   #15  pc 0x0000000002d08d30  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (ExecutionContext_RunInternal_mC37E85D6FC972DF219A00FE1EE34329D1D63CC94) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    21.   #16  pc 0x0000000002bcf0a8  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (MoveNextRunner_Run_m86395F123FB453F2B5FF89CE1E98532F7426F9DE) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    22.   #17  pc 0x0000000002d1956c  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (AwaitTaskContinuation_RunOrScheduleAction_mAB1E447337DDFFE6824A12BBEDE6324AA2823800) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    23.   #18  pc 0x0000000002d17760  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (Task_FinishContinuations_m21B540B556CDABD76F5985DF83079F7F30C78174) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    24.   #19  pc 0x0000000002940dd8  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (Task_1_TrySetResult_m2EE766FD3F76F4824990F4A93ED1F7253ECE014C_gshared) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    25.   #20  pc 0x000000000216eba8  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (AsyncTaskMethodBuilder_1_SetResult_m0D83195F995F9825D7A6DCDC3835D6917C43B5A6_gshared) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    26.   #21  pc 0x000000000227198c  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (U3CPubnubApiU2DIPubnubHttpU2DSendRequestAndGetJsonResponseU3Ed__13_1_MoveNext_m8BA4799F8D048D4BCE394C452F7D73D33F79140A_gshared) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    27.   #22  pc 0x0000000002d08d30  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (ExecutionContext_RunInternal_mC37E85D6FC972DF219A00FE1EE34329D1D63CC94) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    28.   #23  pc 0x0000000002bcf0a8  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (MoveNextRunner_Run_m86395F123FB453F2B5FF89CE1E98532F7426F9DE) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    29.   #24  pc 0x0000000002d1956c  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (AwaitTaskContinuation_RunOrScheduleAction_mAB1E447337DDFFE6824A12BBEDE6324AA2823800) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    30.   #25  pc 0x0000000002d17760  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (Task_FinishContinuations_m21B540B556CDABD76F5985DF83079F7F30C78174) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    31.   #26  pc 0x0000000002940dd8  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (Task_1_TrySetResult_m2EE766FD3F76F4824990F4A93ED1F7253ECE014C_gshared) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    32.   #27  pc 0x000000000216eba8  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (AsyncTaskMethodBuilder_1_SetResult_m0D83195F995F9825D7A6DCDC3835D6917C43B5A6_gshared) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    33.   #28  pc 0x0000000002355e74  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (U3CSendRequestAndGetJsonResponseHttpClientU3Ed__17_1_MoveNext_m1A7194E568F3AF7A92FE5AA93F8885C83DF28354_gshared) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    34.   #29  pc 0x0000000002d08d30  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (ExecutionContext_RunInternal_mC37E85D6FC972DF219A00FE1EE34329D1D63CC94) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    35.   #30  pc 0x0000000002bcf0a8  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (MoveNextRunner_Run_m86395F123FB453F2B5FF89CE1E98532F7426F9DE) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    36.   #31  pc 0x0000000002d1956c  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (AwaitTaskContinuation_RunOrScheduleAction_mAB1E447337DDFFE6824A12BBEDE6324AA2823800) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    37.   #32  pc 0x0000000002d17760  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (Task_FinishContinuations_m21B540B556CDABD76F5985DF83079F7F30C78174) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    38.   #33  pc 0x00000000029459e4  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (Task_1_TrySetResult_m80576355963E201DD03E813734ED4CDA847E199E_gshared) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    39.   #34  pc 0x00000000021714b4  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (AsyncTaskMethodBuilder_1_SetResult_m46806C460117058C2FEC2AC46948F213CF5B4D11_gshared) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    40.   #35  pc 0x0000000002f2baa8  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (U3CStoreLatencyU3Ed__17_MoveNext_mDAD35C6EAAE07634B7B36E7EE17C9CB335155D2A) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    41.   #36  pc 0x0000000002d08d30  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (ExecutionContext_RunInternal_mC37E85D6FC972DF219A00FE1EE34329D1D63CC94) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    42.   #37  pc 0x0000000002bcf0a8  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (MoveNextRunner_Run_m86395F123FB453F2B5FF89CE1E98532F7426F9DE) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    43.   #38  pc 0x0000000002d1956c  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (AwaitTaskContinuation_RunOrScheduleAction_mAB1E447337DDFFE6824A12BBEDE6324AA2823800) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    44.   #39  pc 0x0000000002d17760  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (Task_FinishContinuations_m21B540B556CDABD76F5985DF83079F7F30C78174) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    45.   #40  pc 0x0000000002d15380  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (Task_Finish_m31254E2C51EFD6E2893866C6B64F9BB31A8C2676) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    46.   #41  pc 0x0000000002d1805c  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (Task_ExecuteWithThreadLocal_mD3F4E7ADBBC473EAF7C24B3A785EBB452D6A76BE) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    47.   #42  pc 0x0000000002d17f1c  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (Task_ExecuteEntry_m735BD89474854D6EAA2ED929D6765AF1B4AEDCDF) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    48.   #43  pc 0x0000000002d0cbdc  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (ThreadPoolWorkQueue_Dispatch_mEAAC936B3756DAA856BA3A4D976A98A3184CDC87) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    49.   #44  pc 0x0000000001663de0  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (RuntimeInvoker_FalseByte_t94D9231AC217BE4D2E004C4CD32DF6D099EA41A3(void (*)(), MethodInfo const*, void*, void**, void*)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    50.   #45  pc 0x000000000170894c  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    51.   #46  pc 0x00000000016dae6c  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (worker_thread(void*)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    52.   #47  pc 0x0000000001747c58  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (il2cpp::vm::ThreadStart(void*)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    53.   #48  pc 0x0000000001722820  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (il2cpp::os::Thread::RunWrapper(void*)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    54.   #49  pc 0x00000000017022b8  /data/app/~~EBD74HDqBCW9kBx0vNe5rw==/com.game.name-Ox5BLPLTMmdF7J7ZKBqOmQ==/lib/arm64/libil2cpp.so (il2cpp::os::ThreadImpl::ThreadStartWrapper(void*)) (BuildId: 628f16a5f1c4f2dc955881d9ae94bd81a4ff6008)
    55.   #50  pc 0x00000000000db188  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64)
    56.   #51  pc 0x000000000007a9d0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
     
  2. mike-voorhees

    mike-voorhees

    Unity Technologies

    Joined:
    Aug 9, 2016
    Posts:
    50
    I don't have an answer for you, but I wanted to give you an update on my thoughts and what I know so far.

    2022.3 made "Minimal" the default Managed Stripping Level in the Player Settings. If you're using Minimal, then only UnityEngine.*.dll and the class library assemblies will be stripped. In other words, PubnubApiUnity, PubHubAPI, and Newtonsoft.Json would not have been stripped. Which means the link.xml change wouldn't change the outcome of code stripping. That doesn't necessarily rule on code stripping as being involved but it would have to be something in the class libraries on UnityEngine.*.dll that is missing.

    I tried some exploratory testing on our end. I took Newtonsoft.Json 13.0.1 from nuget and hacked it into our IL2CPP & UnityLinker test framework. Then wrote a test to call "JObject.Parse". Everything is fine. Granted I tried this using our latest code, on Windows, so it's not apples-to-apples.

    I'm asking around what others think. I'll try to take my hacked test back to 2022.3 code and run it on android and see what happens. I'll get back to you with our final conclusions based on the stack. If we can't find anything we'll need a bug repo with a repro project. I can only take this so far guessing on a lot of variables that are involved.

    Thanks,
    -Mike
     
  3. andrewhvs

    andrewhvs

    Joined:
    Jan 25, 2019
    Posts:
    3
    Mike, thanks so much for the updates! I really appreciate you looking into this and asking around about it.

    For what it's worth, our project was build using the "Low" Managed Stripping Level (we added the link.xml file to try and have this be a bit more targeted), so perhaps there could be something there?

    One of the things we noticed with we do have some other NullExceptions being reported when running some of the PubNub callbacks on the main thread. Our thought was that maybe if one of the background threads is running into an exception when parsing the JObject, this could happen? Not exactly apples-to-apples, but this issue seems similar: https://issuetracker.unity3d.com/is...-an-exception-is-called-from-multiple-threads

    Totally understand that there's only so far you can go without repro steps, which is where we're at! We've been unable to repro this issue internally, despite the numerous player reports. But we're happy to provide as much information as we can.
     
  4. Alan-Liu

    Alan-Liu

    Joined:
    Jan 23, 2014
    Posts:
    397
    Unity 2022.3.20 fixed some multiple thread issues in IL2CPP:
    • IL2CPP: Fixed data races in lazy initialization checks on ARM processors. (UUM-44039)
    I'm the one who reported this issue. I modified my reproduction project to test your code. The crash can be reproduced on Android in 2022.3.15, but not in 2022.3.20. So I think upgrading Unity to 2022.3.20 or later versions can fix the crash.

    Here is the code to reproduce:
    Code (CSharp):
    1. using System;
    2. using System.Threading;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5. using Newtonsoft.Json.Linq;
    6.  
    7. public class Test : MonoBehaviour
    8. {
    9.     public Text Text;
    10.  
    11.     void Start()
    12.     {
    13.         int running = PlayerPrefs.GetInt("Running", 0);
    14.  
    15.         if (running != 0)
    16.         {
    17.             Text.text = "Crashed";
    18.             return;
    19.         }
    20.  
    21.         PlayerPrefs.SetInt("Running", 1);
    22.         PlayerPrefs.Save();
    23.  
    24.         Run(() => Test1(), Environment.ProcessorCount);
    25.  
    26.         PlayerPrefs.SetInt("Running", 0);
    27.         PlayerPrefs.Save();
    28.  
    29. #if UNITY_EDITOR
    30.         UnityEditor.EditorApplication.isPlaying = false;
    31. #else
    32.         Application.Quit();
    33. #endif
    34.     }
    35.  
    36.     void Run(ThreadStart action, int threadCount)
    37.     {
    38.         var threads = new Thread[threadCount];
    39.  
    40.         for (int i = 0; i < threadCount; ++i)
    41.         {
    42.             threads[i] = new Thread(action);
    43.         }
    44.  
    45.         for (int i = 0; i < threadCount; ++i)
    46.         {
    47.             threads[i].Start();
    48.         }
    49.  
    50.         for (int i = 0; i < threadCount; ++i)
    51.         {
    52.             threads[i].Join();
    53.         }
    54.     }
    55.  
    56.     static void Test1()
    57.     {
    58.         JObject.Parse("{\"X\":1}");
    59.     }
    60. }
    61.  
    I used a batch file to launch/stop the application on a Android device repeatedly. The application crashed in a few minutes.

    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Version '2022.3.15f1 (b58023a2b463)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    Build fingerprint: 'OnePlus/PHK110/OP5913L1:14/UKQ1.230924.001/T.16856c3_1-8d2fb:user/release-keys'
    Revision: '0'
    ABI: 'arm64'
    Timestamp: 2024-04-25 14:23:17.120305988+0800
    pid: 20007, tid: 20437, name: UnityMain >>> com.DefaultCompany.TestIl2cppThread2 <<<
    uid: 10433
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr --------
    Cause: null pointer dereference
    x0 0000000000000000 x1 0000000000000001 x2 0000000000000000 x3 0000000000000000
    x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 0000007eb2eb9670
    x8 00000000fffffff1 x9 00000000ffffffff x10 0000007d502459b8 x11 0000007d50242a98
    x12 0000000000000001 x13 0000007e4b5a1000 x14 0000007e4b384000 x15 0000000000000001
    x16 0000007e4b230780 x17 0000007f63d011d0 x18 0000007dca2f0000 x19 0000007eb2eb9848
    x20 0000000020001a39 x21 0000000000000000 x22 0000000000000000 x23 0000000000000000
    x24 0000000000000000 x25 0000000000000000 x26 0000007e4b27f6d0 x27 0000007e4b27f710
    x28 0000007e497f9fcc x29 0000007e4b27f6b8
    lr 0000007e49f8c0c4 sp 0000007eb2eb9760 pc 0000007e49fd5cc8 pst 00000000a0001000
    backtrace:
    #00 pc 0000000000d75cc8 (il2cpp::vm::Class::Init(Il2CppClass*) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\vm\Class.cpp:1582) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #01 pc 0000000000d2c0c0 (il2cpp::vm::Type::GetNameInternal(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >&, Il2CppType const*, Il2CppTypeNameFormat, bool) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\vm\Type.cpp:684) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #02 pc 0000000000d2c4d4 (il2cpp::vm::Type::GetName(Il2CppType const*, Il2CppTypeNameFormat) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\vm\Type.cpp:773) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #03 pc 0000000000d4c754 (il2cpp::vm::RaiseExceptionForNotFoundInterface(Il2CppClass const*, Il2CppClass const*, unsigned short) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\vm\ClassInlines.cpp:49) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #04 pc 0000000000d4c720 (il2cpp::vm::ClassInlines::GetInterfaceInvokeDataFromVTableSlowPath(Il2CppObject*, Il2CppClass const*, unsigned short) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\vm\ClassInlines.cpp:98) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #05 pc 000000000183616c (il2cpp::vm::ClassInlines::GetInterfaceInvokeDataFromVTable(Il2CppObject*, Il2CppClass const*, unsigned short) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\vm\ClassInlines.h:56) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #06 pc 0000000001836ac4 (VirtualActionInvoker1<Il2CppObject*>::Invoke(unsigned short, Il2CppObject*, Il2CppObject*) at D:/Projects/TestIl2cppThread2/Library/Bee/artifacts/Android/il2cppOutput/cpp\Newtonsoft.Json__3.cpp:31) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #07 pc 00000000018366c4 (JContainer_ReadContentFrom_m7824C54775FAB81872033ABBB131B1A66CDB690B at D:/Projects/TestIl2cppThread2/Library/Bee/artifacts/Android/il2cppOutput/cpp\Newtonsoft.Json__3.cpp:11458) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #08 pc 0000000001833174 (JContainer_ReadTokenFrom_m866C27A2735BE11C2369C02407B191EC29C3425B at D:/Projects/TestIl2cppThread2/Library/Bee/artifacts/Android/il2cppOutput/cpp\Newtonsoft.Json__3.cpp:11033) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #09 pc 0000000001837b60 (JObject_Load_mBFB13BABDB5082B495040AF48A8C691516D2D2E7 at D:/Projects/TestIl2cppThread2/Library/Bee/artifacts/Android/il2cppOutput/cpp\Newtonsoft.Json__3.cpp:12519) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #10 pc 0000000001837cc8 (JObject_Parse_mBF13328E82E184AE1D3E1AA56ED3A2879618719B at D:/Projects/TestIl2cppThread2/Library/Bee/artifacts/Android/il2cppOutput/cpp\Newtonsoft.Json__3.cpp:12584) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #11 pc 00000000017bf4cc (ContextCallback_Invoke_m872CCCD40428B88C2612772491BE5157895B5F61_inline(ContextCallback_tE8AFBDBFCC040FDA8DA8C1EEFE9BD66B16BDA007*, Il2CppObject*, MethodInfo const*) at D:/Projects/TestIl2cppThread2/Library/Bee/artifacts/Android/il2cppOutput/cpp\mscorlib__8.cpp:29977) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #12 pc 0000000000d32130 (il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\vm\Runtime.cpp:606) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #13 pc 0000000000d3207c (il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\vm\Runtime.cpp:592) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #14 pc 0000000000d1db38 (il2cpp::icalls::mscorlib::System::Threading::ThreadStart(void*) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\icalls\mscorlib\System.Threading\Thread.cpp:62) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #15 pc 0000000000d3f658 (il2cpp::eek:s::Thread::RunWrapper(void*) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\os\Thread.cpp:201) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #16 pc 0000000000d63abc (il2cpp::eek:s::ThreadImpl::ThreadStartWrapper(void*) at C:/UnityEditors\2022.3.15f1\Editor\Data\il2cpp\libil2cpp\os\Posix\ThreadImpl.cpp:123) /data/app/~~HTjQC7sM4KxyJ3LfR8tkfA==/com.DefaultCompany.TestIl2cppThread2-jpgutWdAYXwnc8m612Ic3w==/lib/arm64/libil2cpp.so (BuildId: 6dd639be3643346bab2dac2a57d69ce0c6e7a966)
    #17 pc 0000000000104fc4 (libc[.so|.so.sym|.sym.so|.so.dbg|.dbg.so] not found) /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: d1a98b526f2f94260a53c3055979a4f6)
    #18 pc 000000000009e764 (libc[.so|.so.sym|.sym.so|.so.dbg|.dbg.so] not found) /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: d1a98b526f2f94260a53c3055979a4f6)
     
    Last edited: Apr 25, 2024
  5. andrewhvs

    andrewhvs

    Joined:
    Jan 25, 2019
    Posts:
    3
    Alan, thank you so much for your insights! This is massively helpful. I'm trying this out now on my end, so hopefully it will work! We had some other threading issues we were encountering in Unity 2022.3.21 which is why we're using v15, but we'll see if we can get around those issues.