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. The 2023.1 beta is now available for testing. To find out what's new, have a look at our 2023.1 feature highlights.
    Dismiss Notice

Allocator.Persistent crash in non-dev build 2019.2.0a13

Discussion in '2019.2 Beta' started by jooleanlogic, Apr 25, 2019.

  1. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    434
    This code crashes in a non-dev build but only with the Persistent allocator. It works if you use Temp or TempJob.
    Code (CSharp):
    1. int* data = (int*) UnsafeUtility.Malloc(sizeof(int)*4, UnsafeUtility.AlignOf<int>(), Allocator.Persistent);
    My game was crashing immediately after the Unity logo and I tracked it down to the first Persistent allocation of the NativeMultiHashMap s_StableTypeHashToTypeIndex in TypeManager.InitialiseAllComponents() when ecs bootstraps.

    If I disable ecs via UNITY_DISABLE_AUTOMATIC_SYSTEM_BOOTSTRAP, then I can crash it with nothing but the code above in a completely new empty project.
    I'm building with mono and it crashes in Windows, Linux and Android. Doesn't crash in the Editor or in dev builds. Discovered it in 2019.2.0a11 but it still exists in 0a13.
    It doesn't crash in 2019.1.0b10 which is the last version of 2019.1 I've got installed.
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,045
    Could you please submit a bug report with a minimal reproduction project for this issue and reply in here with the issue ID?
     
  3. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    434
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,045