Search Unity

UWP MasterWithLTCG build crash my game

Discussion in 'Windows' started by Wadjey, Sep 3, 2020.

  1. Wadjey

    Wadjey

    Joined:
    Feb 4, 2015
    Posts:
    244
    Hi,
    When I build my gamed with Master config (IL2CPP generated solution), it runs without any problem, but when I build it with the MasterWithLTCG my game crash as soon as it start!

    Any help how I can debug it and find what's causing this issue?

    In the VS output window there only these lines:
    Code (CSharp):
    1. 'MyGame.exe' (Win32): Loaded 'D:\Projects\SuperGame\MyGame\Builds\UWP20194IL2CPP\build\bin\x64\MasterWithLTCG\AppX\MyGame.exe'. Symbols loaded.
    2. 'MyGame.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
    3. 'MyGame.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
    4. 'MyGame.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
    5. 'MyGame.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'.
    6. 'MyGame.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'.
    7. 'MyGame.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'.
    8. The thread 0x87f4 has exited with code -1073741521 (0xc000012f).
    9. The thread 0xb0b4 has exited with code -1073741521 (0xc000012f).
    10. The program '[12248] MyGame.exe' has exited with code -1073741521 (0xc000012f).
    I'm building my game with Unity 2019.4.9f1 and VS2019.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    That is bizarre! 0xc000012f is STATUS_INVALID_IMAGE_NOT_MZ, which I don't quite understand how that could happen.

    Can you enable loader snaps, run the game again and paste the output here (from the same place you pasted this output)? To enable it, run this command from an admin command prompt:

    Code (csharp):
    1. gflags.exe -i "MyGame.exe" +sls
    gflags.exe is part of debugging tools for windows, which comes with Windows SDK. On my machine, it's in this folder: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64. If it's not present on your machine, you can install it by installing Windows SDK from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/ and making sure "Debugging Tools of Windows" component is checked.

    Once you're done, make sure to disable loader snaps since it will slow down your game considerably:

    Code (csharp):
    1. gflags.exe -i "MyGame.exe" -sls