Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug null pointer dereference crash on launch

Discussion in 'Android' started by ColinAmuzo, Mar 23, 2023.

  1. ColinAmuzo

    ColinAmuzo

    Joined:
    Mar 20, 2013
    Posts:
    46
    Unity 2020.3.38, Android.
    App immediately crashes on launch.
    Log:
    Code (JavaScript):
    1. I Unity   : SystemInfo CPU = ARM64 FP ASIMD AES, Cores = 8, Memory = 3742mb
    2. I Unity   : SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf0), 4 little (mask: 0xf)
    3. I Unity   : ApplicationInfo com.amuzo.plasvt version 1.1.2 build de976e9f-d6b6-4ce9-8a7c-238a4f31b6b3
    4. I Unity   : Built from '2020.3/staging' branch, Version '2020.3.38f1 (8f5fde82e2dc)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a', Stripping 'Enabled'
    5. E CRASH   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    6. E CRASH   : Version '2020.3.38f1 (8f5fde82e2dc)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    7. E CRASH   : Build fingerprint: 'motorola/kane_reteu/kane_sprout:11/RSAS31.Q1-48-36-23/f57e3:user/release-keys'
    8. E CRASH   : Revision: 'PVT'
    9. E CRASH   : ABI: 'arm64'
    10. E CRASH   : Timestamp: 2023-03-23 14:42:57+0000
    11. E CRASH   : pid: 19021, tid: 19043, name: UnityMain  >>> com.amuzo.plasvt <<<
    12. E CRASH   : uid: 10255
    13. E CRASH   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
    14. E CRASH   : Cause: null pointer dereference
    15. E CRASH   :     x0  0000006f20415040  x1  0000000000000000  x2  0000000000000000  x3  000000000015d000
    16. E CRASH   :     x4  0000007225176708  x5  0000000000000000  x6  0000007001fbf410  x7  0000007081faaad0
    17. E CRASH   :     x8  0000000000000000  x9  0000000000000000  x10 0000006f2062c000  x11 0000000000000002
    18. E CRASH   :     x12 000000000000001e  x13 0000000000000018  x14 0000000000000004  x15 0000000000000033
    19. E CRASH   :     x16 0000007225210b40  x17 00000072251f2720  x18 000000005638db18  x19 0000006f26619320
    20. E CRASH   :     x20 0000006f28a91000  x21 00000070a1f9f530  x22 0000006f28a91000  x23 0000000000000001
    21. E CRASH   :     x24 0000000000000000  x25 00000070a1f9f520  x26 0000006f20ad0294  x27 0000006f20a8457c
    22. E CRASH   :     x28 0000000000000058  x29 0000006f266192e0
    23. E CRASH   :     sp  0000006f26619270  lr  0000006f26d8d330  pc  0000006f26d8d3e4
    24. E CRASH   : backtrace:
    25. E CRASH   :       #00 pc 000000000076d3e4  /data/app/~~7vghgxZxr1iBb4Q-OLwSGQ==/com.amuzo.plasvt-8iPUGvGUE9f-IOPI2nqbhw==/lib/arm64/libil2cpp.so (BuildId: 16d11fb4ea53471bba279bb1d7c1ae579c4e8e1a)
    26. E CRASH   :       #01 pc 0000000000770c2c  /data/app/~~7vghgxZxr1iBb4Q-OLwSGQ==/com.amuzo.plasvt-8iPUGvGUE9f-IOPI2nqbhw==/lib/arm64/libil2cpp.so (BuildId: 16d11fb4ea53471bba279bb1d7c1ae579c4e8e1a)
    27. E CRASH   :       #02 pc 00000000007623c8  /data/app/~~7vghgxZxr1iBb4Q-OLwSGQ==/com.amuzo.plasvt-8iPUGvGUE9f-IOPI2nqbhw==/lib/arm64/libil2cpp.so (BuildId: 16d11fb4ea53471bba279bb1d7c1ae579c4e8e1a)
    28. E CRASH   :       #03 pc 0000000000584c9c  /data/app/~~7vghgxZxr1iBb4Q-OLwSGQ==/com.amuzo.plasvt-8iPUGvGUE9f-IOPI2nqbhw==/lib/arm64/libil2cpp.so (il2cpp_init+36) (BuildId: 16d11fb4ea53471bba279bb1d7c1ae579c4e8e1a)
    29. E CRASH   :       #04 pc 00000000003523e8  /data/app/~~7vghgxZxr1iBb4Q-OLwSGQ==/com.amuzo.plasvt-8iPUGvGUE9f-IOPI2nqbhw==/lib/arm64/libunity.so (BuildId: f69aaa34d8c7c6a9414c3e9d968bcde6981aaeca)
    30. E CRASH   :       #05 pc 00000000003c6450  /data/app/~~7vghgxZxr1iBb4Q-OLwSGQ==/com.amuzo.plasvt-8iPUGvGUE9f-IOPI2nqbhw==/lib/arm64/libunity.so (BuildId: f69aaa34d8c7c6a9414c3e9d968bcde6981aaeca)
    31. E CRASH   :       #06 pc 00000000003c7168  /data/app/~~7vghgxZxr1iBb4Q-OLwSGQ==/com.amuzo.plasvt-8iPUGvGUE9f-IOPI2nqbhw==/lib/arm64/libunity.so (BuildId: f69aaa34d8c7c6a9414c3e9d968bcde6981aaeca)
    32. E CRASH   :       #07 pc 00000000003dd4a0  /data/app/~~7vghgxZxr1iBb4Q-OLwSGQ==/com.amuzo.plasvt-8iPUGvGUE9f-IOPI2nqbhw==/lib/arm64/libunity.so (BuildId: f69aaa34d8c7c6a9414c3e9d968bcde6981aaeca)
    33. E CRASH   :       #08 pc 00000000000041fc  /data/app/~~7vghgxZxr1iBb4Q-OLwSGQ==/com.amuzo.plasvt-8iPUGvGUE9f-IOPI2nqbhw==/oat/arm64/base.odex
    34.  
    Symbolicated stack:
    Code (JavaScript):
    1. il2cpp::vm::MetadataCache::GetMethodPointer(Il2CppImage const*, unsigned int)
    2. D:\Program Files\2020.3.38f1\Editor\Data\il2cpp\libil2cpp\vm/MetadataCache.cpp:706
    3.  
    4. il2cpp::vm::MetadataCache::Initialize()
    5. D:\Program Files\2020.3.38f1\Editor\Data\il2cpp\libil2cpp\vm/MetadataCache.cpp:211
    6.  
    7. il2cpp::vm::Runtime::Init(char const*)
    8. D:\Program Files\2020.3.38f1\Editor\Data\il2cpp\libil2cpp\vm/Runtime.cpp:159
    9.  
    10. il2cpp_init
    11. D:\Program Files\2020.3.38f1\Editor\Data\il2cpp\libil2cpp/il2cpp-api.cpp:97
    12.  
    13. InitializeIl2CppFromMain(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, int, char const**, bool)
    14. ??:?
    15.  
    16. UnityInitApplication()
    17. ??:?
    18.  
    19. UnityPlayerLoop()
    20. ??:?
    21.  
    22. nativeRender(_JNIEnv*, _jobject*)
    23. ??:?
    24.  
    Function where null ref happened:
    Code (CSharp):
    1. Il2CppMethodPointer il2cpp::vm::MetadataCache::GetMethodPointer(const Il2CppImage* image, uint32_t token)
    2. {
    3.     uint32_t rid = GetTokenRowId(token);
    4.     uint32_t table =  GetTokenType(token);
    5.     if (rid == 0)
    6.         return NULL;
    7.  
    8.     IL2CPP_ASSERT(rid <= image->codeGenModule->methodPointerCount);
    9.  
    10.     return image->codeGenModule->methodPointers[rid - 1];
    11. }
    12.  
    Line 706 is the
    return image->codeGenModule->methodPointers[rid - 1];
    line.