Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Windows standalone crashes on SparseTexture::VirtualRedirectTransfer in 5.4.1f

Discussion in 'Windows' started by DiligentGear, Sep 17, 2016.

  1. DiligentGear

    DiligentGear

    Joined:
    Dec 25, 2013
    Posts:
    28
    I have been receiving crash reports from users, and their outputing stack traces indicated that "SparseTexture::VirtualRedirectTransfer" was the last call.

    However, I don't have any references to SparseTexture in my project, and I never had such problem before 5.4. Does anyone have any ideas why this could happen? Perhaps Unity is optimizing textures internally with SparseTexture? If so, how do I disable it? I'm assuming it crashes when user does not have DirectX 11.2 or compatible hardware.

    Here's a part of output_log from user:
    Code (CSharp):
    1. Initialize engine version: 5.4.1f1 (649f48bbbf0f)
    2. GfxDevice: creating device client; threaded=1
    3. Direct3D:
    4.     Version:  Direct3D 11.0 [level 11.0]
    5.     Renderer: NVIDIA GeForce GTX 960M    (ID=0x139b)
    6.     Vendor:   NVIDIA
    7.     VRAM:     3072 MB
    8. ....
    9.  
    10. ========== OUTPUTING STACK TRACE ==================
    11.  
    12. 0x003998E9 (Game) SparseTexture::VirtualRedirectTransfer
    13. 0x002B6605 (Game) JobQueue::Exec
    14. 0x002B6821 (Game) JobQueue::processJobs
    15. 0x004540FF (Game) Thread::RunThreadWrapper
    16. 0x74EC38F4 (KERNEL32) BaseThreadInitThunk
    17. 0x77105DE3 (ntdll) RtlUnicodeStringToInteger
    18.  
    19. ========== END OF STACKTRACE ===========
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    Any chance you got a crash dump from one of the users? The output log is kinda useless.
     
  3. DiligentGear

    DiligentGear

    Joined:
    Dec 25, 2013
    Posts:
    28
    Thanks for your reply! I have a lot of complete crash reports including dump files collected from users. Most of them have stack traces pointing at SparseTexture but one user had crashes without even a stack trace. The zip file is attached.

    I found the issue might be related to assigning new materials on TrailRenderer and MeshRenderer when the object enters a trigger. I sent them both original version and fixed version, and they said they don't have issues after this fix.

    those are lines I removed:
    Code (CSharp):
    1. // tr is a TrailRenderer      
    2. tr.Clear();
    3. // the reason I did this is because TrailRenderer won't reset its color
    4. // unless I reassign its material
    5. tr.material = new Material(tr.material);
    6. tr.material.SetColor(tintColorHash, activeTrColor);
    7. // core is a MeshRenderer
    8. core.material = new Material(activeMaterial);
    By the way, I had some trouble loading symbols myself. I set up the symbol server following the documentation, but it asks me for game executable instead of pdb when I tried to run debugger in native. It doesn't even recognize the executable after I put executable under symbol path or manually selected it. I wonder if I'm doing it wrong.
     

    Attached Files:

  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    Sparse textures have nothing to do with the crash: the stacktrace in the log is wrong (it only works properly for development builds). It crashes in trail renderer code.

    Stacktrace from one of the dumps:
    Code (csharp):
    1.    TH-TDOG.exe!TrailRenderer::RenderGeometryJob(TrailRendererGeometryJob * job) Line 323   C++
    2.    TH-TDOG.exe!JobQueue::Exec(JobInfo * info, int tag, int count) Line 388   C++
    3.    TH-TDOG.exe!JobQueue::WaitForJobGroup(JobGroupID gid, bool execMain) Line 1394   C++
    4.    TH-TDOG.exe!CompleteFenceInternal(JobFence & fence) Line 27   C++
    5.    TH-TDOG.exe!GeometryJobTasks::PutGeometryJobFence(GfxDevice & device, unsigned int index) Line 49   C++
    6.    TH-TDOG.exe!GfxDeviceWorker::RunCommand(ThreadedStreamBuffer & stream) Line 1953   C++
    7.    TH-TDOG.exe!GfxDeviceWorker::Run() Line 333   C++
    8.    TH-TDOG.exe!Thread::RunThreadWrapper(void * ptr) Line 44   C++
    9.    kernel32.dll!@BaseThreadInitThunk@12()   Unknown
    10.    ntdll.dll!__RtlUserThreadStart()   Unknown
    11.    ntdll.dll!__RtlUserThreadStart@8()   Unknown
    Stacktrace from another one of the dumps:

    Code (csharp):
    1.    TH-TDOG.exe!TrailRenderer::RenderGeometryJob(TrailRendererGeometryJob * job) Line 323   C++
    2.    TH-TDOG.exe!JobQueue::Exec(JobInfo * info, int tag, int count) Line 388   C++
    3.    TH-TDOG.exe!JobQueue::ProcessJobs(void * profInfo) Line 801   C++
    4.    TH-TDOG.exe!JobQueue::WorkLoop(void * data) Line 874   C++
    5.    TH-TDOG.exe!Thread::RunThreadWrapper(void * ptr) Line 44   C++
    6.    kernel32.dll!@BaseThreadInitThunk@12()   Unknown
    7.    ntdll.dll!__RtlUserThreadStart()   Unknown
    8.    ntdll.dll!__RtlUserThreadStart@8()   Unknown
    In both cases, the main thread is doing this:

    Code (csharp):
    1.   ntdll.dll!_NtWaitForSingleObject@12()   Unknown
    2.    TH-TDOG.exe!GfxDeviceWorker::WaitOnCPUFence(unsigned int fence) Line 286   C++
    3.    TH-TDOG.exe!GfxDeviceClient::WaitOnCPUFence(unsigned int fence) Line 2344   C++
    4.    TH-TDOG.exe!ParticleSystem::SyncJobs(bool syncRenderJobs) Line 538   C++
    5.    TH-TDOG.exe!ParticleSystem_CUSTOM_Internal_Clear(ReadOnlyScriptingObjectOfType<ParticleSystem> self) Line 2533   C++
    6.    064bc2f0()   Unknown
    7.    [Frames below may be incorrect and/or missing]  
    8.    TH-TDOG.exe!MessageForwarder::HandleMessage(void * receiver, int messageID, MessageData & messageData) Line 19   C++
    9.    TH-TDOG.exe!GameObject::SendMessageAny(const MessageIdentifier & messageIdentifier, MessageData & messageData) Line 1093   C++
    10.    TH-TDOG.exe!SendTriggerEvent(Collider * trigger, Collider * collider, MessageIdentifier messageID) Line 1928   C++
    11.    TH-TDOG.exe!PhysicsManager::ProcessTriggerEnterExits() Line 2130   C++
    12.    TH-TDOG.exe!PhysicsManager::FixedUpdate() Line 1336   C++
    13.    TH-TDOG.exe!PlayerLoop(bool __formal, bool performRendering, IHookEvent * pHookEvt) Line 2037   C++
    14.    TH-TDOG.exe!PerformMainLoop() Line 202   C++
    15.    TH-TDOG.exe!MainMessageLoop() Line 580   C++
    16.    TH-TDOG.exe!PlayerWinMain(HINSTANCE__ * hInst, HINSTANCE__ * hPrev, char * szCmdLine, int nCmdShow) Line 1031   C++
    17.    TH-TDOG.exe!WinMain(HINSTANCE__ * hInst, HINSTANCE__ * hPrev, char * szCmdLine, int nCmdShow) Line 6   C++
    18.    TH-TDOG.exe!__tmainCRTStartup() Line 275   C
    19.    kernel32.dll!@BaseThreadInitThunk@12()   Unknown
    20.    ntdll.dll!__RtlUserThreadStart()   Unknown
    21.    ntdll.dll!__RtlUserThreadStart@8()   Unknown
    It looks like your clearing particles in OnTriggerEnter event, and for some reason that causes a crash. Can we have a proper bug report?
     
  5. DiligentGear

    DiligentGear

    Joined:
    Dec 25, 2013
    Posts:
    28
    I just filed a bug report but I haven't received a confirmation email with bug report number. Did it go through?

    Edit: I got the e-mail 2 minutes later, it's 833047
     
  6. Sprakle

    Sprakle

    Joined:
    Jun 8, 2013
    Posts:
    31
    I think something similar is happening to us. We're not clearing particles, although we are clearing a trail renderer and disabling a particle system right before the crash.

    I've attached our crash report.
     

    Attached Files:

  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    Can you submit a bug report through the editor and tell me the case number?
     
  8. JuliusJ

    JuliusJ

    QA Minion of the month Unity Technologies

    Joined:
    May 20, 2015
    Posts:
    33
    Hi @stuffses, I've started investigating this but we still don't have a way to reproduce the crash. Could you submit a bug report with your project attached and post case number here? Thanks!