Search Unity

After upgrading to unity 4.5, windows build hangs with no error?

Discussion in 'Windows' started by Gnimmel, Jun 27, 2014.

  1. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    I recently upgraded from unity 4.3 to 4.5 and am now experiencing problems building to windows phone. The game builds and runs fine, but since the upgrade it now hangs at random times. Some times it's seconds after starting the game and other times it could take half an hour.

    Visual studio gives me no error once this happens, but while playing I get these errors every now and then;

    The thread 0xccc has exited with code 259 (0x103).
    The thread 0xfa8 has exited with code 259 (0x103).
    The thread 0x16e8 has exited with code 259 (0x103).

    Actually, I still get them after the hang. The game stops responding on the phone, but if I leave it the above errors still keep coming up.

    I stupidly didn't back up the project before the upgrade (actually I did, but before noticing the problems I backed up again over the old version) and now it wont build on unity 4.3.

    Any advise on this would be great, I'm at a loss at how to solve the issue, although considering it seemed to work fine on 4.3, it could be a new 4.5 bug?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Hi, could you post the player log when it hangs?
     
  3. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    Thanks for the reply. I just ran the game again until it hangs, stopped the debugger and grabbed the player log (pasted below).
    There doesn't seem to be any errors at the "crash" and I'm not sure the game actually stops running, By hangs, I mean the game is frozen, the screen still displays the game, but nothing moves, no input etc, so more like it's stuck in an endless loop.
    I haven't really changed any of the main code since the upgrade to 4.5, but I have added a few more particles as well as the fog shader posted on this site to get around the windows phone fog bug. Not sure if it's the particle system causing the problems.

    You'll have to ignore my debug logs, probably should have disabled them before building.

    Build from 'release/4.5/release' branch, version is '4.5.1f3 (73cd57f80e3e)' (Release build).
    Physical memory: 1912 MB, commited memory limit: 570 MB.
    PlayerConnection initialized from C:/Data/Programs/{529C619F-DCC0-4E11-84F4-7E990145A8C1}/Install/Data (debug = 0)
    PlayerConnection initialized network socket : 0.0.0.0 55113
    Multi-casting "[IP] 10.13.34.224 [Port] 55113 [Flags] 2 [Guid] 789796784 [EditorId] 927660040 [Version] 1048832 [Id] WP8Player(192.168.1.12) [Debug] 0" to [225.0.0.222:54997]...
    Direct3D:
    Version: Direct3D 11.0 [level 9.3]
    Renderer: Qualcomm Adreno 330 (WDDM v1.2) (ID=0x46363432)
    Vendor: Qualcomm
    VRAM: 350 MB
    Initialize engine version: 4.5.1f3 (73cd57f80e3e)
    The referenced script on this Behaviour is missing!

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Mono/MonoBehaviour.cpp Line: 1633)

    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?

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Serialize/SerializedFile.cpp Line: 1170)

    The referenced script on this Behaviour is missing!

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Mono/MonoBehaviour.cpp Line: 1633)

    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?

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Serialize/SerializedFile.cpp Line: 1170)

    The referenced script on this Behaviour is missing!

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Mono/MonoBehaviour.cpp Line: 1633)

    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?

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Serialize/SerializedFile.cpp Line: 1170)

    The referenced script on this Behaviour is missing!

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Mono/MonoBehaviour.cpp Line: 1633)

    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?

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Serialize/SerializedFile.cpp Line: 1170)

    The referenced script on this Behaviour is missing!

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Mono/MonoBehaviour.cpp Line: 1633)

    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?

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/Runtime/Serialize/SerializedFile.cpp Line: 1170)

    UnloadTime: 5.517760 ms
    Unloading 7 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

    Unloading 3 unused Assets to reduce memory usage. Loaded Objects now: 3006. Operation took 74.998802 ms.
    System memory in use: 8.8 MB.
    Player start

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Spawned EnemyAI

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Spawned EnemyAI

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Spawned EnemyAI

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Active Attack Menu = 2

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Stamina usage number = 2

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Stamina value 0 = 20

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Hello death script

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Spawned EnemyAI

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Spawned EnemyAI

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Spawned EnemyAI

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Active Attack Menu = 2

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Stamina usage number = 2

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Stamina value 0 = 20

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Played - AttackB_Turn_LE_90_copy

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Hello death script

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Spawned EnemyAI

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)

    Spawned EnemyAI

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp Line: 55)
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Okay, there indeed isn't anything useful in it.

    Have you tried pausing execution with VS after the hang and looking at the stack trace of all threads? It may tell you where it hangs exactly. You can do it in parallel stacks window, which can be found at Debug -> Windows -> Parallel Stacks.
     
  5. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    I don't see a Parallel Stacks option in the debug -> windows drop down? It's not there while the game is running, paused or crashed.

    Sorry, before these problems I had never even opened visual studio (2012 if it makes a difference) as I had no reason too, meaning I'm a little lost with this problem.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
  7. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    Here is my view. I see you have a few more options than I do. If it makes a difference I'm using 2012 express. Are there any other options I might have changed?

    To double check this is a new unity 4.5 problem and not something I missed in the past, I made a build in unity 4.3 of a older back up (about 2 weeks ago, so fairly recent) and tried to crash it. After hours of testing it, no crashes so far, The 4.5 version would have crashed a few times by now.

    This version doesn't have the particles or fog shader, so I will add those and test again in 4.3.

     

    Attached Files:

  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Alright, it may be that the parallel stacks window is not available on the express editions. Anyway, you can still inspect the stack trace of different threads using "Call stack" window and threads window to switch between different threads.
     
  9. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    Thanks for the reply on a weekend, hope you are getting over time ;)

    I will try that a little latter today.

    For now though, I've installed unity 4.3 as well as 4.5 and gone back to an older back up of my game which loads in 4.3. To start with I created a build on my phone with 4.3 and tested it for an hour with no crashes.

    I then duplicated the project folder, loaded it in 4.5 and made a build on my phone. It crashed multiple times after just a few minutes.

    I've since started to add back in my latest scripts and particles to bring my older back up closer to the latest version. So far no crashes on 4.3, but lots on 4.5.

    From these tests it's definitely the upgrade from 4.3 to 4.5 that is causes my crashes, well I'm at least 99% sure it is.

    Would it be better at this point to make a smaller test project and submit a bug? With my limited knowledge and visual studio express (not the full version), it could take a while to work out whats wrong my end.
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Sure. Sounds like something happened at our end.

    Just to try something: could you try starting the game directly from the phone, rather than from Visual Studio to see whether it behaves the same way?
     
  11. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    It behaves the same if I build and run from unity, or just build it and then run from visual studio.

    I just made a smaller test project by deleting most of the game and have submitted a bug report. The test version I made was originally in 4.3 which I couldn't get to crash after about an hour of testing (running in circles for an hour is really boring), but as soon as I built it with 4.5, it froze up after about 30 seconds of play. The second test on 4.5 took about 4 minutes to crash doing the same thing, simply running around the level.

    The case number is 616560.

    Thanks again for the help so far.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Thanks! We'll take a look.
     
  13. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    Just wondering if there is an update to this?

    The last I heard the project in the bug report couldn't be complied and I uploaded a new zip file with the project.

    I can safely say it's a 4.5 issue now as I haven't had any crashes at all since going back to 4.3.
     
  14. Catman

    Catman

    Joined:
    Jul 16, 2011
    Posts:
    47
    I am having a similar problem with Unity 4.5. The Webplayer works fine, but a Windows build crashes.
    I managed to make it work by removing some variables in a script, and reintroducing them one after the other. After I figured out which the culript was, I renamed it and it worked once, then any further modification to anything else would make it crash again.

    It seems to me that the problem may be with the serialization, as the variables I am referring to are intercepted by a custom inspector. Here is the example script:


    Code (CSharp):
    1.  
    2. [CustomEditor (typeof(Meshes3DPhysicalMapBehaviour))]
    3. public class Meshes3DPhysicalMapBehaviourInterface : PhysicalMapBehaviourInterface {
    4.    
    5.     SerializedObject m_Object;
    6.    
    7.     void OnEnable () {
    8.         m_Object = new SerializedObject (target);
    9.     }
    10.    
    11.     public override void OnInspectorGUI() {
    12.         base.OnInspectorGUI();  
    13.        
    14.        
    15.         Meshes3DPhysicalMapBehaviour t = (Meshes3DPhysicalMapBehaviour)target;
    16.         bool usingManualSizes = t.manualTileSizes;
    17.  
    18.         m_Object.Update ();    // NOTE: Cannot use any FloatField, or accessing t, after this, because we just serialized it, or it will crash when building the standalone application!
    19.  
    20.         if (g.multiStorey) EditorGUILayout.PropertyField(m_Object.FindProperty("storeySeparation"),true);
    21.         EditorGUILayout.PropertyField(m_Object.FindProperty("manualTileSizes"),true);
    22.         if (usingManualSizes) {
    23.             EditorGUILayout.PropertyField(m_Object.FindProperty("tileSize"),true);
    24.             EditorGUILayout.PropertyField(m_Object.FindProperty("columnSize"),true);
    25.             EditorGUILayout.PropertyField(m_Object.FindProperty("wallSize"),true);
    26.         }
    27.  
    28.         if (i.addCeilingToCorridors) {
    29.             EditorGUILayout.PropertyField(m_Object.FindProperty("corridorCeilingVariations"),true);
    30.         }
    31.         if(g.createRooms){
    32.             if (i.addCeilingToRooms) {
    33.                 EditorGUILayout.PropertyField(m_Object.FindProperty("roomCeilingVariations"),true);
    34.             }
    35.         }
    36.  
    37.         if (g.multiStorey){
    38.             EditorGUILayout.PropertyField(m_Object.FindProperty("ladderVariations"),true);
    39.             EditorGUILayout.PropertyField(m_Object.FindProperty("ladder2Variations"),true);
    40.         }
    41.        
    42.         base.DrawSpecificInspector(m_Object);
    43.         m_Object.ApplyModifiedProperties ();
    44.        
    45.         if (GUI.changed) EditorUtility.SetDirty(t);
    46.     }
    47.    
    48. }
    49.  
     
  15. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    I'm sorry to hear you are having problems too, although at the moment I'm not using any serialization.

    QA got back to me this morning and have managed to reproduce my problem. Its looking like its with unity's path finding so our crashes might not be related.
     
  16. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

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

    I've just looked into your bug. Looks like it hangs on NavMesh.CalculatePath, when you pass infinite vector as the target position. To avoid such situation, check the return value of NavMesh.SamplePosition, which will tell you whether it is successful, and if not, you shouldn't call NavMesh.CalculatePath with its return parameters.
     
  17. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    Thanks a lot for the reply.
    That sounds like an easy fix my end, but strange I didn't get a crash on any version before 4.5. I'll have to take a look at the change log and see if anything was updated to the navmeshes between versions.

    Thanks again