Generic Method in System Crashes Editor

Hi,

Here’s how to reproduce the bug:

  1. Create a new project (tested on 2019.3.4f1)
  2. Import Entities package (0.10.0 preview 6)
  3. Create a script with the following code:
using Unity.Entities;

public class TestSystem : SystemBase
{
    public void TheMethodThatCrashes<T>(T value) where T : struct, IComponentData
    {
        SetSingleton(value);
    }

    protected override void OnUpdate()
    {
    }
}
  1. Enter play mode
    CRASH

The will be the editor’s last logged line:

  • Assertion at …\mono\mini\method-to-ir.c:8462, condition `!mono_method_check_context_used (cmethod)’ not met

I didn’t dig too much into it, but I found that the crash seems to occur when the game is trying to run this method, which I assume was not correctly replaced by the DOTS compiler
6082470--660141--upload_2020-7-12_14-1-51.png

  1. Does it occur in the latest Entities version (0.11.1-preview.4)?
  2. Did you create a bug report? If not, I recommend doing one if you want to see that bug fixed sooner than later.
  1. I haven’t tested in 0.11.1 yet. I think I need to download the latest editor to be able to get the package.

  2. I was actually wondering about where I should be bug-reporting. I made a post in the forums because I saw there was a “bug” label that we could attach, but this might not be the right place as you said. I’ll use the Help>Report a Bug menu inside the Unity Editor.

Reporting bugs on the forums helps to get visibility and possible workarounds, but if you really want that fixed then using the Bug Reporter is the way to go. Sometimes Unity staff requests the case number here in the forums to speed-up some specific fixes.

1 Like