Search Unity

[Compiling/Build Crash] How can I debug this kind of error?

Discussion in 'Editor & General Support' started by GameArt, May 28, 2016.

  1. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    78
    I'm having an issue where Unity randomly crashes when trying to build an executable/package on Windows. I get a crash log and a call stack- but I'm unable to diagnose what asset or issue is causing the core problem. As time has gone on, the crash has started to happen more frequently- suggesting we are adding more corrupt or bad assets.

    I have tried multiple versions of unity, including 5.3.3, and 5.3.4p6. The issue does not happen every time, I have confirmed I'm not running out of memory or any other hardware related issue. I have also tested on different computers and reproduced the crash.

    So my actual question
    Is there some way I can find out what asset Unity was processing when the crash occurred?

    Lines right before the crash
    Code (csharp):
    1. Unloading 1 Unused Serialized files (Serialized files now loaded: 0)
    2. System memory in use before: 189.6 MB.
    3. System memory in use after: 190.0 MB.
    4.  
    5. Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 4804.
    6. Total: 23.775366 ms (FindLiveObjects: 0.596807 ms CreateObjectMapping: 0.348201 ms MarkObjects: 22.809830 ms  DeleteObjects: 0.018246 ms)
    7.  
    8. Crash!!!
    9. SymInit: Symbol-SearchPath: 'E:/Program Files/Unity/Editor/Data/MonoEmbedRuntime;.;E:\Program Files (x86)\Jenkins\workspace\HotLava;E:\Program Files\Unity\Editor;C:\Windows;C:\Windows\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'SYSTEM'
    10. OS-Version: 6.1.7601 (Service Pack 1) 0x100-0x1
    11. ...etc
    Stack trace
    Code (csharp):
    1. ========== OUTPUTING STACK TRACE ==================
    2.  
    3. 0x0000000140D1C7DE (Unity) TextureSettings::Transfer<StreamedBinaryWrite<0> >
    4. 0x0000000140D2632F (Unity) StreamedBinaryWrite<0>::TransferSTLStyleArray<OffsetPtrArrayTransfer<OffsetPtr<mecanim::statemachine::ConditionConstant> > >
    5. 0x0000000140D2E116 (Unity) mecanim::statemachine::SelectorTransitionConstant::Transfer<StreamedBinaryWrite<0> >
    6. 0x0000000140D3C0FE (Unity) StreamedBinaryWrite<0>::TransferSTLStyleArray<OffsetPtrArrayTransfer<OffsetPtr<mecanim::statemachine::SelectorTransitionConstant> > >
    7. 0x0000000140D43DA7 (Unity) mecanim::statemachine::SelectorStateConstant::Transfer<StreamedBinaryWrite<0> >
    8. 0x0000000140D4A26C (Unity) StreamedBinaryWrite<0>::TransferSTLStyleArray<OffsetPtrArrayTransfer<OffsetPtr<mecanim::statemachine::SelectorStateConstant> > >
    9. 0x0000000140D5421D (Unity) mecanim::statemachine::StateMachineConstant::Transfer<StreamedBinaryWrite<0> >
    10. 0x0000000140D56EA9 (Unity) StreamedBinaryWrite<0>::TransferSTLStyleArray<OffsetPtrArrayTransfer<OffsetPtr<mecanim::statemachine::StateMachineConstant> > >
    11. 0x0000000140D580E2 (Unity) mecanim::animation::ControllerConstant::Transfer<StreamedBinaryWrite<0> >
    12. 0x0000000140D5D307 (Unity) AnimatorController::TransferRuntimeData<StreamedBinaryWrite<0> >
    13. 0x00000001405225B7 (Unity) SerializedFile::WriteObject
    14. 0x0000000140514A1B (Unity) PersistentManager::WriteFileInternal
    15. 0x00000001409C544D (Unity) WriteSharedAssetFile
    16. 0x00000001409C5A90 (Unity) CompileSharedAssetsFile
    17. 0x000000014099C1D1 (Unity) BuildAssetBundleLocalPath
    18. 0x00000001409AEA06 (Unity) std::deque<std::map<int,BuildAsset,std::less<int>,std::allocator<std::pair<int const ,BuildAsset> > >,std::allocator<std::map<int,BuildAsset,std::less<int>,std::allocator<std::pair<int const ,BuildAsset> > > > >::push_back
    19. 0x00000001409B1432 (Unity) std::deque<std::map<int,BuildAsset,std::less<int>,std::allocator<std::pair<int const ,BuildAsset> > >,std::allocator<std::map<int,BuildAsset,std::less<int>,std::allocator<std::pair<int const ,BuildAsset> > > > >::push_back
    20. 0x00000001409B24F4 (Unity) BuildPlayer
    21. 0x00000001409B2740 (Unity) BuildPlayerWithSelectedScenes
    22. 0x0000000140B95D03 (Unity) Application::OpenAssetStoreURLAfterLaunch
    23. 0x0000000140B9C89A (Unity) Application::ParseARGVCommands
    24. 0x0000000140B9E43F (Unity) Application::FinishLoadingProject
    25. 0x0000000140DD120C (Unity) WinMain
    26. 0x000000014151EF94 (Unity) read
    27. 0x00000000777F59BD (kernel32) BaseThreadInitThunk
    28.  
    29. ========== END OF STACKTRACE ===========
    I have tried searching for similar crash issues with Unity, but every post with the same call stack seems unanswered.
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,351
    You can try to attach a native debugger (Windbg, visual studio) to the editor and build. When it crashes you may be able to examine the stack to look for clues.
     
  3. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,663
    It could have failed during compiling the scripts. Make sure you are not trying to include scripts which are Editor scripts.
    For example, in the scripts if you have "using UnityEditor;", the above scenario can happen.
     
  4. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    78
    For anyone googling this call stack...

    The issue was resolved by upgrading to "Patch 5.3.5p1". I believe the issue appeared from copy-pasting animation nodes.
     
  5. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    78
    And it came back. Nothing suspicious was submitted that could have caused it to happen again- so I guess it was never fixed.
     
unityunity