Search Unity

Bug IL2CPP - Crash - Debug Assertion index < kMaxThreadStaticSlots

Discussion in 'Scripting' started by strich, Mar 25, 2023.

  1. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    374
    We're trying to build our game for platforms that use IL2CPP (consoles, OSX, etc) and we're finding that even on Windows IL2CPP we get a crash when we try to enter a level in our game. The application does successfully get to our main menu however.

    I have spent quite awhile trying to debug this but I have run out of information to investigation any further at this point, and need help.

    Unity 2022.2.10f1
    Windows IL2CPP

    upload_2023-3-25_14-47-45.png

    Stack trace:
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF814E6D379)
    0x00007FF814E6D379 (UnityPlayer) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF814E74DF1)
    0x00007FF814E74DF1 (UnityPlayer) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF814E70F9A)
    0x00007FF814E70F9A (UnityPlayer) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF8152602C6)
    0x00007FF8152602C6 (UnityPlayer) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF81525FEBC)
    0x00007FF81525FEBC (UnityPlayer) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF8152605F6)
    0x00007FF8152605F6 (UnityPlayer) (function-name not available)
    0x00007FF8110AC056 (GameAssembly) [C:\Program Files\Unity\Hub\Editor\2022.2.10f1\Editor\Data\il2cpp\libil2cpp\vm\Thread.cpp:158] il2cpp::vm::Thread::InitializeManagedThread
    0x00007FF8110ADAE9 (GameAssembly) [C:\Program Files\Unity\Hub\Editor\2022.2.10f1\Editor\Data\il2cpp\libil2cpp\vm\Thread.cpp:688] il2cpp::vm::ThreadStart
    0x00007FF8110A71C9 (GameAssembly) [C:\Program Files\Unity\Hub\Editor\2022.2.10f1\Editor\Data\il2cpp\libil2cpp\os\Thread.cpp:202] il2cpp::eek:s::Thread::RunWrapper
    0x00007FF81104F6C3 (GameAssembly) [C:\Program Files\Unity\Hub\Editor\2022.2.10f1\Editor\Data\il2cpp\libil2cpp\os\Win32\ThreadImpl.cpp:28] il2cpp::eek:s::ThreadStartWrapper
    0x00007FF9535C26BD (KERNEL32) BaseThreadInitThunk
    0x00007FF95482A9F8 (ntdll) RtlUserThreadStart
     
  2. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    374
    For anyone out there hitting this issue - I've managed to resolve it by doing the following:
    1. Build the project with "Create Visual Studio solution" so you can access the C++ files.
    2. Open the VS project and change kMaxThreadStaticSlots in Thread.cpp from 2048 to 4096.
    3. Build.

    This resolves the error and the game runs.