Closed
Description
It fails on random methods with Debug build, e.g.
Assert failure(PID 3357 [0x00000d1d], Thread: 100352 [0x18800]): Assertion failed 'compCyclesAtEnd >= m_compCyclesAtEndOfInlining' in 'System.CommandLine.Parsing.CommandResult:ValidateArguments(ubyte):this' during 'Post-Emit' (IL size 181; hash 0xcb6701c7; FullOpts)
File: /runtime/src/coreclr/jit/compiler.cpp:9511
Image: /root/.dotnet9/dotnet
Abort trap (core dumped)
then:
Assert failure(PID 3368 [0x00000d28], Thread: 101122 [0x18b02]): Assertion failed 'compCyclesAtEnd >= m_compCyclesAtEndOfInlining' in 'Microsoft.DotNet.Cli.EnvironmentVariableNames:.cctor()' during 'Post-Emit' (IL size 213; hash 0x1c79c842; FullOpts)
etc.
root@cbsdnode:~/foo # lldb -- ~/.dotnet9/dotnet restore --packages pkgs
...
(lldb) settings set -- target.run-args "restore" "--packages" "pkgs"
(lldb) break set -f compiler.cpp -l 9511 -c "compCyclesAtEnd < m_compCyclesAtEndOfInlining"
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) r
Process 3356 launched: '/root/.dotnet9/dotnet' (x86_64)
2 locations added to breakpoint 1
warning: libclrjit.so was compiled with optimization - stepping may behave oddly; variables may not be available.
Process 3356 stopped
* thread #1, name = 'dotnet', stop reason = breakpoint 1.1
frame #0: 0x00002269bb736a10 libclrjit.so`Compiler::compCompile(void**, unsigned int*, JitFlags*) [inlined] Compiler::RecordStateAtEndOfCompilation(this=0x00004bee10c87818) at compiler.cpp:9511:5 [opt]
(lldb) p compCyclesAtEnd
(uint64_t) $0 = 392445
(lldb) p m_compCyclesAtEndOfInlining
(uint64_t) $1 = 158170148
(side note: that warning is bogus because it's definitely a debug build)
cc @Thefrank