Search Unity

Random crashes with WP8.0 & WP8.1 & Unity 4.5.4

Discussion in 'Windows' started by mpulkkinen, Sep 22, 2014.

  1. mpulkkinen

    mpulkkinen

    Joined:
    Apr 8, 2013
    Posts:
    15
    Hi,

    We've been experiencing random crashes with our project for a some time now and made a automated test to get some info about it:
    Exception: Incorrect hashcode
    Type: System.Exception
    Module:
    InnerException: <No Data>
    AdditionalInfo:<No Data>

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Scripting/WinRTUtility.cpp Line: 88)


    First-chance exception at 0x0844E5FD in TaskHost.exe: 0xC0000005: Access violation writing location 0x00000008.
    First-chance exception at 0x775135D7 (KERNELBASE.DLL) in TaskHost.exe: 0xC0000005: Access violation writing location 0x00000008.
    First-chance exception at 0x775135D7 (KERNELBASE.DLL) in TaskHost.exe: 0x40080201: WinRT originate error (parameters: 0x80004003, 0x000000CF, 0x0920DD10).
    First-chance exception at 0x775135D7 in TaskHost.exe: Microsoft C++ exception: Platform::NullReferenceException ^ at memory location 0x0920F474. HRESULT:0x80004003 Invalid pointer
    WinRT information: System.NullReferenceException: Object reference not set to an instance of an object.
    at WinRTBridge.UnityEngineObjectTools.ScriptingObjectSetReferenceDataCachedPtrGC(Int64 objectWrapper, Int32 cachedPtr)

    Automated test does nothing more than simulate user pressing "to main menu"-button and "go to mission" buttons. These crashes are seen also during normal gameplay, not just automated tests. Somethimes test run over 100 times wihtout crash, sometimes it crashes with under 10 runs...

    Is there something that can be done to this bug? We've gone thru all our code, remover GC.Collect calls & anything suspicious and nothing seems to work... We load our scenes with LoadAsync & sometimes with just Load, both ways the crash is reproducible...
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,676
    Hi,

    did you report the bug to us? :)
     
  3. mpulkkinen

    mpulkkinen

    Joined:
    Apr 8, 2013
    Posts:
    15
    Well I did now, thought I as here first... At may start to seem that Resources.UnloadUnusedAssets(); might be causing this, because after removing calls to that function ( called always after new scene has loaded / next one loading ), I noticed that there's no more "unloading -2 unused assets" debug's anymore...
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    Yes, that could cause it. You can prevent object destruction by calling this:
    http://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html
     
  5. mpulkkinen

    mpulkkinen

    Joined:
    Apr 8, 2013
    Posts:
    15
    Hmm, but the exceptions don't come our code / doesn't trigger to anything at all, so I know it's not a null ref or anything that we are trying to access...
     
  6. BugKiller

    BugKiller

    Joined:
    May 8, 2014
    Posts:
    23
    Hi, i am having exactly the same exception. Sometimes it appears as soon as the game starts and other times after the first or second level, I can't understand what is throwing this exception:

    Exception: Incorrect hashcode
    Type: System.Exception
    Module:
    InnerException: <No Data>
    AdditionalInfo:<No Data>

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Scripting/WinRTUtility.cpp Line: 88)


    A first chance exception of type 'System.NullReferenceException' occurred in WinRTBridge.DLL
    The thread 0xc40 has exited with code 0 (0x0).

    Hope you have a clue on what it is causing this.

    Thanks
     
  7. mpulkkinen

    mpulkkinen

    Joined:
    Apr 8, 2013
    Posts:
    15
    Nope, sorry, I don't have a clue yet. Only clue I have is that if happens right after Application.LoadLevel or LoadLevelAsync... I'm currently trying to build a test scene for guys in Unity but because the automated test runs quite slow ( we have quita a big scenes, that it is opening and loseing etc ), confirming the build that produces the error is slow...

    This error reproduces very randomly, sometimes in first run, sometimes in 10th run, and sometimes I've been running up to 177 automated test runs untill the errors comes up...
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,676
    I forgot to ask - which Unity version are you running?

    Looks like you have a pretty solid repro in your case - could you submit a bug report with it attached?

    This is definitely a bug in our runtime. The error message is actually a failed assert, but since it's pretty critical, it soon produces a crash after.
     
  9. mpulkkinen

    mpulkkinen

    Joined:
    Apr 8, 2013
    Posts:
    15
    I already wrote an error, case 634978, but I'm still trying to make a reasonable sized project to send with the error. Does wp8 visual studio project do any good? I was able to sqeeze it to ~170mb without players ( with players, 700mb)
     
  10. BugKiller

    BugKiller

    Joined:
    May 8, 2014
    Posts:
    23
    I am using Unity 5.3.3f3 and I already submitted a bug report with the number 635202. I am going to reply to the automatic answer with the full log from the console, it might help you.
    Just realized now there is the 4.5.4 version, I am downloading it now and need to check if the exception still happens after the update. Thanks for the answers
     
    Last edited: Sep 23, 2014
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,676
    It certainly would be better than nothing, but it would make it much harder to investigate, as editor removes loads of information from the project when you press build.

    Is internet speed is the only issue? Our bug reporter supports huge files, so you should be able to attach whatever you want.
     
  12. BugKiller

    BugKiller

    Joined:
    May 8, 2014
    Posts:
    23
    After updating to Unity 4.5.4 and VS2013 update 3 the bug disappeared. I tried some levels and create several builds and so far so good.
    mpulkkinen I suggest you update everything, it might work for you as well.

    Thanks.
     
  13. mpulkkinen

    mpulkkinen

    Joined:
    Apr 8, 2013
    Posts:
    15
    I also have Unity 4.5.4 & Visual studio update 3, still it reproduces... It might be that it doesn't reproduce as frequently with new update, but I can assure it does :) With yesterdays test runs, I encountered these crashes after 171, 37, 50, 57, 4, 11 and 50 runs, most lowest numbers are with Lumia 520, highest with Lumia 920
     
  14. BugKiller

    BugKiller

    Joined:
    May 8, 2014
    Posts:
    23
    Ok, thats not good and I don't have time to make a automatic test machine to over test it. thought it was solved =( If it is related to Resources.UnloadUnusedAssets() I have a big problem because I must unload unused assets to optimize the performance of the game or otherwise its impossible to run in a lot of devices.. If I have the same error again I will confirm here that it still happens. Please let me know if you find a solution..
     
  15. mpulkkinen

    mpulkkinen

    Joined:
    Apr 8, 2013
    Posts:
    15
    Well, my test set is pretty small: define flagged code that upon entering main menu, start a level thru loading screen and when the level has been loaded, level loads the main menu thru loading screen and that is looped untill the crash happens ( I'm using 5 sec Invokes between LoadLevels to give the game some time for ui to be drawn etc ). And these test are running on device...
     
  16. Tom-G

    Tom-G

    Joined:
    Jun 24, 2014
    Posts:
    7
    I have been seeing the elusive "Incorrect Hashcode" error when running in Debug or Release configurations on a Nokia Lumia 520. The error goes away if I run in 'Master' configuration in Visual Studio, or if I use a different phone. The Lumia 520 is the weakest phone tested in terms of processing power and memory.

    Nokia Lumia 520
    - 512 MB RAM
    - CPU: Dual-core 1 GHz
    - GPU: Qualcomm Adreno 305 (98MB)
    - Windows Phone 8.1

    Seen using VSE-2012 and VSE-2013, and using Unity version 4.5.3, 4.5.5, 4.5.5p5, 4.6.0f3.
     
  17. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
  18. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,676
    How consistently can you reproduce it? Is it hours versus minutes? In either case, we'd like a repro project, so we could investigate and fix it.
     
  19. Tom-G

    Tom-G

    Joined:
    Jun 24, 2014
    Posts:
    7
    I can reproduces it 90% of the time, but only on certain devices and in certain conditions. We have a project we could provide. Can you PM me to arrange a drop?
     
  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,676
    Done.
     
  21. jannis99

    jannis99

    Joined:
    Jan 27, 2014
    Posts:
    3
    I get a quite similar error with my Windows Store project (XAML C# / 8.1 , Unity 4.6.1p2) in Visual Studio Community 2013 with Update 4:

    First-chance exception at 0x75742F71 in Template.exe: Microsoft C++ exception: Platform::NullReferenceException ^ at memory location 0x0927ED1C. HRESULT:0x80004003 Invalid pointer

    WinRT information: Invalid pointer

    Stack trace:
    [External Code]
    UnityPlayer.dll!071ac460()
    UnityPlayer.dll!07929357()
    UnityPlayer.dll!07928f16()
    UnityPlayer.dll!07ccd9a2()
    UnityEngineDelegates.dll!13089e90()
    [External Code]

    If there is a handler for this exception, the program may be safely continued.


    This error occured in the Debug/x86 configuration. When I click Break and try to stop debugging I get this error:
    "Unable to stop debugging. Operation not supported. Unknown Error: 0x800400c3"


    When I run the game as Master/x86 I get this error:

    An exception of type 'System.Runtime.InteropServices.SEHException' occurred in UnityEngineProxy.DLL but was not handled in user code

    Additional information: External component has thrown an exception.


    This errors donot occur randomly, but everytime and are caused by this code:

    Code (CSharp):
    1. public void Do (Func<TSCSaveItem, ServerResult> predicates, Action<ServerResult> completionHandler)
    2.     {
    3.         ServerAttempData serverAttempData = new ServerAttempData ();
    4.         StartCoroutine(DoC(predicates, completionHandler, serverAttempData)); // < next statement to execute
    5.     }
    Code (CSharp):
    1. public IEnumerator DoC (Func<TSCSaveItem, ServerResult> predicates, Action<ServerResult> completionHandler, ServerAttempData serverAttempData)
    2. {
    3.     (...)
    4. }
    I used this code for testing the function (it is in another class and is executed directly before the error occurs):

    Code (CSharp):
    1. ServerUtilities su = new ServerUtilities();
    2.         su.Do( i =>
    3.         {
    4.             return new ServerResult(true, true, null);
    5.         },
    6.         r =>
    7.         {
    8.             Debug.Log("Success!");
    9.         });

    Note: I am running the game on a gaming notebook.
     
    Last edited: Dec 30, 2014
  22. timthecoder

    timthecoder

    Joined:
    Apr 27, 2013
    Posts:
    22
    I'm getting the same error. Has anyone found a solution?
     
  23. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,676
    Do you have a stacktrace?
     
  24. timthecoder

    timthecoder

    Joined:
    Apr 27, 2013
    Posts:
    22
    I was having random crashed just after I added the prime31 Windows Store plugin. I was only using it to check to see if the app was in trial mode, so I deleted the plugin and went with Unity's built in Windows Store trial check. If I run across the problem again I will post a stacktrace.
     
  25. stamenkrumov

    stamenkrumov

    Joined:
    Jun 15, 2014
    Posts:
    33
    Hi, I have the same problem with my windows phone 8.0 game. I'm using Visual Studio Community Edition 2013 Update 4 and Unity 4.5.5 f1. Do the problem still exists in Unity 4.6.3 ?

    Here's my log :

    Exception: Incorrect hashcode
    Type: System.Exception
    Module:
    InnerException: <No Data>
    AdditionalInfo:<No Data>


    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Scripting/WinRTUtility.cpp Line: 88)


    CallStack:

    > WinRTBridge.DLL!WinRTBridge.UnityEngineObjectTools.ScriptingObjectSetReferenceDataCachedPtr(object objectWrapper, int cachedPtr) Unknown
    WinRTBridge.DLL!WinRTBridge.UnityEngineObjectTools.ScriptingObjectSetReferenceDataCachedPtrGC(long objectWrapper, int cachedPtr) Unknown
     
  26. stamenkrumov

    stamenkrumov

    Joined:
    Jun 15, 2014
    Posts:
    33
    This happens with Unity 4.6.3 :

    Exception: Incorrect hashcode
    Type: System.Exception
    Module:
    InnerException: <No Data>
    AdditionalInfo:<No Data>


    (Filename: C:/buildslave/unity/build/Runtime/Scripting/WinRTUtility.cpp Line: 87)


    A first chance exception of type 'System.NullReferenceException' occurred in WinRTBridge.DLL
    The thread 0x72c has exited with code 0 (0x0).
    The thread 0x1790 has exited with code 259 (0x103).
    The thread 0x1c8 has exited with code 259 (0x103).
    The thread 0x60c has exited with code 259 (0x103).

    CallStack:
    > WinRTBridge.DLL!WinRTBridge.UnityEngineObjectTools.ScriptingObjectSetReferenceDataCachedPtr(object objectWrapper, int cachedPtr) Unknown
    WinRTBridge.DLL!WinRTBridge.UnityEngineObjectTools.ScriptingObjectSetReferenceDataCachedPtrGC(long objectWrapper, int cachedPtr) Unknown
     
  27. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905
    Could you submit a bug report with small repro attached if possible.
     
  28. codeDoc

    codeDoc

    Joined:
    Feb 12, 2014
    Posts:
    6
    I am getting the same error with Unity version 5.2.1p2 when I build the project in Master mode in Visual Studio. I am using visual studio 2015 community.Project works fine in debug mode but crashes in master mode when i try to load the game again after the game is over.VS throws the following :

    Exception thrown: 'System.NullReferenceException' in WinRTBridge.dll
    An unhandled exception of type 'System.NullReferenceException' occurred in WinRTBridge.dll

    Can anyone help me out?
     
  29. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905