DOTS jobs crash on startup in IL2CPP builds only

I am still working on submitting a formal bug report. But I have a pretty consistently reproducing crash that at this point I can only really pin on Burst.

Steps to reproduce:

  1. Create a new project in 2021.3.9f1 using the URP template on Windows with IL2CPP Windows support module.
  2. Add these two packages as mutable packages in the Packages folder (note the versions linked): GitHub - Dreaming381/Latios-Framework at v0.5.7 and GitHub - gamedev-pro/dmotion at b1b45304333dc8b6f361c8b20d8e1fb84676824c
  3. In the Package Manager, add the DMotion samples to the project.
  4. In the DMotion Package in the Tests folder, delete a file called LatiosBootstrap.cs
  5. In the DMotion Samples, open “All Samples” → 2 - Stress Test scene. TMP might prompt for import. Import essentials and reopen scene.
  6. Press play. there should be a grid of animated characters doing different things.
  7. Make a new build configuration asset that looks like this:
    8423586--1114782--upload_2022-9-7_19-39-41.png
  8. In the Player Settings, set the output to IL2CPP, then in the Build Settings, set the IL2CPP code generation mode to “Faster (smaller) builds”.
  9. Build using the build configuration asset.
  10. Run the build, it will crash on startup.

Other notes:

  • Happens on both Burst 1.7.3 and 1.7.4.
  • Does not happen with a Mono build instead of IL2CPP. The Mono build works fine.
  • Commenting out [BurstCompile] on the job that crashes will cause a different job later in the frame to crash instead, which is why I suspect this is a Burst bug.
  • Supposedly this crash also occurs for Android builds, but that requires a custom built version of a plugin for Android that I do not have at the moment so that will not be verifiable with these steps.

EDIT: IN-15930

It probably related to this? (read closer to the end) ExecutionEngineException: Attempting to call method 'Unity.Entities.FastEquality+CompareImpl`1 - Unity Engine - Unity Discussions

Just got a message from QA that they did not reproduce the issue and that they saw nothing like it in their database. Very strange.

Did you ever find a solution to this? I feel like I’m experiencing the same issue.