Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Windows exe freezes when pressing Alt+F4 in IL2CPP

Discussion in 'Scripting' started by hardcodednumber, Aug 10, 2018.

  1. hardcodednumber

    hardcodednumber

    Joined:
    May 26, 2014
    Posts:
    34
    I set my project to using: .Net 4.x, IL2CPP, and .NET Standard 2.0. When I make a build and try to quit the game at any point via ALT + F4, the game immediately freezes.

    After I added the following code from IssueTracker:
    Code (CSharp):
    1.         private void OnApplicationQuit()
    2.         {
    3.             if (!Application.isEditor) {
    4.                 System.Diagnostics.Process.GetCurrentProcess().Kill();
    5.             }
    6.         }
    I was able to get the game to crash and generate a crash dump, output log, and error log. When I look at the stack trace, it seems like the game is throwing an exception in Socket.cpp. All the C# sockets that we use haven't been opened or already closed at the point of the crash. Here is the Socket.cpp lines
    Code (cpp):
    1.  
    2.     int32_t Socket::IOControl_internal(intptr_t sock, int32_t ioctl_code, Il2CppArray* input, Il2CppArray* output, int32_t* error)
    3.     {
    4.         IL2CPP_NOT_IMPLEMENTED_ICALL(Socket::IOControl_internal);
    5.         IL2CPP_UNREACHABLE;
    6.         return 0;
    7.     }
    This problem was an issue in 2018.1.3f1, I upgraded to 2018.2.2f1 in hopes of solving the issue. It still seems to be occurring. Anyone else have a workaround or a solution to this problem?
     

    Attached Files:

  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,512
    This issue will be corrected in 2018.2.4f1, which should be out soon.
     
    BlackPete likes this.
  3. hardcodednumber

    hardcodednumber

    Joined:
    May 26, 2014
    Posts:
    34
  4. michael_house

    michael_house

    Joined:
    May 24, 2013
    Posts:
    15
    @JoshPeterson Is there a workaround? I'm using 2018.1.0f2 and seeing this same issue.
     
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,512
    Unfortunately we don't have a work around for this issue. You may need to update to a newer version of Unity to correct it.
     
  6. massiveminiteam

    massiveminiteam

    Joined:
    Aug 28, 2018
    Posts:
    5
    @JoshPeterson We have the same problem with Unity 2018.3.2f1. The game crashes when you hit Alt + F4 or if you call Application.Quit(). All of this works fine if we switch back to Mono. Sadly I can't reproduce the crash in an empty project, but we are not doing any special things (like custom threading) in our project which could cause that.
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,512
    This specific issue should have been corrected in the in initial 2018.3 release, so maybe you are experiencing something with a slightly different cause. Can you submit a bug report with a project that reproduces this issue?
     
  8. massiveminiteam

    massiveminiteam

    Joined:
    Aug 28, 2018
    Posts:
    5
    The crash only happens in our project which is to big for bug reporting. I'll try to shrink the project for uploading.
     
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,512
    Thanks! Do you happen to have a call stack or a crash dump available for the crash?
     
  10. massiveminiteam

    massiveminiteam

    Joined:
    Aug 28, 2018
    Posts:
    5
    The stack trace:

    Code (CSharp):
    1.  
    2. ========== OUTPUTTING STACK TRACE ==================
    3.  
    4.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFE19B5E322)
    5. 0x00007FFE19B5E322 (UnityPlayer) (function-name not available)
    6.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFE19B911F1)
    7. 0x00007FFE19B911F1 (UnityPlayer) (function-name not available)
    8.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFE19B94207)
    9. 0x00007FFE19B94207 (UnityPlayer) (function-name not available)
    10.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFE19B94A5E)
    11. 0x00007FFE19B94A5E (UnityPlayer) (function-name not available)
    12.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFE19B93CB2)
    13. 0x00007FFE19B93CB2 (UnityPlayer) (function-name not available)
    14.   ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFE19B93F51)
    15. 0x00007FFE19B93F51 (UnityPlayer) (function-name not available)
    16. 0x00007FFE1AC062B5 (UnityPlayer) UnityMain
    17. 0x00007FFE1AC05D84 (UnityPlayer) UnityMain
    18. 0x00007FFE1A72A495 (UnityPlayer) UnityMain
    19. 0x00007FFE1A7EAF4A (UnityPlayer) UnityMain
    20. 0x00007FFE05B5D78B (GameAssembly) [c:\dev\spitlings\temp\stagingarea\data\il2cppoutput\bulk_unityengine.coremodule_0.cpp:32068] Logger_LogException_m362D3434D3B275B0B98E434BFBFBF52C76BBC9C3
    21. 0x00007FFE05B593BB (GameAssembly) [c:\dev\spitlings\temp\stagingarea\data\il2cppoutput\bulk_unityengine.coremodule_0.cpp:23997] Debug_LogException_mBAA6702C240E37B2A834AA74E4FDC15A3A5589A9
    22. 0x00007FFE05BA4200 (GameAssembly) [c:\dev\spitlings\temp\stagingarea\data\il2cppoutput\bulk_mscorlib_1.cpp:16970] KeyGeneratedEventHandler_Invoke_m169219C2CA206096D4F618C02D7D37E181A08045
    23. 0x00007FFE05A1ACDC (GameAssembly) [c:\dev\spitlings\temp\stagingarea\data\il2cppoutput\il2cppinvokertable.cpp:32722] RuntimeInvoker_TrueVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017_VoidU2A_t3A9D5EB5A83DC9C93DF2C4D6EA67B0F5E885889A_VoidU2A_t3A9D5EB5A83DC9C93DF2C4D6EA67B0F5E885889A
    24. 0x00007FFE05976FC2 (GameAssembly) [c:\program files\unity\hub\editor\2018.3.2f1\editor\data\il2cpp\libil2cpp\vm\runtime.cpp:531] il2cpp::vm::Runtime::Invoke
    25. 0x00007FFE05975C15 (GameAssembly) [c:\program files\unity\hub\editor\2018.3.2f1\editor\data\il2cpp\libil2cpp\vm\runtime.cpp:773] il2cpp::vm::Runtime::CallUnhandledExceptionDelegate
    26. 0x00007FFE05977AC7 (GameAssembly) [c:\program files\unity\hub\editor\2018.3.2f1\editor\data\il2cpp\libil2cpp\vm\runtime.cpp:632] il2cpp::vm::Runtime::UnhandledException
    27. 0x00007FFE059991CE (GameAssembly) [c:\program files\unity\hub\editor\2018.3.2f1\editor\data\il2cpp\libil2cpp\icalls\mscorlib\system.threading\thread.cpp:161] il2cpp::icalls::mscorlib::System::Threading::ThreadStart
    28. 0x00007FFE059B1F8D (GameAssembly) [c:\program files\unity\hub\editor\2018.3.2f1\editor\data\il2cpp\libil2cpp\os\thread.cpp:171] il2cpp::os::Thread::RunWrapper
    29. 0x00007FFE059A7CC3 (GameAssembly) [c:\program files\unity\hub\editor\2018.3.2f1\editor\data\il2cpp\libil2cpp\os\win32\threadimpl.cpp:28] il2cpp::os::ThreadStartWrapper
    30. 0x00007FFE66967E94 (KERNEL32) BaseThreadInitThunk
    31. 0x00007FFE66B2A251 (ntdll) RtlUserThreadStart
    32.  
    33. ========== END OF STACKTRACE ===========
    34.  
    35.  
     
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,512
    Thanks! This does look different from the original cause reported in this forum thread, so if you can reduce it to a project which you can submit with a bug report, we would appreciate it!
     
  12. massiveminiteam

    massiveminiteam

    Joined:
    Aug 28, 2018
    Posts:
    5
    @JoshPeterson We think we found the piece of code which is responsible for the crash, but we are unable to recreate this crash in an empty project with this code. We think it has something to do with some thread and external library calls with pointers from the plugin InControl. When we disable a few options the player doesn't crash.

    It's working for us now, but we will submit a bug report when we were able to recreate the bug within an empty project.
     
    JoshPeterson likes this.