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

Crash/Exception Thrown on run before any game shows (regardless of starting scene)

Discussion in 'Windows' started by Phil-AV, Jul 26, 2013.

  1. Phil-AV

    Phil-AV

    Joined:
    Jul 9, 2012
    Posts:
    57
    Hi guys, having major difficulties getting my game running on Windows 8 (local/simulator builds).
    Can anyone please help me out? I've been at this 2 days now and still no luck!

    Whenever I run my game I get the brief splash screen, a blank background for an absolute age, and then the game just crashes before anything else is shown.

    I've tried using a blank scene, which is doing exactly the same thing, it just crashes without anything showing. Funnily enough creating a whole new project, and making a scene with a couple of the actual game assets runs fine and animations play. Based on that working and the actual project not, I've checked and double checked project settings and they're identical!

    After having set the debugger to native/mixed it's breaking on _ReportUnobservedException(); which is almost definitely not going to tell me anything, and there's pretty much zero help from the output window. Here's the last part of the output window just in case anyone else can tell what's going on:

    Code (csharp):
    1.  
    2. 'Template.exe': Unloaded 'ImageAtBase0xc510000'
    3. 'Template.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Linq.Expressions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Linq.Expressions.dll'
    4. 'Template.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted DynamicMethods Assembly'
    5. 'Template.exe': Loaded 'C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Runt9e372c89#\b0e878fb8978472eb3b1fd195c79eae6\System.Runtime.InteropServices.ni.dll', Cannot find or open the PDB file.
    6. 'Template.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    7. 'Template.exe': Loaded 'C:\Users\Phil\Documents\GitHub\AngryGranRun\WinBuild\Angry Gran Run\bin\x86\Debug\AppX\UnityEngineDelegates.dll', Symbols loaded.
    8. 'Template.exe': Loaded 'ImageAtBase0xc750000', Loading disabled by Include/Exclude setting.
    9. 'Template.exe': Loaded 'ImageAtBase0xc760000', Loading disabled by Include/Exclude setting.
    10. 'Template.exe': Unloaded 'ImageAtBase0xc750000'
    11. 'Template.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Phil\Documents\GitHub\AngryGranRun\WinBuild\Angry Gran Run\bin\x86\Debug\AppX\UnityEngineDelegates.winmd'
    12. 'Template.exe': Loaded 'ImageAtBase0xd450000', Loading disabled by Include/Exclude setting.
    13. 'Template.exe': Loaded 'ImageAtBase0xd460000', Loading disabled by Include/Exclude setting.
    14. 'Template.exe': Unloaded 'ImageAtBase0xd450000'
    15. 'Template.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.ReaderWriter\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Xml.ReaderWriter.dll'
    16. 'Template.exe': Loaded 'C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xml\9ba07396ae369d010c5c3927a82ef426\System.Xml.ni.dll', Cannot find or open the PDB file.
    17. 'Template.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    18. The thread 'Win32 Thread' (0x14a0) has exited with code 0 (0x0).
    19. Long thread activation time (214 ms) for object mat_gran (Material)
    20. 'Template.exe': Loaded 'C:\Windows\SysWOW64\Windows.Devices.Sensors.dll', Cannot find or open the PDB file.
    21. 'Template.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file.
    22. 'Template.exe': Loaded 'C:\Windows\SysWOW64\userenv.dll', Cannot find or open the PDB file.
    23. 'Template.exe': Loaded 'C:\Windows\SysWOW64\profext.dll', Cannot find or open the PDB file.
    24. First-chance exception at 0x75b24b32 in Template.exe: 0x40080201: WinRT originate error.
    25. First-chance exception at 0x75b24b32 in Template.exe: 0x40080202: WinRT transform error.
    26. 'Template.exe': Loaded 'C:\Windows\SysWOW64\Windows.Globalization.dll', Cannot find or open the PDB file.
    27. First-chance exception at 0x75b24b32 in Template.exe: 0x40080201: WinRT originate error.
    28. First-chance exception at 0x75b24b32 in Template.exe: 0x40080202: WinRT transform error.
    29. Unhandled exception at 0x5a8a9ad1 (MSVCR110D.dll) in Template.exe: 0xC0000409: 0xc0000409.
    30. The program '[6572] Template.exe: Native' has exited with code -1 (0xffffffff).
    31. The program '[6572] Template.exe: Managed (v4.0.30319)' has exited with code -1 (0xffffffff).
    32.  
    Also as a side-note the blank background is a concern to me as it just shows the default users' background colour (in my case, that default murky cyan), any ideas on that part?

    While I have successfully built/run a new project already, here's my system specs/software for double-checking:
    Code (csharp):
    1.  
    2. HP-G5370uk
    3. Intel Core i3 550 @ 3.20Ghz
    4. 4096MB RAM
    5. Windows 8 64-Bit (6.2, Build 9200)
    6. Intel HD Graphics (Core i3) Driver V:8.15.10.2858
    7. Visual Studio 2012 Express For Windows 8
    8. Visual Studio 2010 Ultimate
    9. Unity Pro 4.2.0f4
    10.  
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    You might be hitting a bug.

    Try this, go to Debug->Exceptions, enable all exceptions, set debugger to mixed if you haven't done so yet

    Launch the app, skip some harmless exceptions, until you hit the one which is crashing game.

    Explore the callstack, and copy-paste it here.
     
  3. Phil-AV

    Phil-AV

    Joined:
    Jul 9, 2012
    Posts:
    57
    Ok Tomas,

    Given it a run through and I'm getting 3 seperate exception types getting thrown up (with the 3rd recurring until I stop it running). Gonna paste in all 3 (not too long) just in case they help with any further bugs or crop up for anyone else in future.

    Code (csharp):
    1.  
    2. >   UnityPlayer.dll!Windows::Devices::Sensors::ISimpleOrientationSensorStatics::GetDefault()  Line 65535    C++
    3.     UnityPlayer.dll!Windows::Devices::Sensors::SimpleOrientationSensor::GetDefault()  Line 65535    C++
    4.     UnityPlayer.dll!UnityPlayer::AppCallbacks::SetupOrientationSensorEvents()  Line 351 + 0x5 bytes C++
    5.     UnityPlayer.dll!<lambda_58bd13aaa5a2406e32a539574651243d>::operator()()  Line 581 + 0xb bytes   C++
    6.     UnityPlayer.dll!Platform::Details::__abi_FunctorCapture0<<lambda_58bd13aaa5a2406e32a539574651243d>,void>::Invoke()  Line 850 + 0xe bytes    C++
    7.     UnityPlayer.dll!UnityPlayer::AppCallbackItem::NonVInvoke()  Line 65535 + 0x4f bytes C++
    8.     UnityPlayer.dll!<lambda_c50930335e8d5ade8c41b3dc67167f87>::operator()()  Line 252 + 0xb bytes   C++
    9.     UnityPlayer.dll!Platform::Details::__abi_FunctorCapture0<<lambda_c50930335e8d5ade8c41b3dc67167f87>,void>::Invoke()  Line 850 + 0xe bytes    C++
    10.     UnityPlayer.dll!Windows::UI::Core::DispatchedHandler::Invoke()  Line 65535 + 0x4f bytes C++
    11.     UnityPlayer.dll!Windows::UI::Core::DispatchedHandler::[Windows::UI::Core::DispatchedHandler::__abi_IDelegate]::__abi_Windows_UI_Core_DispatchedHandler___abi_IDelegate____abi_Invoke()  Line 65535  C++
    12.  
    Code (csharp):
    1.  
    2. >   UnityPlayer.dll!Windows::Devices::Sensors::IAccelerometerStatics::GetDefault()  Line 65535  C++
    3.     UnityPlayer.dll!Windows::Devices::Sensors::Accelerometer::GetDefault()  Line 65535  C++
    4.     UnityPlayer.dll!MTSensorInput<Windows::Devices::Sensors::Accelerometer,Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs>::Enable()  Line 71 + 0x5 bytes  C++
    5.     UnityPlayer.dll!AccelerationInput::AccelerationInput()  Line 147 + 0x14 bytes   C++
    6.     UnityPlayer.dll!Input::GetAccelInput()  Line 209 + 0x22 bytes   C++
    7.     UnityPlayer.dll!Input::PreProcess(const Vector2f  rawPosition)  Line 198 + 0x8 bytes    C++
    8.     UnityPlayer.dll!UnityPlayer::AppCallbacks::PerformUpdateAndRender()  Line 740   C++
    9.     UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThread(void * param)  Line 106 + 0x9 bytes   C++
    10.     UnityPlayer.dll!<lambda_8d550a5fe9d551d0031ceb7da9e2dc4f>::operator()(Windows::Foundation::IAsyncAction * __formal)  Line 272 + 0x10 bytes  C++
    11.     UnityPlayer.dll!Platform::Details::__abi_FunctorCapture1<<lambda_8d550a5fe9d551d0031ceb7da9e2dc4f>,void,Windows::Foundation::IAsyncAction ^>::Invoke(Windows::Foundation::IAsyncAction * __arg0)  Line 857 + 0x12 bytes C++
    12.     UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::Invoke(Windows::Foundation::IAsyncAction * __param0)  Line 65535 + 0x53 bytes  C++
    13.     UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::[Windows::System::Threading::WorkItemHandler::__abi_IDelegate]::__abi_Windows_System_Threading_WorkItemHandler___abi_IDelegate____abi_Invoke(Windows::Foundation::IAsyncAction * __param0)  Line 65535 C++
    14.  
    Code (csharp):
    1.  
    2.     MSVCR110D.dll!Concurrency::details::_ReportUnobservedException()  Line 2455 + 0x5 bytes C++
    3. >   UnityPlayer.dll!Concurrency::details::_ExceptionHolder::~_ExceptionHolder()  Line 882 + 0x8 bytes   C++
    4.     UnityPlayer.dll!Concurrency::details::_ExceptionHolder::`scalar deleting destructor'()  + 0x16 bytes    C++
    5.     UnityPlayer.dll!std::_Ref_count_obj<Concurrency::details::_ExceptionHolder>::_Destroy()  Line 885   C++
    6.     UnityPlayer.dll!std::_Ref_count_base::_Decref()  Line 120 + 0xe bytes   C++
    7.     UnityPlayer.dll!std::_Ptr_base<Concurrency::details::_ExceptionHolder>::_Decref()  Line 347 C++
    8.     UnityPlayer.dll!std::shared_ptr<Concurrency::details::_ExceptionHolder>::~shared_ptr<Concurrency::details::_ExceptionHolder>()  Line 624    C++
    9.     UnityPlayer.dll!Concurrency::details::_Task_impl_base::~_Task_impl_base()  Line 1294 + 0x20 bytes   C++
    10.     UnityPlayer.dll!Concurrency::details::_Task_impl<Windows::Storage::Streams::IOutputStream ^>::~_Task_impl<Windows::Storage::Streams::IOutputStream ^>()  Line 1972 + 0xb bytes  C++
    11.     UnityPlayer.dll!Concurrency::details::_Task_impl<Windows::Storage::Streams::IOutputStream ^>::`scalar deleting destructor'()  + 0x16 bytes  C++
    12.     UnityPlayer.dll!std::_Ref_count_obj<Concurrency::details::_Task_impl<Windows::Storage::Streams::IOutputStream ^> >::_Destroy()  Line 884 + 0x1b bytes   C++
    13.     UnityPlayer.dll!std::_Ref_count_base::_Decref()  Line 120 + 0xe bytes   C++
    14.     UnityPlayer.dll!std::_Ptr_base<Concurrency::details::_Task_impl<Windows::Storage::Streams::IOutputStream ^> >::_Decref()  Line 347  C++
    15.     UnityPlayer.dll!std::shared_ptr<Concurrency::details::_Task_impl<Windows::Storage::Streams::IOutputStream ^> >::~shared_ptr<Concurrency::details::_Task_impl<Windows::Storage::Streams::IOutputStream ^> >()  Line 624  C++
    16.     UnityPlayer.dll!std::shared_ptr<Concurrency::details::_Task_impl<Windows::Storage::Streams::IOutputStream ^> >::reset()  Line 649   C++
    17.     UnityPlayer.dll!<lambda_ab2372499047d8ce5fede21682abe38a>::operator()(Windows::Foundation::IAsyncOperation<Windows::Storage::Streams::IOutputStream ^> * _Operation, Windows::Foundation::AsyncStatus _Status)  Line 1864   C++
    18.     UnityPlayer.dll!Platform::Details::__abi_FunctorCapture2<<lambda_ab2372499047d8ce5fede21682abe38a>,void,Windows::Foundation::IAsyncOperation<Windows::Storage::Streams::IOutputStream ^> ^,enum Windows::Foundation::AsyncStatus>::Invoke(Windows::Foundation::IAsyncOperation<Windows::Storage::Streams::IOutputStream ^> * __arg0, Windows::Foundation::AsyncStatus __arg1)  Line 864 + 0x16 bytes    C++
    19.     UnityPlayer.dll!Windows::Foundation::AsyncOperationCompletedHandler<Windows::Storage::Streams::IOutputStream ^>::Invoke(Windows::Foundation::IAsyncOperation<Windows::Storage::Streams::IOutputStream ^> * __param0, Windows::Foundation::AsyncStatus __param1)  Line 65535 + 0x57 bytes    C++
    20.     UnityPlayer.dll!?__abi_Windows_Foundation_?$AsyncOperationCompletedHandler@P$AAUIOutputStream@Streams@Storage@Windows@@___abi_IDelegate____abi_Invoke@?Q__abi_IDelegate@?$AsyncOperationCompletedHandler@P$AAUIOutputStream@Streams@Storage@Windows@@@Foundation@Windows@@234@U$AAGJP$AAU?$IAsyncOperation@P$AAUIOutputStream@Streams@Storage@Windows@@@34@W4AsyncStatus@34@@Z(Windows::Foundation::IAsyncOperation<Windows::Storage::Streams::IOutputStream ^> * __param0, Windows::Foundation::AsyncStatus __param1)  Line 65535  C++
    21.  
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Well, apparently third exception is the critical one, but I cannot say exactly from where it arises, this is the problem with these new callbacks in WinRT, it's really hard to read templated functions.

    Your best bet to submit a bug, maybe we're not handling some corner case somewhere.

    Cheers
     
  5. Phil-AV

    Phil-AV

    Joined:
    Jul 9, 2012
    Posts:
    57
    For anybody stumbling across this thread, the problem eventually got solved. On all other platforms [System.Serializable] errors are handled fine, but when you have a class marked as Serializable and there's no constructor with no parameters, it's going to break, especially so on Windows 8 devices.

    Also bear in mind that the original exceptions being thrown were from building to Windows 8 RT using Unity Pro 4.2.0f4, and I was only able to identify the bug by building to WP8 using Unity Pro 4.2.1f3, which apparently fixed a few of the original exceptions, leaving only the issue I've identified above.
     
    Last edited: Sep 5, 2013
  6. weemundo

    weemundo

    Joined:
    Jul 29, 2013
    Posts:
    4
    Can you expand on this?
    Also can you replication issue on Windows Phone 8 devices? And if the serializable issue is in fact a problem - did you submit bug report?
     
  7. Phil-AV

    Phil-AV

    Joined:
    Jul 9, 2012
    Posts:
    57
    Something like this would fail:
    Code (csharp):
    1.  
    2. [System.Serializable]
    3. public class MyClass{
    4.    public MyClass(string arg1, OtherClass arg2){
    5.       DoStuff();
    6.    }
    7. }
    8.  
    Building to Windows 8 RT would just crash with some random exception. Building to Windows Phone 8 would yield a MethodMissing exception stemming from something like 'MyClass...ctor()' which helped identify that something was looking for a default constructor with no parameters, and of course could not find it. Removing the System.Serializable attribute (which in my case was possible as I only had it there for debugging purposes) resulted in both Windows 8 RT and Windows Phone 8 builds to succeed and run correctly.

    I had originally reported this as a bug, and once I found the cause of the issue, the Unity tech guys closed the case. The issue was too small to warrant adding any extra handlers for this type of exception apparently. Can't say I blame them, they've probably got Microsoft breathing down their necks to get all WinStore features working, to get it all done within some ridiculous timeframe and all on a new platform that people haven't yet fully got to grips with yet (probably why the Windows 8 platform support in my opinion was just not ready for public release, it was about 90-95% done).
     
  8. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I think I might be running into something similar on my project. I'm having my game crash once I've deployed it on Windows 8 and try to run it. It loads the initial unity splash screen and then loads the first scene but then crashes.

    I'm using the latest version of Unity (4.3) ... do you know if this issue was fixed? I do have some usage of System.Serializable in my code. Should I try to remove that property or add a non-parameter conctructor? What is the best fix if this issue is still the case?
     
  9. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    Issues with Serializable have been resolved in upcomming 4.5, I think.
    In 4.3 it's better to avoid them.
     
  10. Waqas-Anwar

    Waqas-Anwar

    Joined:
    Feb 2, 2015
    Posts:
    26
    I am facing the similar issue i guess.
    When I export the project as Windows 8.0 project and run it using Visual studio 2013 (Update 4). The game crashes after splash screen even before loading the scene. I am using unity 4.6.4 and tried 4.6.0 as well but same issue.
    I have attached the screenshot of call Stack
    and Following is the output i can see :



    'Template.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Loading disabled by Include/Exclude setting.
    [1.514860 / 4.395828] - MonoManager::FillCommonScriptingClasses begin...
    [0.154803 / 4.550631] - MonoManager::FillCommonScriptingClasses end...
    'Template.exe' (Win32): Loaded 'E:\Repo\Win8.0\War Inc. - Modern World Combat\bin\x86\Debug\AppX\UnityEngineDelegates.dll'. Loading disabled by Include/Exclude setting.
    Logical Screen DPI is 96.00.

    [0.000059 / 6.127499] - AppCallbacks::SetupInputEvents
    [0.000329 / 6.128194] - AppCallbacks::SetupDeviceWatcherEvents
    'Template.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Windows.Devices.Sensors.dll'. Loading disabled by Include/Exclude setting.
    First-chance exception at 0x755F2F71 (KernelBase.dll) in Template.exe: 0x40080201: WinRT originate error (parameters: 0x80070490, 0x00000064, 0x04B1F044).
    First-chance exception at 0x755F2F71 (KernelBase.dll) in Template.exe: 0x40080202: WinRT transform error (parameters: 0x80070490, 0x00000000, 0x0000001D, 0x04B1F478).
    [0.056080 / 6.184632] - AppCallbacks::SetupOrientationSensorEvents
    [1.634352 / 6.184982] - Starting to load first level
    GlobalManager 'NetworkManager' is not included.

    GlobalManager 'MasterServerInterface' is not included.

    type->managedHandle

    (Filename: C:/buildslave/unity/build/Runtime/Scripting/Backend/DotNet/DotNetType.cpp Line: 11)


    Template.exe has triggered a breakpoint.
     

    Attached Files:

    Last edited: May 4, 2015
  11. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Try navigating to GetType function, and inspect variables like namezpace, name, then you'll know what type is the failing one.
     
  12. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    It looks like Assembly-CSharp.dll was not processed properly.
    Build and look into Output in VS, does it show AssemblyConverter being run?
    Check if Assembly-CSharp.dll included into project is a processed one, not the one that gets built by the project (you can use ILDasm tool for this).
     
  13. Waqas-Anwar

    Waqas-Anwar

    Joined:
    Feb 2, 2015
    Posts:
    26
    How can i do this ? As i cannot identify which namespace is this
     
  14. Waqas-Anwar

    Waqas-Anwar

    Joined:
    Feb 2, 2015
    Posts:
    26
    Yes ! It shows AssemblyConverter.
     
    Last edited: May 4, 2015
  15. Waqas-Anwar

    Waqas-Anwar

    Joined:
    Feb 2, 2015
    Posts:
    26
    I just exported my project using XAML C++ solution. It built with an error "P31 plugins require C# project to compile" but the C++ solution was built. And now when i run that C++ Solution , it runs fine.
     
  16. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    So everything is okay now?
     
  17. Waqas-Anwar

    Waqas-Anwar

    Joined:
    Feb 2, 2015
    Posts:
    26
    No ! I need the project in C# Xaml.
    For more Info : I get this error after the splash
    "A script behaviour has a different serialization layout when loading. (Read 24 bytes but expected 32 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?"
     
  18. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    Build again from Unity editor.
    Unity C# projects are for trivial code changes only (method implementation).
     
  19. Waqas-Anwar

    Waqas-Anwar

    Joined:
    Feb 2, 2015
    Posts:
    26
    I rebuilt it but it keeps crashing after splash giving me the error
    "A script behaviour has a different serialization layout when loading. (Read 24 bytes but expected 32 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?"
     
  20. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    What about rebuilding to empty folder, does it still happen? If so, please submit a bug with repro project.