Search Unity

Bug (Case 1380557) Suddently started getting errors about $BurstDirectCallInitializer.Initialize

Discussion in 'Entity Component System' started by Enrico-Monese, Nov 13, 2021.

  1. Enrico-Monese

    Enrico-Monese

    Joined:
    Dec 18, 2015
    Posts:
    77
    This seems to happen with both Mono and IL2CPP backends. The error only appears in builds. Below is an example but it also happens with some other methods.
    Tried removing Temp and BurstCache folders but it didn't help.

    Code (CSharp):
    1. MethodAccessException: Method `Unity.Entities.Conversion.IncrementalConversionContext+RemoveFromHierarchy+Execute_000001B1$BurstDirectCall.Initialize()' is inaccessible from method `$BurstDirectCallInitializer.Initialize()'
    2.   at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_throw_method_access(intptr,intptr)
    3.   at $BurstDirectCallInitializer.Initialize () [0x00000] in <1c93deb9b0ff482a892bb98161b09744>:0
    This is on Unity 2021.2.2f1 with Burst package 1.6.2 on Windows.

    (Case 1380557)
     
    Last edited: Nov 13, 2021
  2. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Got the same exceptions in Editor on Burst 1.6.2. Everything is working as expected on 1.5.x

    Code (CSharp):
    1. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MethodAccessException: Method `Space.ShiftScaledCelestialBodySystem+<>c__DisplayClass_OnStopRunning_LambdaJob0+RunWithoutJobSystem_00000241$BurstDirectCall.Initialize()' is inaccessible from method `$BurstDirectCallInitializer.Initialize()'
    2.   at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_throw_method_access(intptr,intptr)
    3.   at $BurstDirectCallInitializer.Initialize () [0x00000] in <cea05b54b9714bdf97f698981d539d49>:0
    4.   at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
    5.   at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <695d1cc93cca45069c528c15c9fdd749>:0
    6.    --- End of inner exception stack trace ---
    7.   at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <695d1cc93cca45069c528c15c9fdd749>:0
    8.   at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
    9.   at UnityEditor.EditorAssemblies.ProcessInitializeOnLoadMethodAttributes () [0x00047] in <208f92fc783546f9abbe643bfc23920c>:0
    10. UnityEditor.EditorAssemblies:ProcessInitializeOnLoadMethodAttributes ()
    11.  
     
  3. MarcoPersson

    MarcoPersson

    Unity Technologies

    Joined:
    Jul 21, 2021
    Posts:
    53
    Thanks for reporting this, we have a fix in the works that should hopefully land with the next release of Burst.
     
  4. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Fantastic, thank you!