Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug [IN-26935, IN-29079] Random Crashes when using Camera Stack with Multithreaded Rendering On

Discussion in '2023.1 Beta' started by Neonlyte, Dec 25, 2022.

  1. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    Update:

    Did some more test and found that if I don't use camera stack, the crash would not happen. If I add an overlay camera to base camera, it will have a chance to crash beyond that point. From the stack trace, I can confirm that the crash happened while rendering the overlay camera.

    This crash seems to be more easily triggered on the iPhone than on iPad or Editor.

    Update 2:

    I realized that Multithreaded Rendering was on. Since turning that off, the crash hasn't come back even for long periods of run time. It made sense as this could be a race condition and I should have realized that

    Way to replicate:

    Use any URP project with a scene using camera stack, turn on Multi-threaded rendering, build to device, and let the device sit there. The app should crash within 10 minutes.

    Original Post:

    I have seen crashes at ScriptableRenderLoopJob function in 2022.2(.1) and 2023.1(a24) with my URP project. The condition was not clear, but the crash would happen occasionally by chance on my Mac, and more often on the iPhone. Sometimes the crash does not happen at all, and sometimes the crash can happen seconds after the Player is started.

    Attached is a Editor crash log JSON for help. I can't make a reliable reproducible case to trigger the crash so I don't think I can submit a bug report without it being rejected by QA as not reproducible. From the stack trace on device it looks like a NULL reference in that function, so hopefully it is a straightforward fix for Unity.

    Devices:
    MacBook Pro, M1 Max, macOS 13.1
    iPhone 14 Pro, iOS 16.2
    iPad Pro (2020, A12Z), iOS 16.2

    Stack trace on iOS:

    WX20221224-230555@2x.png
     

    Attached Files:

    Last edited: Dec 27, 2022
    Azerion_Noblauch likes this.
  2. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
  3. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    New crash logs with Editor.log
     

    Attached Files:

  4. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    Submitted an bug report as IN-26935. Because I cannot recreate the issue with any deterministic steps right now, I don't have a project attached.
     
    Kichang-Kim and TreyK-47 like this.
  5. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    Hi. In my case, disabling MTRendering and GraphicsJobs does not work for this issue.. it still crashes. Here is crash log:

    MTRendering ON, Grpahics Jobs ON : Crash
    MTRendering OFF, Grpahics Jobs ON : Crash
    MTRendering ON, Grpahics Jobs OFF : Crash
    MTRendering OFF, Grpahics Jobs OFF : Crash

    Tested with Unity 2022.2.1f1.
     
  6. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    I’m not Unity employee, but your stack trace still looks like Multi-threaded Rendering is enabled. Do you have a stack trace when Multi-threaded Rendering is off?
     
  7. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    It shows same stack tace even SystemInfo.renderingThreadingMode is Direct. (Of course, SystemInfo.graphicsMultiThreaded is false too.)

    Note: In my case, I did not use CameraStacking but is crashes too :(
     
  8. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    I tested Unity 2023.1.0a25 and it still crashes.
     
  9. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    Have you filed an issue yet? I recommend you do the same.
     
  10. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    I reported full re-producible project as IN-29079.
     
    Neonlyte likes this.
  11. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    Hi there, has QA processed your case yet?
     
  12. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    Unity said it is duplicated, but they did not send any other information. :(
     
  13. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    So they didn't tell you which issue yours is duplicate of?
     
  14. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    They didn't.
     
  15. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    @LeonhardP Hi, would you mind help us look into this? At least we should have something to keep track of the actual issue.
     
  16. Eventyr

    Eventyr

    Joined:
    Nov 1, 2016
    Posts:
    1
    Kichang-Kim likes this.
  17. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    513
    Thank you very much. This is more or less what I have been seeing as well. I think it has the same root cause as my runtime issues.
     
  18. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
  19. ETGgames

    ETGgames

    Joined:
    Jul 10, 2015
    Posts:
    101
    How is it still an issue?? It's been almost a year!!! on 2023.1.16f1 and ios17...

    Turning off multithreading crashes the instantly