Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Debugging an issue

Discussion in 'Windows' started by FREEZX, Sep 7, 2013.

  1. FREEZX

    FREEZX

    Joined:
    Apr 2, 2013
    Posts:
    64
    Hi everyone
    i'm at the end of my nerves trying to debug an issue i'm having.
    Neither the visual studio nor the isolated storage can direct me towards the problem.

    The game starts and runs fine but after coming back to the xaml menu and trying to start up the level again the game crashes.

    Here's how i load the level:

    Code (csharp):
    1.  
    2. if (new Random().Next(0, 2) > 0)
    3.                     LevelManagement.nextLevel = "Level";
    4.                 else
    5.                     LevelManagement.nextLevel = "Level2";
    6.  
    7.                 if (MainPage.IsLoaded)
    8.                 {
    9.                     UnityApp.BeginInvoke(() => LevelManagement.LoadLevel("Loading"));
    10.                 }
    11.                 NavigationService.Navigate( new Uri( "/MainPage.xaml", UriKind.Relative ) );
    So basically what this should do is load the game from start (loading is the first level loaded because it's the first level listed in build settings) the first time and the second time explicitly load the level named loading

    The Visual studio output:
    Code (csharp):
    1.  
    2.  
    3. EXITED FROM PAUSE
    4. True
    5. Level: 1
    6. The program '[3924] TaskHost.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
    7.  
    8.  

    Also the UnityPlayer.log
    Code (csharp):
    1.  
    2. Build from '' branch, version is '4.2.0f4 (38efbd14869d)' (Release build).
    3. Physical memory: 898 MB, commited memory limit: 380 MB.
    4. PlayerConnection initialized from C:/Data/Programs/{30900437-510C-442C-AF04-822815B0C5D0}/Install/Data (debug = 0)
    5. PlayerConnection initialized network socket : 0.0.0.0 55062
    6. Multi-casting "[IP] 127.0.0.1 [Port] 55062 [Flags] 2 [Guid] 16711253 [EditorId] 2246646999 [Version] 1048832 [Id] WP8Player(0.0.0.0) [Debug] 0" to [225.0.0.222:54997]...
    7. Direct3D:
    8.     Version:  Direct3D 11.0 [level 9.3]
    9.     Renderer: Qualcomm Adreno 225 (WDDM v1.2) (ID=0x32303032)
    10.     Vendor:   Qualcomm
    11.     VRAM:     96 MB
    12. Initialize engine version: 4.2.0f4 (38efbd14869d)
    13. Changed Orientation to: LandscapeLeft
    14.  
    15. (Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/WP8Support/UnityEngineDebug.cpp Line: 63)
    16.  
    17. BaseObject: NotAvailableDuringDebugging
    18.  
    19. (Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/WP8Support/UnityEngineDebug.cpp Line: 63)
    20.  
    21. Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    22.  
    23. Unloading 3 unused Assets to reduce memory usage. Loaded Objects now: 285. Operation took 69.035263 ms.
    24. System memory in use: 2.2 MB.
    25. UnloadTime: 2.454666 ms
    26.  
    27. Unloading 13 unused Assets to reduce memory usage. Loaded Objects now: 13879. Operation took 658.736145 ms.
    28. System memory in use: 35.1 MB.
    29. UnloadTime: 407.508881 ms
    30.  
    31.  
    32. Unloading 398 unused Assets to reduce memory usage. Loaded Objects now: 13936. Operation took 942.062073 ms.
    33. System memory in use: 35.3 MB.
    34.  
    35. Direct3D:
    36.     Version:  Direct3D 11.0 [level 9.3]
    37.     Renderer: Qualcomm Adreno 225 (WDDM v1.2) (ID=0x32303032)
    38.     Vendor:   Qualcomm
    39.     VRAM:     96 MB
    40.  
    41.  
    Can anyone point me to the right direction on how i should debug this?
    Is it perhaps using too much memory the second time it loads?
    My unity version is 4.2.0f4

    Thanks in advance
     
  2. FREEZX

    FREEZX

    Joined:
    Apr 2, 2013
    Posts:
    64
    I traced the problem down to this line
    Code (csharp):
    1.  
    2. UnityApp.BeginInvoke(() => LevelManagement.LoadLevel("Loading"));
    3.  
    Where the app stops
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,718
    Looks like you're initializing Unity twice in the exported project. You shouldn't do that and it will not work.
     
  4. FREEZX

    FREEZX

    Joined:
    Apr 2, 2013
    Posts:
    64
    Thanks for the input.

    If i call UnityApp.Pause somewhere, i cannot find a way to unpause app accordingly and i'm not able to call unity functions while it's paused.
    Instead i tried using Obscure and Unobscure and it works so far. Not sure about the drawbacks tho.
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,718
    Obscure and unobscure are the correct functions to use. You shouldn't touch pause :).