Search Unity

Bug Burst internal compiler error: System.Exception: Error while generating hash for method references:

Discussion in 'Burst' started by Aditrc, Sep 5, 2022.

  1. Aditrc

    Aditrc

    Joined:
    Dec 15, 2018
    Posts:
    15
    Burst version: 1.7.4

    Code (csharp):
    1. Burst internal compiler error: System.Exception: Error while generating hash for method references:
    2. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_de_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(!0&|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
    3. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_pn_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(!0&|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
    4. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_quad_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(!0&|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
    5. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_se_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(!0&|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51) ---> System.Exception: Error while hashing 0x06000018 in WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null ---> System.Exception: Error while visiting referenced token 0x0A000027 in WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null ---> System.InvalidOperationException: Could not resolve method for member reference 0x0A000027 in assembly WRL.Main.Meshes ---> System.InvalidOperationException: Failed to resolve method with name hash '8b538d9e3637b92c0103addb7518a077' and signature hash 'b60db76fcdb9fecab1d00d232e8a110c' in type definition '2000009'
    6.   at Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedTypeDefinition.TryGetMethodImpl (Burst.Compiler.IL.Helpers.Hash128& methodNameHash, Burst.Compiler.IL.Helpers.Hash128& methodSignatureHash, Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMethodDefinition& result) [0x000f5] in <cd6e15731ab84616a776e8bda4f822ab>:0
    7.   at Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedTypeDefinition.TryGetMethod (Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMemberReference reference, Burst.Compiler.IL.Hashing.ILGenericContext genericContext, Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMethodDefinition& result) [0x00053] in <cd6e15731ab84616a776e8bda4f822ab>:0
    8.    --- End of inner exception stack trace ---
    9.   at Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedTypeDefinition.TryGetMethod (Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMemberReference reference, Burst.Compiler.IL.Hashing.ILGenericContext genericContext, Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMethodDefinition& result) [0x0007c] in <cd6e15731ab84616a776e8bda4f822ab>:0
    10.   at Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMemberReference.TryResolveMethod (Burst.Compiler.IL.Hashing.ILGenericContext genericContext, Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMethodDefinition& methodDefinition, Burst.Compiler.IL.Hashing.ILGenericContext& methodGenericContext) [0x0001b] in <cd6e15731ab84616a776e8bda4f822ab>:0
    11.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.VisitMemberReference (Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMemberReference& memberReference, System.Nullable`1[T] constrainedType, Burst.Compiler.IL.Hashing.ILGenericContext genericContext, System.Collections.Immutable.ImmutableArray`1[Burst.Compiler.IL.Hashing.Types.ILType]& methodGenericParameters) [0x00046] in <cd6e15731ab84616a776e8bda4f822ab>:0
    12.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.HashMethodDefinition (Burst.Compiler.IL.Hashing.CacheRuntime.ToVisit& itemToVisit) [0x001a0] in <cd6e15731ab84616a776e8bda4f822ab>:0
    13.    --- End of inner exception stack trace ---
    14.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.HashMethodDefinition (Burst.Compiler.IL.Hashing.CacheRuntime.ToVisit& itemToVisit) [0x00238] in <cd6e15731ab84616a776e8bda4f822ab>:0
    15.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.VisitItem (Burst.Compiler.IL.Hashing.CacheRuntime.ToVisit& itemToVisit) [0x000c7] in <cd6e15731ab84616a776e8bda4f822ab>:0
    16.    --- End of inner exception stack trace ---
    17.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.VisitItem (Burst.Compiler.IL.Hashing.CacheRuntime.ToVisit& itemToVisit) [0x000ff] in <cd6e15731ab84616a776e8bda4f822ab>:0
    18.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.GetHashImpl () [0x00144] in <cd6e15731ab84616a776e8bda4f822ab>:0
    19.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.GetPerMethodHashes (Burst.Compiler.IL.MethodReferenceWithLinkName[] methodReferences, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, System.Action`2[T1,T2] onVisitItem) [0x00039] in <cd6e15731ab84616a776e8bda4f822ab>:0
    20.    --- End of inner exception stack trace ---
    21.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.GetPerMethodHashes (Burst.Compiler.IL.MethodReferenceWithLinkName[] methodReferences, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, System.Action`2[T1,T2] onVisitItem) [0x000d2] in <cd6e15731ab84616a776e8bda4f822ab>:0
    22.   at Burst.Compiler.IL.NativeCompiler.ComputePerMethodHash (System.ValueTuple`2[System.String,Burst.Compiler.IL.Helpers.Hash128][]& perMethodHashes, System.Collections.Generic.HashSet`1[Mono.Cecil.AssemblyNameReference]& referencedAssemblies) [0x00007] in <cd6e15731ab84616a776e8bda4f822ab>:0
    23.   at Burst.Compiler.IL.Server.LibraryCompiler.CompileImpl (Burst.Compiler.IL.Server.CompileLibraryJob request, Burst.Compiler.IL.Server.CompilerServerJobExecutionContext executionContext, Burst.Compiler.IL.Server.Caching.LibraryCacheEntry cacheEntry, System.Collections.Generic.List`1[T] disassembly, System.Collections.Generic.List`1[T] diagnosticMessages, System.Collections.Generic.List`1[T] logMessages, System.Collections.Generic.HashSet`1[T] opCodesUsed, Burst.Compiler.IL.CompilerStatistics timings, Burst.Compiler.IL.Server.InterpretDelegate& interpretDelegate) [0x002c1] in <cd6e15731ab84616a776e8bda4f822ab>:0
    24.   at Burst.Compiler.IL.Server.LibraryCompiler.Compile (Burst.Compiler.IL.Server.CompileLibraryJob request, Burst.Compiler.IL.Server.CompilerServerJobExecutionContext executionContext) [0x002aa] in <cd6e15731ab84616a776e8bda4f822ab>:0
    25.  
    26. While compiling job:
    27. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_de_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_de_job&, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
    28. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_pn_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_pn_job&, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
    29. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_quad_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_quad_job&, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
    30. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_se_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_se_job&, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
    31.  
     
  2. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    Any chance you could try the 1.8 preview package '1.8.0-pre.2' and see if that fixes the problem?
     
  3. Aditrc

    Aditrc

    Joined:
    Dec 15, 2018
    Posts:
    15
    still exist

    Code (CSharp):
    1. Burst internal compiler error: System.Exception: Error while generating hash for method references:
    2. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_de_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(!0&|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
    3. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_pn_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(!0&|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
    4. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_quad_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(!0&|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51)
    5. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_se_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(!0&|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|System.IntPtr, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51) ---> System.Exception: Error while hashing 0x06000018 in WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null ---> System.Exception: Error while visiting referenced token 0x0A000027 in WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null ---> System.InvalidOperationException: Could not resolve method for member reference 0x0A000027 in assembly WRL.Main.Meshes ---> System.InvalidOperationException: Failed to resolve method with name hash '8b538d9e3637b92c0103addb7518a077' and signature hash 'b60db76fcdb9fecab1d00d232e8a110c' in type definition '2000009'
    6.   at Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedTypeDefinition.TryGetMethodImpl (Burst.Compiler.IL.Helpers.Hash128& methodNameHash, Burst.Compiler.IL.Helpers.Hash128& methodSignatureHash, Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMethodDefinition& result) [0x000f5] in <5d73e465583d43bd9040726026e50505>:0
    7.   at Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedTypeDefinition.TryGetMethod (Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMemberReference reference, Burst.Compiler.IL.Hashing.ILGenericContext genericContext, Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMethodDefinition& result) [0x00053] in <5d73e465583d43bd9040726026e50505>:0
    8.    --- End of inner exception stack trace ---
    9.   at Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedTypeDefinition.TryGetMethod (Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMemberReference reference, Burst.Compiler.IL.Hashing.ILGenericContext genericContext, Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMethodDefinition& result) [0x0007c] in <5d73e465583d43bd9040726026e50505>:0
    10.   at Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMemberReference.TryResolveMethod (Burst.Compiler.IL.Hashing.ILGenericContext genericContext, Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMethodDefinition& methodDefinition, Burst.Compiler.IL.Hashing.ILGenericContext& methodGenericContext) [0x0001b] in <5d73e465583d43bd9040726026e50505>:0
    11.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.VisitMemberReference (Burst.Compiler.IL.Hashing.CacheRuntime.Metadata.CachedMemberReference& memberReference, System.Nullable`1[T] constrainedType, Burst.Compiler.IL.Hashing.ILGenericContext genericContext, System.Collections.Immutable.ImmutableArray`1[Burst.Compiler.IL.Hashing.Types.ILType]& methodGenericParameters) [0x00046] in <5d73e465583d43bd9040726026e50505>:0
    12.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.HashMethodDefinition (Burst.Compiler.IL.Hashing.CacheRuntime.ToVisit& itemToVisit) [0x00167] in <5d73e465583d43bd9040726026e50505>:0
    13.    --- End of inner exception stack trace ---
    14.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.HashMethodDefinition (Burst.Compiler.IL.Hashing.CacheRuntime.ToVisit& itemToVisit) [0x001ff] in <5d73e465583d43bd9040726026e50505>:0
    15.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.VisitItem (Burst.Compiler.IL.Hashing.CacheRuntime.ToVisit& itemToVisit) [0x000a6] in <5d73e465583d43bd9040726026e50505>:0
    16.    --- End of inner exception stack trace ---
    17.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.VisitItem (Burst.Compiler.IL.Hashing.CacheRuntime.ToVisit& itemToVisit) [0x000de] in <5d73e465583d43bd9040726026e50505>:0
    18.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.GetHashImpl (Mono.Cecil.MethodReference methodReference) [0x001f5] in <5d73e465583d43bd9040726026e50505>:0
    19.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.GetPerMethodHashes (Burst.Compiler.IL.MethodReferenceWithLinkName[] methodReferences, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, Burst.Compiler.IL.Helpers.DebugLogWriter debugLogWriter, Burst.Compiler.IL.Server.ProfileDelegate profileCallback, Burst.Compiler.IL.Hashing.CacheRuntime.OnVisitItemDelegate onVisitItem) [0x00070] in <5d73e465583d43bd9040726026e50505>:0
    20.    --- End of inner exception stack trace ---
    21.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.GetPerMethodHashes (Burst.Compiler.IL.MethodReferenceWithLinkName[] methodReferences, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, Burst.Compiler.IL.Helpers.DebugLogWriter debugLogWriter, Burst.Compiler.IL.Server.ProfileDelegate profileCallback, Burst.Compiler.IL.Hashing.CacheRuntime.OnVisitItemDelegate onVisitItem) [0x00116] in <5d73e465583d43bd9040726026e50505>:0
    22.   at Burst.Compiler.IL.NativeCompiler.ComputePerMethodHash (System.ValueTuple`2[System.String,Burst.Compiler.IL.Helpers.Hash128][]& perMethodHashes, System.Collections.Generic.HashSet`1[Burst.Compiler.IL.AssemblyNameReferenceAndMetadata]& referencedAssemblies, Burst.Compiler.IL.Helpers.DebugLogWriter debugLogWriter, Burst.Compiler.IL.Server.ProfileDelegate profileCallback) [0x00007] in <5d73e465583d43bd9040726026e50505>:0
    23.   at Burst.Compiler.IL.Server.LibraryCompiler.HashAndCompileMethodGroup (Burst.Compiler.IL.Server.CompilationJob request, Burst.Compiler.IL.Server.CompilerServerJobExecutionContext executionContext, System.Int32 methodGroupIndex, Burst.Compiler.IL.Server.SharedLibraryCompilationState sharedState, Burst.Compiler.IL.Aot.AotCompilerOptions defaultOptions, Burst.Compiler.IL.NativeCompiler& nativeCompiler, Burst.Compiler.IL.Aot.AotModuleGroup& aotModuleGroup) [0x002d7] in <5d73e465583d43bd9040726026e50505>:0
    24.  
    25. While compiling job:
    26. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_de_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_de_job&, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
    27. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_pn_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_pn_job&, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
    28. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_quad_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(WRL.Main.Ground.Meshes.SurfaceNetsJob+gen_quad_job&, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
    29. Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[[WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_se_job, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(WRL.Main.Ground.Meshes.SdfSerdeJob+sdf_se_job&, WRL.Main.Meshes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
    30.  
     
  4. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    Ok I think we are gonna need a bug report for this to be able to fix it! Can you submit one please?
     
  5. Aditrc

    Aditrc

    Joined:
    Dec 15, 2018
    Posts:
    15
    submitted
     
  6. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    300
    You got a bug number just so we can ensure we are looking at the right one!?
     
  7. Aditrc

    Aditrc

    Joined:
    Dec 15, 2018
    Posts:
    15
    IN-15679
     
  8. HernandoNJ

    HernandoNJ

    Joined:
    May 13, 2018
    Posts:
    75
    Error:
    Burst internal compiler error: System.Exception: Error while generating hash for method references: Unity.Networking.Transport.SimulatorPipelineStage, Unity.Networking.Transport, Version=0.0.0.0, Culture=neutral, ...

    Solution so far: restarting the editor.
    Unity version: 2021.3.11
     
  9. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    @HernandoNJ please could you submit a bug report? For this type of issue, we really need a repro project in order to investigate.
     
  10. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    @Aditrc thank you for submitting a bug report. I've checked and I see it going through the system - hopefully we'll be able to take a look at it soon.
     
  11. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    43
    @tim_jones I can confirm this happens on 2022.2b13. I also have the Transport package (version 1.2) installed along with the newest entities 1.0.

    Atm, restarting the editor does "fix" it.

    I should mention that I was previously on Burst 1.5.x and I wasn't seeing this. I moved to 2022.2b for the newest Entities and this showed up.
     
  12. Selmar

    Selmar

    Joined:
    Sep 13, 2011
    Posts:
    59
    For me the repro is simply creating a new project with 3D URP, removing tutorial assets, then adding the entities package to it. Nothing more.

    Details here.
     
  13. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    43
    @tim_jones Any news on this front (even it is just a "yeah... no one is looking into this")? I've failed to repro this in a small isolated project so I can't really submit a bug report. I'd be happy to assist in any other way, though (grant access to my project's repo and sit down with someone from the burst team even).

    It's a huge hindrance to have to restart the editor every time I make any code change and its starting to affect my already very limited time to work on this project.
     
  14. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    @rauiz sorry for the delayed reply. Some questions:
    1. Is your error message exactly the same as the ones posted above? If not, please could you paste your message here?
    2. Does it happen every time you make any code change?
    3. Which version of Burst are you using? If it's earlier than 1.8.2, please could you try 1.8.2 to see if that fixes it?
     
  15. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    43
    @tim_jones Thanks for the reply (any reply is always nice hahaha).

    1. The error message, yes. The list of jobs it points out, no. I've looked through these jobs multiple times and their bursted versions do compile (can see them in the burst inspector) and they do run correctly until the first code change happens. After the first recompile, this error shows up. You can also see, from the logs of both the first recompile and second recompile, that they're not always the exactly same (which may be expected depending on how burst works internally, but I figured I'd mention it).

    2. Yes --- every code change (within the same AsmDef) with the editor open causes this error to appear. For example, if I change code in an editor AsmDef no problems appear.

    3. It was on 1.8.0. I updated to 1.8.2 and it didn't fix it. (The attached logs are from 1.8.2)

    It's worth mentioning that if I look in the Burst inspector the job appears compiled correctly. At runtime, however, none of the Bursted code runs (if I look at the profiler, it shows and behaves, perf-wise, as though it's the non-bursted version running).
     

    Attached Files:

  16. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    Thank you for all the details @rauiz. I've logged this internally and we'll look at it as soon as we can.
     
  17. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    43
    Thanks @tim_jones! I can also confirm this still happens on Unity's current 2022.2.1f1 release.
     
  18. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    Hi @rauiz - I haven't been able to reproduce this error. Please could you submit a bug report via Help > Report a Bug? Then I'll hopefully be able to repro it in the context of your project.
     
  19. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    43
    @tim_jones Thanks for looking into the problem and apologies for taking this long to get back to you. Unfortunately, it's quite a large tech-demo/prototype with a bunch of sensitive stuff in it --- I can't separate things out without spending a bunch of time on it. I did try to do it, but it's just way too much of a time investment atm for me.

    I'd be happy to accommodate any other way to investigate the issue except for this one; in the mean time, I'll just live with this until I can find the time to go investigate this stuff myself. My first thought is to just go commenting large swaths of the code-base out until I stop seeing the problem and then uncomment it in 'binary search'-fashion till I find the root cause... Maybe there's some #def I can use to get more information from the Burst compilation process or maybe you can direct me to a log I could sift through to find more details on the internal compiler error?
     
  20. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    304
    Happens to me as well in similar fashion. Restarting editor works.
    The project is too large to upload as whole and it would take a lot of time trying to strip it.

    Code (CSharp):
    1. ---> System.Exception: Error while resolving interface method 0x060000B6 in UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null on type 0x0200066C in assembly c:\Data\Projects\Volcanoids\Library\ScriptAssemblies\Volcanoids.dll
    2. ---> System.InvalidOperationException: Failed to resolve method with name hash '48be31a2be36b8a153b52a47e12525be' in type definition '0x0200066C in assembly c:\Data\Projects\Volcanoids\Library\ScriptAssemblies\Volcanoids.dll'
    Based on log file it fails to resolve IJob.Execute method (0x060000B6 method, 0x0200066C type).
    The job itself is SelectTarget (0x0200066C).

    The job is nested type, simple as this:
    (un-nesting does not fix it)

    Code (CSharp):
    1.  
    2. public static partial class TargetDetection
    3. {
    4.     [BurstCompile]
    5.     struct SelectTarget : IJob
    6.     {
    7.         [ReadOnly] public NativeList<TargetPair> Pairs;
    8.  
    9.         public NativeArray<DetectedTarget> DetectorBestTarget;
    10.  
    11.         public void Execute()
    12.         {
    13.             int count = Pairs.Length;
    14.             for (int i = 0; i < count; i++)
    15.             {
    16.                 var pair = Pairs[i];
    17.                 var best = DetectorBestTarget[pair.DetectorIndex];
    18.                 if (best.Metric == 0 || pair.Metric < best.Metric)
    19.                 {
    20.                     DetectorBestTarget[pair.DetectorIndex] = new DetectedTarget { Metric = pair.Metric, TargetIndex = pair.TargetIndex };
    21.                 }
    22.             }
    23.         }
    24.     }
    25. }
     

    Attached Files:

    Last edited: Mar 14, 2023
  21. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    One thing you can try is setting the `UNITY_BURST_DEBUG=1` environment variable before opening the Unity Editor. For example on Windows, do this from the command line, and then open the Editor:

    set UNITY_BURST_DEBUG=1


    Burst will produce lots (and I do mean lots) of log files in your project's Logs folder. They can be a bit hard to read.

    But if you do manage to repro the error while you have that environment variable set, then please send me a copy of your Logs folder and I'll have a look. (I suggest doing that via this forum's private message facility, to avoid sharing it publicly).
     
  22. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    Please could you show the code that calls that job?

    By the way, I don't think it's related, but that job struct doesn't have the
    [BurstCompile]
    attribute on it so it won't be Burst-compiled. But maybe it's called directly from code that is Burst-compiled?
     
  23. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    304
    That was copy paste error, I've fixed it.
    I'll do the logging.

    There's method which schedules it. Detector.Targets is persistent native array.
    The whole process is suboptimal, but I'm just prototyping and learning how to use jobs.

    This error is not specific to SelectTarget job, it happens more or less to every other job I have in the project.

    Code (CSharp):
    1. static JobHandle ScheduleDetection<TEvaluator>(JobHandle handle)
    2.         where TEvaluator : unmanaged, IDetectorEvaluator
    3.     {
    4.         var detectors = DetectorStorage<TEvaluator>.Data;
    5.         var targets = TargetStorage.Data;
    6.  
    7.         if (detectors.Count == 0)
    8.             return handle;
    9.  
    10.         if (Time.frameCount % 100 == 0)
    11.         {
    12.             Debug.Log($"Target detection, targets: {targets.Count}, detectors: {detectors.Count}, queries: {targets.Count * detectors.Count}");
    13.         }
    14.  
    15.         detectors.Targets.Clear();
    16.         JobHandle buildDetectorDataDependency = DetectorStorage<TEvaluator>.ScheduleUpdateTransforms();
    17.  
    18.         int count = targets.Count * detectors.Count;
    19.         NativeStream targetPairsStream = new NativeStream(detectors.Count, Allocator.TempJob);
    20.         NativeStream castsStream = new NativeStream(detectors.Count, Allocator.TempJob);
    21.         NativeList<TargetPair> pairs = new NativeList<TargetPair>(count, Allocator.TempJob);
    22.         NativeArray<RaycastCommand> raycasts = new NativeArray<RaycastCommand>(detectors.Count * EvaluatorSettings<TEvaluator>.MaxRaycastsPerDetector, Allocator.TempJob);
    23.         NativeArray<RaycastHit> raycastHits = new NativeArray<RaycastHit>(detectors.Count * EvaluatorSettings<TEvaluator>.MaxRaycastsPerDetector, Allocator.TempJob);
    24.  
    25.         FindTargetsJob<TEvaluator> findTargets;
    26.         findTargets.Evaluators = detectors.Evaluators;
    27.         findTargets.DetectorTransforms = detectors.Transforms;
    28.         findTargets.TargetTransforms = targets.Transforms;
    29.         findTargets.TargetSettings = targets.Settings;
    30.         findTargets.TargetCount = targets.Count;
    31.         findTargets.Results = targetPairsStream.AsWriter();
    32.         findTargets.Casts = castsStream.AsWriter();
    33.         JobHandle dependency = findTargets.Schedule(detectors.Count, 1, JobHandle.CombineDependencies(buildDetectorDataDependency, handle));
    34.  
    35.         GatherStream gather;
    36.         gather.TargetPairStream = targetPairsStream.AsReader();
    37.         gather.CastStream = castsStream.AsReader();
    38.         gather.Results = pairs;
    39.         gather.Raycasts = raycasts;
    40.         dependency = gather.Schedule(dependency);
    41.  
    42.         // Dispose stream
    43.         var streamDispose = targetPairsStream.Dispose(dependency);
    44.         var castsDispose = castsStream.Dispose(dependency);
    45.  
    46.         dependency = RaycastCommand.ScheduleBatch(raycasts, raycastHits, 128, dependency);
    47.  
    48.         SelectTarget selectJob;
    49.         selectJob.Pairs = pairs;
    50.         selectJob.DetectorBestTarget = detectors.Targets;
    51.         dependency = selectJob.Schedule(dependency);
    52.  
    53.         // Dispose pairs and metrics
    54.         var disposePairs = pairs.Dispose(dependency);
    55.         var disposeRaycasts = raycasts.Dispose(dependency);
    56.         var disposeRaycastHits = raycastHits.Dispose(dependency);
    57.  
    58.         dependency = JobHandle.CombineDependencies(streamDispose, castsDispose, disposePairs);
    59.         dependency = JobHandle.CombineDependencies(dependency, disposeRaycasts, disposeRaycastHits);
    60.  
    61.         return dependency;
    62.     }
     
    Last edited: Mar 14, 2023
  24. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    43
    @tim_jones Thanks, I'll try that. A quick update:

    I'm now very confident it has to do with the Unity.Logging package. I took a couple of days and did a bunch of project clean up that I was going to do anyway: reorganized files, split out my project into a few AsmDefs and, luckily, that clarified the error logs a bit --- it only causes problems on the code-gen'ed bursted functions generated by Unity.Logging (logs attached).

    If I recompile the AsmDef without any calls to the Unity.Logging package (caught a break and hadn't actually begun using this in the entire project) --- it works perfectly fine. But, this AsmDef that has all the existing usages of the Logging package has the issue.

    The attached script is a shortened version of what I'm actually doing, but all the log calls look exactly like that.
     

    Attached Files:

  25. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    Thanks @rauiz. I've tried to repro this bug with calls to Unity.Logging APIs, from a small project, but without any luck so far. If you're able to repro this in a smaller project that you don't mind creating a bug report for, that would be really helpful :) But I realise that's difficult, and I appreciate your efforts so far.
     
  26. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    304
    It's hard, because it does not happen consistently.

    I've noticed that sometimes, Burst does not recompile jobs when code changes. I'm not sure it's related, but it might be. Unticking "Jobs / Enable compilation" fixes the issue (meaning jobs run "correctly" without Burst).

    Typical case when the error "Burst internal compiler error: System.Exception: Error while generating hash for method references:" happened was when I was moving job into other class (as nested) or the other way.
     
  27. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    43
    @tim_jones I'll see what I can do. If I'm successfull, I'll forward you the issue here. Also, for what it's worth, I appreciate how active you and the burst team are in the forums. For the past year, you and most of the DOTS team definitely improved a lot in terms of communication and forum presence (not to mention how good the tech itself is becoming) :D
     
    MarcoPersson and tim_jones like this.
  28. Xipiryon_

    Xipiryon_

    Joined:
    Mar 4, 2022
    Posts:
    1
    Hi,
    I have been able to reproduce the Error while generating hash for method references with this minimal subset of code:

    Code (CSharp):
    1.     public enum SomeEnum { A, B }
    2.  
    3.     [BurstCompile]
    4.     public struct EnumWrapper
    5.     {
    6.         public SomeEnum Value;
    7.  
    8.         [BurstCompile]
    9.         public static implicit operator SomeEnum(EnumWrapper wrapper) => wrapper.Value;
    10.     }
    Removing the BurstCompile attribute on the implicit operator fixes the issue.
    I suppose there may be other use cases that trigger the error but at least this one is 100% repro in my project.
     
  29. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    43
    I stopped seeing that error in the latest version of Burst 1.8.4 and Unity 2022.2.15f1 --- there were a few items on the changelog that could be responsible for fixing it. I recommend anyone seeing an issue that fits the one I had to try and update to these versions and see how that goes.

    I hate when things get fixed magically and with no clear info on what was causing it, but I don't have the time to go through the effort of investigating the exact cause (much to do in the project to go down this rabbit hole). As such, I can't really guarantee the effort of updating will payoff, but... it's at least something to try :D
     
    tim_jones and Xipiryon_ like this.
  30. tim_jones

    tim_jones

    Unity Technologies

    Joined:
    May 2, 2019
    Posts:
    287
    @Xipiryon_ that looks like new instance of this error (similar error message, different underlying cause), so thanks for reporting it, and we'll work on a fix.