jbevain / cecil

Cecil is a library to inspect, modify and create .NET programs and libraries.
MIT License
2.77k stars 630 forks source link

Stackoverflow around a GetHashCode call in unity Burst Compiler #959

Open builder-main opened 3 months ago

builder-main commented 3 months ago

We have an issue related to Cecil that causes a stackoverflow. I'm not sure, I'm looking for any pointers. I dug into unity related issues but couldn't find a solution.

00 000000e7`d8a05fd0 00007ff9`3a2393f1     mscorlib_ni!System.String.GetHashCode+0x7 [f:\dd\ndp\clr\src\BCL\system\string.cs @ 836] 
01 000000e7`d8a06010 00007ff9`3a238d55     mscorlib_ni!System.Collections.Generic.Dictionary<string,System.__Canon>.FindEntry+0x61 [f:\dd\ndp\clr\src\BCL\system\collections\generic\dictionary.cs @ 303] 
02 000000e7`d8a06080 00007ff8`dbcbc594     mscorlib_ni!System.Collections.Generic.Dictionary<string,System.__Canon>.TryGetValue+0x15 [f:\dd\ndp\clr\src\BCL\system\collections\generic\dictionary.cs @ 500] 
03 000000e7`d8a060c0 00007ff8`dbcd505c     Burst_Compiler_IL!Burst.Compiler.IL.AssemblyLoader.Resolve+0x84
04 000000e7`d8a06190 00007ff8`dbf2404b     Unity_Burst_Cecil!Mono.Cecil.MetadataResolver.Resolve+0xac
05 000000e7`d8a061e0 00007ff8`dbf2404b     Unity_Burst_Cecil!Mono.Cecil.MetadataResolver.GetType+0xeb
06 000000e7`d8a06230 00007ff8`dbf2404b     Unity_Burst_Cecil!Mono.Cecil.MetadataResolver.GetType+0xeb
...
31b1 000000e7`d8afe7a0 00007ff8`dbf2404b     Unity_Burst_Cecil!Mono.Cecil.MetadataResolver.GetType+0xeb
31b2 000000e7`d8afe7f0 00007ff8`dbf2404b     Unity_Burst_Cecil!Mono.Cecil.MetadataResolver.GetType+0xeb
31b3 000000e7`d8afe840 00007ff8`dbcd4efa     Unity_Burst_Cecil!Mono.Cecil.MetadataResolver.GetType+0xeb
31b4 000000e7`d8afe890 00007ff8`dbf744da     Unity_Burst_Cecil!Mono.Cecil.TypeReference.Resolve+0x3a
31b5 000000e7`d8afe8c0 00007ff8`dbf74581     Burst_Compiler_IL!Burst.Compiler.IL.Server.EntryPointMethodFinder.CollectGenericTypeInstances+0xaa
31b6 000000e7`d8afe940 00007ff8`dbf655b9     Burst_Compiler_IL!Burst.Compiler.IL.Server.EntryPointMethodFinder.CollectGenericTypeInstances+0x151
31b7 000000e7`d8afe9c0 00007ff8`dbcb9f21     Burst_Compiler_IL!Burst.Compiler.IL.Server.EntryPointMethodFinder.CollectGenericTypeInstances+0x109
31b8 000000e7`d8afeaa0 00007ff8`dbcb6b5b     Burst_Compiler_IL!Burst.Compiler.IL.Server.EntryPointMethodFinder.FindEntryPoints+0x6b1
...
builder-main commented 3 months ago

Could it be related to ? https://github.com/jbevain/cecil/issues/123

KirillOsenkov commented 3 weeks ago

See if https://github.com/jbevain/cecil/pull/806 fixes it