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

WinStore/C++ crash on level load: "vector subscript out of range"

Discussion in 'Windows' started by jemast, Oct 2, 2013.

  1. jemast

    jemast

    Joined:
    Dec 7, 2011
    Posts:
    141
    Hello again,

    I'm having an issue with Windows Store this time with C++ builds on level load where I get a systematic crash on a specific level load. I've included the stack trace below, inspecting the memory I could find the offending game object but unfortunately I'm not able to see what's wrong with it as it works correctly with no exceptions on other builds. By the way, the stack trace seem to indicate that my code is not yet reached at this point (for this level).

    I've tried making a smaller repro project and isolating only that object (through exporting it as a prefab) but it does not reproduce the error. I'm willing to send my entire project folder (500 MB zipped) though as I mentionned in an earlier bug report on this forum, Bug Reporter won't work for me on Windows and I'm quite sure I can't send those 500MB via email... Also, I'd rather not submit the bug via bugs@unity3d.com giving details to an FTP account knowning the reported bugs are semi-public (your FogBugz base is crawled by Google).

    If any dev is intersted at looking at this issue contact me to let me know how I can send you the project. It's in no way an urgent matter on my end since my game won't pass WACK validation due to JS image effects, but I'd rather see this fixed in 4.3.

    Code (csharp):
    1. >   msvcp110d.dll!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line) Line 15 C++
    2.     UnityPlayer.dll!std::vector<unsigned char,stl_allocator<unsigned char,8,4> >::operator[](unsigned int _Pos) Line 1140   C++
    3.     UnityPlayer.dll!Mesh::GetSubMeshBuffer16(int submesh) Line 1407 C++
    4.     UnityPlayer.dll!CollisionMeshData::ExtractFromMesh(Mesh  mesh, dynamic_array<Vector3f,4,52>  vertices, dynamic_array<unsigned short,2,52>  triangles, dynamic_array<unsigned short,2,52>  remap) Line 303   C++
    5.     UnityPlayer.dll!CreateTriangleMeshStream(Mesh * mesh, bool convex, const Matrix4x4f  scalematrix, TransformType transformType, MemoryStream  stream) Line 195   C++
    6.     UnityPlayer.dll!CreateNxTriangleMesh(Mesh * mesh, bool convex, const Matrix4x4f  scalematrix, TransformType transformType) Line 258 C++
    7.     UnityPlayer.dll!MeshCollider::Create(const Rigidbody * ignoreRigidbody) Line 183    C++
    8.     UnityPlayer.dll!Collider::CreateShapeIfNeeded() Line 92 C++
    9.     UnityPlayer.dll!Collider::AwakeFromLoad(AwakeFromLoadMode awakeMode) Line 110   C++
    10.     UnityPlayer.dll!MeshCollider::AwakeFromLoad(AwakeFromLoadMode awakeMode) Line 83    C++
    11.     UnityPlayer.dll!AwakeFromLoadQueue::InvokePersistentManagerAwake(AwakeFromLoadQueue::Item * objects, unsigned int size, AwakeFromLoadMode awakeMode, void (Object , const TypeTree ) * safeBinaryCallback) Line 305 C++
    12.     UnityPlayer.dll!AwakeFromLoadQueue::PersistentManagerAwakeFromLoad(int queueIndex, AwakeFromLoadMode mode, void (Object , const TypeTree ) * safeBinaryCallback) Line 180   C++
    13.     UnityPlayer.dll!AwakeFromLoadQueue::PersistentManagerAwakeFromLoad(AwakeFromLoadMode mode, void (Object , const TypeTree ) * safeBinaryCallback) Line 139   C++
    14.     UnityPlayer.dll!PersistentManager::IntegrateAllThreadedObjectsStep2(AwakeFromLoadQueue  awakeQueue) Line 1005   C++
    15.     UnityPlayer.dll!CompleteAwakeSequence(const std::basic_string<char,std::char_traits<char>,stl_allocator<char,50,4> >  path, AwakeFromLoadQueue  awakeQueue) Line 990    C++
    16.     UnityPlayer.dll!CompletePreloadManagerLoadLevel(const std::basic_string<char,std::char_traits<char>,stl_allocator<char,50,4> >  path, AwakeFromLoadQueue  awakeQueue) Line 961  C++
    17.     UnityPlayer.dll!LevelLoading::LoadLevel(int index, const std::basic_string<char,std::char_traits<char>,stl_allocator<char,50,4> >  path, AwakeFromLoadQueue  loadQueue) Line 1316   C++
    18.     UnityPlayer.dll!PlayerLoadLevelFromThread(int levelIndex, const std::basic_string<char,std::char_traits<char>,stl_allocator<char,50,4> >  name, AwakeFromLoadQueue  loadQueue) Line 362 C++
    19.     UnityPlayer.dll!PreloadLevelOperation::IntegrateMainThread() Line 771   C++
    20.     UnityPlayer.dll!PreloadManager::UpdatePreloadingSingleStep(bool stopPreloading) Line 459    C++
    21.     UnityPlayer.dll!PreloadManager::UpdatePreloading() Line 555 C++
    22.     UnityPlayer.dll!PlayerLoop(bool batchMode, bool performRendering, IHookEvent * pHookEvt) Line 1695  C++
    23.     UnityPlayer.dll!metro::MainLoop() Line 145  C++
    24.     UnityPlayer.dll!UnityPlayer::AppCallbacks::PerformUpdateAndRender() Line 752    C++
    25.     UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThread(void * param) Line 107    C++
    26.     UnityPlayer.dll!<lambda_8d550a5fe9d551d0031ceb7da9e2dc4f>::operator()(Windows::Foundation::IAsyncAction ^ __formal) Line 272    C++
    27.     UnityPlayer.dll!Platform::Details::__abi_FunctorCapture1<<lambda_8d550a5fe9d551d0031ceb7da9e2dc4f>,void,Windows::Foundation::IAsyncAction ^>::Invoke(Windows::Foundation::IAsyncAction ^ __arg0) Line 857   C++
    28.     UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::Invoke(Windows::Foundation::IAsyncAction ^ __param0)   C++
    29.     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) C++
    30.  
     
  2. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    Have you found any solution for this? I have the same issue (for me the crash comes at random time), but only in debug mode. The master build runs without any problems since the error comes only from an assertion...
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Have you checked 4.5.x ?
     
  4. FreebordMAD

    FreebordMAD

    Joined:
    Mar 15, 2013
    Posts:
    633
    I'm on 4.5.3.
    I have narrowed down the assert error to "mesh.triangles". Everytime I access it it throws an assert in the vector class.
    But everything works fine in Master build!
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Because Master builds have asserts disabled for performance. In any case please submit a bug with repro project attached. Thanks