Crash in Nanite::DispatchBasePass

I’m trying to solve a relatively rare crash that has been reported by our graphics artists. I wasn’t able to debug the crash in natura, but we did get the call stacks.

It appears to me that:

  • Nanite::BuildShadingCommands()
    • spawns ShadingCommands.SetupTask
    • spawns ShadingCommands.BuildCommandsTask
      • which modifies ShadingCommands.Commands
  • Nanite::DispatchBasePass
    • waits for ShadingCommands.SetupTask
    • DOES NOT wait for ShadingCommands.BuildCOmmandsTask
    • reads ShadingCommands.Commands

My fix: at the beginning of Nanite::DispatchBasePass, right after

ShadingCommands.SetupTask.Wait();

I have added

ShadingCommands.BuildCommandsTask.Wait();

That seems to have fixed the problem, however due to the relative rarity of the crash I can’t be sure.

Can you confirm that this fix makes sense and eventually integrate it?

<

Hi there,

Thank you for the report.

I have submitted a new bug report for this issue, and once it is reflected publicly, you will be able to view it here:

https://issues.unrealengine.com/issue/UE-367483

Your proposed fix is logically sound and could serve as a temporary workaround. An engine developer will review the issue in more detail and may determine a more robust solution for resolving the Commands data dependency.

While we’re unable to provide direct updates on EPS, you can monitor any progress through the public issue tracker linked above. I will go ahead and close this case now, but feel free to respond here if you have any follow up questions.

Thanks,

Henry Liu