[Case 1184154] Unity 2019.3 Build failed because of Burst and Mathematics

Unity 2019.3
Burst 1.1.2
Mathematics 1.1.0

When I tried to build the project, build failed with the folowing error:

Unexpected error while processing function `System.Collections.Generic.IEqualityComparer`1<int>.GetHashCode(System.Collections.Generic.IEqualityComparer`1<int>* this, int obj)`. Reason: ��뫪� �� ��ꥪ� �� 㪠�뢠�� �� �������� ��ꥪ�.
at Unity.Mathematics.noise.taylorInvSqrt(Unity.Mathematics.float4 r) (at C:\Unity\rocket_science\Library\PackageCache\com.unity.mathematics@1.1.0\Unity.Mathematics\Noise\common.cs:23)
at Unity.Mathematics.noise.snoise(Unity.Mathematics.float3 v) (at ...


Internal compiler exception: System.NullReferenceException: ��뫪� �� ��ꥪ� �� 㪠�뢠�� �� �������� ��ꥪ�.
   � Burst.Compiler.IL.Helpers.CecilExtensions.IsDelegate(TypeDefinition typeDef)
   � Burst.Compiler.IL.Intrinsics.FunctionPointerProcessor.IsDelegateInvoke(ILFunctionReference method)
   � Burst.Compiler.IL.Syntax.ILBuilder.IsIntrinsicCall(ILFunctionReference binding, Boolean& dontVisitImpl)
   � Burst.Compiler.IL.Syntax.ILBuilder.CreateFunctionFromRef(ILFunctionReference funcRef)
   � Burst.Compiler.IL.Syntax.ILBuilder.VisitPendingFunctionReferences()

Just to note: we’ve seen this issue and the associated case, and are in the process of looking into this. I’ll keep you posted!

1 Like

Thanks!

1 Like

I think I’ve identified the problem, will DM you.

1 Like

What are you doing to cause this? I’ve yet to experience it.

You should avoid using static managed objects in the Burst Jobs. In my case it was static managed Dictionary, that I used in the Burst Job. When I replaced that with method, everything works again. Thanks to @Lee_Hammerton for clarification.

2 Likes

And just to be clear - the compiler should have done a better job at telling you that, and we’re going to fix that too :slight_smile:

2 Likes