Repository navigation
SIGSEGV (signal 11) in RuntimeHelpers.CompileMethod called from LambdaCompiler.CreateDelegate() #128255
Description
Activity
- addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on May 15, 2026 - addedarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIand removed
on May 15, 2026 - removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on May 15, 2026 After analyzing additional crash dumps from the same runtime, we see two distinct patterns across ~10 pods.
Pattern 1 — Managed ThreadPool thread: crash at
LambdaCompiler.CreateDelegate()In all of these,
ip2mdshows two simultaneously liveNativeCodeVersionentries forLambdaCompiler.CreateDelegate()(oneOptimizedTier1+Instrumented, oneOptimizedTier1) — consistent with a tiered JIT promotion race.Example 1 — filter path via
ExpressionFilterDefinition+FindOneAndUpdateAsync:[InlinedCallFrame] RuntimeHelpers.CompileMethod(RuntimeMethodHandleInternal) LambdaCompiler.CreateDelegate() [LambdaCompiler.cs @ 265] PartialEvaluator+SubtreeEvaluator.Evaluate(Expression) PartialEvaluator+SubtreeEvaluator.VisitBinary(BinaryExpression) ExpressionFilterDefinition<T>.Render(RenderArgs<T>) MongoCollectionImpl<T>.CreateFindOneAndUpdateOperation(...) MongoCollectionImpl<T>.FindOneAndUpdateAsync(...) [application code]Example 2 — filter path via
ExpressionFilterDefinition+FindAsync:[InlinedCallFrame] RuntimeHelpers.CompileMethod(RuntimeMethodHandleInternal) LambdaCompiler.CreateDelegate() [LambdaCompiler.cs @ 265] PartialEvaluator+SubtreeEvaluator.Evaluate(Expression) PartialEvaluator+SubtreeEvaluator.VisitBinary(BinaryExpression) (×2) ExpressionVisitor.VisitLambda<T>(Expression<T>) ExpressionFilterDefinition<T>.Render(RenderArgs<T>) MongoCollectionImpl<T>.CreateFindOperation(...) MongoCollectionImpl<T>.FindAsync(...) [application code]Example 3 — LINQ3 projection path (
BsonClassMap.MapConstructor, not a filter):[InlinedCallFrame] RuntimeHelpers.CompileMethod(RuntimeMethodHandleInternal) LambdaCompiler.CreateDelegate() [LambdaCompiler.cs @ 265] LambdaCompiler.Compile(LambdaExpression) [LambdaCompiler.cs @ 192] BsonClassMap.MapConstructor() MemberInitExpressionToAggregationExpressionTranslator.Translate() NewExpressionToAggregationExpressionTranslator.Translate() ExpressionToAggregationExpressionTranslator.TranslateLambdaBody() LinqProviderAdapter.TranslateExpressionToProjection() MongoCollectionImpl<T>.CreateFindOperation(...) [application code]
Pattern 2 — Native-only thread: crash inside
libcoreclr.so, no managed framesIn several dumps the crashing thread is absent from
clrthreadsand has no managed frames at all — the entire stack islibcoreclr.so+libc.so.6. The bottom three offsets (0x557986,0x495bee,0x63afb9) are identical across all such dumps and also appear at the bottom of Pattern 1 stacks.Example 1 — SIGSEGV, 18 frames:
#0 +0x110813 libc.so.6 wait4 #1 +0x638261 libcoreclr.so #2 +0x6397f3 libcoreclr.so #3 +0x615e1d libcoreclr.so #4 +0x6152f0 libcoreclr.so #5 +0x045330 libc.so.6 #6 +0x58afd5 libcoreclr.so #7 +0x58bd74 libcoreclr.so #8 +0x590b3c libcoreclr.so #9 +0x57a9d6 libcoreclr.so #10 +0x575481 libcoreclr.so #11 +0x55c1b7 libcoreclr.so #12 +0x558e64 libcoreclr.so #13 +0x557986 libcoreclr.so ← shared fingerprint #14 +0x495bee libcoreclr.so ← shared fingerprint #15 +0x63afb9 libcoreclr.so ← shared fingerprint #16 +0x09caa4 libc.so.6 #17 +0x129c6c libc.so.6Example 2 — SIGSEGV, 16 frames (slightly different upper portion):
#0 +0x110813 libc.so.6 wait4 #1 +0x638261 libcoreclr.so #2 +0x6397f3 libcoreclr.so #3 +0x615e1d libcoreclr.so #4 +0x6152f0 libcoreclr.so #5 +0x045330 libc.so.6 #6 +0x58c06f libcoreclr.so #7 +0x57aa39 libcoreclr.so #8 +0x575481 libcoreclr.so #9 +0x55c1b7 libcoreclr.so #10 +0x558e64 libcoreclr.so #11 +0x557986 libcoreclr.so ← shared fingerprint #12 +0x495bee libcoreclr.so ← shared fingerprint #13 +0x63afb9 libcoreclr.so ← shared fingerprint #14 +0x09caa4 libc.so.6 #15 +0x129c6c libc.so.6Example 3 — SIGTRAP (signal 5, not SIGSEGV — different signal, same fingerprint):
#0 +0x110813 libc.so.6 wait4 #1 +0x638261 libcoreclr.so #2 +0x6397f3 libcoreclr.so #3 +0x636e7d libcoreclr.so #4 +0x615139 libcoreclr.so #5 +0x045330 libc.so.6 #6 +0x2eb405 libcoreclr.so #7 +0x560f3c libcoreclr.so #8 +0x57b65c libcoreclr.so #9 +0x575481 libcoreclr.so #10 +0x55c1b7 libcoreclr.so #11 +0x558e64 libcoreclr.so #12 +0x557986 libcoreclr.so ← shared fingerprint #13 +0x495bee libcoreclr.so ← shared fingerprint #14 +0x63afb9 libcoreclr.so ← shared fingerprint #15 +0x09caa4 libc.so.6 #16 +0x129c6c libc.so.6
The three offsets (
0x557986,0x495bee,0x63afb9) appear in every crash dump we have — both patterns — which strongly suggests they share the same root cause and only differ in which thread is executing the racing code at the moment it corrupts memory.@flibustier7seas just to symbolicate the crash, is it possible to run
dotnet-symbol --symbols libcoreclr.so dotnet-symbol --symbols libclrjit.sothe tool can be installed with
dotnet tool install --global dotnet-symbol(https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-symbol)and is it possible to share the dump?
- addedneeds-author-actionAn issue or pull request that requires more info or actions from the author.An issue or pull request that requires more info or actions from the author.
on May 16, 2026 @flibustier7seas just to symbolicate the crash, is it possible to run
@EgorBo I tried to symbolicate the crash dump. Here is what I got:
root@81d781a88e31:/# apt-get update -qq && apt-get install -y -qq wget root@81d781a88e31:/# wget -q https://dot.net/v1/dotnet-install.sh root@81d781a88e31:/# chmod +x dotnet-install.sh root@81d781a88e31:/# ./dotnet-install.sh --channel 10.0 ... root@81d781a88e31:/# export PATH="$HOME/.dotnet:$PATH" root@81d781a88e31:/# dotnet tool install --global dotnet-symbol ... root@81d781a88e31:/# export PATH="$PATH:$HOME/.dotnet/tools" root@81d781a88e31:/# cd /usr/share/dotnet/shared/Microsoft.NETCore.App/10.0.6/ root@81d781a88e31:/usr/share/dotnet/shared/Microsoft.NETCore.App/10.0.6# dotnet-symbol --symbols libcoreclr.so Downloading from https://msdl.microsoft.com/download/symbols/ Writing: ./libcoreclr.so.dbg root@81d781a88e31:/usr/share/dotnet/shared/Microsoft.NETCore.App/10.0.6# dotnet-symbol --symbols libclrjit.so Downloading from https://msdl.microsoft.com/download/symbols/ Writing: ./libclrjit.so.dbg root@81d781a88e31:/usr/share/dotnet/shared/Microsoft.NETCore.App/10.0.6# apt-get install -y -qq lldb ... root@81d781a88e31:/usr/share/dotnet/shared/Microsoft.NETCore.App/10.0.6# lldb --core /dump/crash.dmp \ -o "settings set target.debug-file-search-paths /usr/share/dotnet/shared/Microsoft.NETCore.App/10.0.6" \ -o "thread select 7" \ -o "bt" \ -o "quit" (lldb) target create --core "/dump/crash.dmp" Core file '/dump/crash.dmp' (x86_64) was loaded. (lldb) settings set target.debug-file-search-paths /usr/share/dotnet/shared/Microsoft.NETCore.App/10.0.6 (lldb) thread select 7 (lldb) bt * thread #7, stop reason = signal SIGTRAP frame #0: 0x00007f2d8374e813 libc.so.6`wait4 + 83 libc.so.6`wait4: -> 0x7f2d8374e813 <+83>: cmpq $-0x1000, %rax ; imm = 0xF000 0x7f2d8374e819 <+89>: ja 0x7f2d8374e848 ; <+136> 0x7f2d8374e81b <+91>: movl %r8d, %edi 0x7f2d8374e81e <+94>: movl %eax, -0x4(%rbp) * thread #7, stop reason = signal SIGTRAP * frame #0: 0x00007f2d8374e813 libc.so.6`wait4 + 83 frame #1: 0x00007f2d834b0261 libcoreclr.so`PROCCreateCrashDump(argv=size=17, errorMessageBuffer=0x0000000000000000, cbErrorMessageBuffer=0, serialize=<unavailable>) at process.cpp:2580:22 [opt] frame #2: 0x00007f2d834b17f3 libcoreclr.so`PROCCreateCrashDumpIfEnabled(signal=<unavailable>, siginfo=<unavailable>, serialize=true) at process.cpp:2807:9 [opt] frame #3: 0x00007f2d834aee7d libcoreclr.so`PROCAbort(signal=5, siginfo=0x00007f2d803f8ef0) at process.cpp:2839:5 [opt] frame #4: 0x00007f2d8348d139 libcoreclr.so`sigtrap_handler(int, siginfo_t*, void*) [inlined] invoke_previous_action(action=<unavailable>, code=5, siginfo=0x00007f2d803f8ef0, context=0x00007f2d803f8dc0, signalRestarts=false) at signal.cpp:447:13 [opt] frame #5: 0x00007f2d8348d11f libcoreclr.so`sigtrap_handler(code=5, siginfo=0x00007f2d803f8ef0, context=0x00007f2d803f8dc0) at signal.cpp:753:5 [opt] frame #6: 0x00007f2d83683330 libc.so.6`___lldb_unnamed_symbol3390 + 1 frame #7: 0x00007f2d83163405 libcoreclr.so`GCToOSInterface::DebugBreak() at gcenv.unix.cpp:507:1 [opt] frame #8: 0x00007f2d833d8f3c libcoreclr.so`SVR::gc_heap::sort_mark_list() [inlined] SVR::FATAL_GC_ERROR() at gcpriv.h:116:5 [opt] frame #9: 0x00007f2d833d8f37 libcoreclr.so`SVR::gc_heap::sort_mark_list(this=0x0000562a3c67fc00) at gc.cpp:10798:13 [opt] frame #10: 0x00007f2d833f365c libcoreclr.so`SVR::gc_heap::mark_phase(this=0x0000562a3c67fc00, condemned_gen_number=0) at gc.cpp:30601:35 [opt] frame #11: 0x00007f2d833ed481 libcoreclr.so`SVR::gc_heap::gc1(this=0x0000562a3c67fc00) at gc.cpp:22707:13 [opt] frame #12: 0x00007f2d833d41b7 libcoreclr.so`SVR::gc_heap::garbage_collect(this=0x0000562a3c67fc00, n=<unavailable>) at gc.cpp:0 [opt] frame #13: 0x00007f2d833d0e64 libcoreclr.so`SVR::gc_heap::gc_thread_function(this=0x0000562a3c67fc00) at gc.cpp:7312:13 [opt] frame #14: 0x00007f2d833cf986 libcoreclr.so`SVR::gc_heap::gc_thread_stub(arg=0x0000562a3c67fc00) at gc.cpp:38021:11 [opt] frame #15: 0x00007f2d8330dbee libcoreclr.so`(anonymous namespace)::CreateNonSuspendableThread(void (*)(void*), void*, char16_t const*)::$_0::__invoke(void*) [inlined] (anonymous namespace)::CreateNonSuspendableThread(void (*)(void*), void*, char16_t const*)::$_0::operator()(this=<unavailable>, argument=<unavailable>) const at gcenv.ee.cpp:1595:13 [opt] frame #16: 0x00007f2d8330dbad libcoreclr.so`(anonymous namespace)::CreateNonSuspendableThread(void (*)(void*), void*, char16_t const*)::$_0::__invoke(argument=<unavailable>) at gcenv.ee.cpp:1576:27 [opt] frame #17: 0x00007f2d834b2fb9 libcoreclr.so`CorUnix::CPalThread::ThreadEntry(pvParam=0x0000562a3c67e630) at thread.cpp:1622:16 [opt] frame #18: 0x00007f2d836daaa4 libc.so.6`___lldb_unnamed_symbol3670 + 900 frame #19: 0x00007f2d83767c6c libc.so.6`___lldb_unnamed_symbol4062 + 7 (lldb) quit root@81d781a88e31:/usr/share/dotnet/shared/Microsoft.NETCore.App/10.0.6#
and is it possible to share the dump?
I will check internally whether we can share the dump file.
- addedneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsiderationIssue has been initially triaged, but needs deeper consideration or reconsiderationand removedneeds-author-actionAn issue or pull request that requires more info or actions from the author.An issue or pull request that requires more info or actions from the author.
on May 16, 2026 Thanks, given the crash happens in the GC, I'm assigning to the @dotnet/gc, perhaps, the stack trace looks familiar
- added and removedarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
on May 16, 2026 The error we are hitting is this FATAL_GC_ERROR() here:
https://github.com/dotnet/runtime/blob/7706f546bac1a99b3d891afe3591dc88c67f0cc4/src/coreclr/gc/gc.cpp#L10793-L10799The comment on this says:
// Due to GC holes, x can point to something in a region that already got freed. And that region's
// allocated would be 0 and cause an infinite loop which is much harder to handle on production than
// simply throwing an exception.This seems to indicate that the primary cause is likely a GC hole. To figure out the problem, a standalone repro would be ideal. We might also find more details from a dump. Without any of these, it is hard to say where is the origin of this problem.
To figure out the problem, a standalone repro would be ideal.
I don't have a standalone reproduction yet - the crashes occur on a large production service running many different workloads simultaneously.
However, in roughly half of the crash dumps the managed thread stacks show MongoDB driver query building via
ExpressionFilterDefinition→PartialEvaluator→LambdaExpression.Compile(). I'll try to build a minimal repro around that pattern.We might also find more details from a dump.
I can't share the full file at the moment, but I'm happy to extract and provide specific data from it.
- addedneeds-author-actionAn issue or pull request that requires more info or actions from the author.An issue or pull request that requires more info or actions from the author.
on Aug 10, 2026 @flibustier7seas were you able to make a minimal repro around it? Any progress in
@kkokosa No, unfortunately not - I haven't managed to reproduce it in a standalone project.
I also can't share the memory dumps from the real application, but if there's something specific that would help, I can try to pull out particular fragments from them - just let me know what to look for.
- removedneeds-author-actionAn issue or pull request that requires more info or actions from the author.An issue or pull request that requires more info or actions from the author.
on Aug 14, 2026 Reproduced: https://github.com/flibustier7seas/dotnet-sigsegv-repro
docker compose up --buildon10.0.3-noble, 4 vCPU / 2.5 GB container limit, server GC with DATAS.Time to crash ranges from 5 minutes to 5 hours.
The fault matches the managed-thread half of our production crashes: SIGSEGV in
LCGMethodResolver::GetCodeInfo(dynamicmethod.cpp:1190), reading the object header of thebyte[]the managed resolver just returned.I have the dump (~5 GB) if you want it.
Can it be related to #131267 ?
It is fixed in
main(is part of .NET 11) and also backported to .NET 10, merged 2026-08-03, targeting milestone 10.0.12 (not yet shipped). So yes, this is the same issue as #131267 - that one was closed as "Fixed by #131708", the same backport.Your repro vs various versions:
Runtime Fix Crashes / runs 10.0.3 (your repro default) no 1 / 1 10.0.6 (your production version) no 1 / 15 10.0.11 (latest patch) no 5 / 12 release/10.0@f8a7519(10.0.12 candidate)yes 0 / 14 11.0.0-rc.1 yes 0 / 7 Reacted by flibustier7seas
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Description
After upgrading our service to .NET 10 (
10.0.626.17701) and updating several libraries including MongoDB.Driver, the service started crashing regularly with SIGSEGV — 3–4 times per week on the same build. The crashes are non-deterministic: different OS threads each time, same method each time.The dump shows the crash occurring inside CLR's native
RuntimeHelpers.CompileMethod(), invoked fromSystem.Linq.Expressions.Compiler.LambdaCompiler.CreateDelegate()at LambdaCompiler.cs line 265.The dump also shows two simultaneously live
OptimizedTier1code versions forCreateDelegate— oneOptimizedTier1 + Instrumentedand oneOptimizedTier1— indicating the JIT was in the middle of a tier transition at crash time.LambdaExpression.Compile()was being called repeatedly and concurrently from a hot path viaMongoDB.DriverLINQ3'sPartialEvaluator.SubtreeEvaluator.Evaluate(), which callsCompile()on every invocation ofExpressionFilterDefinition.Render(). CPU had doubled in the 15 minutes before the crash.Reproduction Steps
The full dump and crashreport.json cannot be shared publicly as they contain references to proprietary application code. The relevant excerpts produced by the analysis script are included in the Script output section below.
The following script reproduces the analysis (requires
dotnet-dump, PowerShell 7+):Script output:
Expected behavior
LambdaExpression.Compile()called concurrently from multiple ThreadPool threads should not causea SIGSEGV. The JIT's tiered recompilation of an internal method should be safe with respect to
concurrent threads executing that method.
Actual behavior
SIGSEGV (signal 11) in the CLR's native
RuntimeHelpers.CompileMethod(), called fromLambdaCompiler.CreateDelegate()at LambdaCompiler.cs line 265. The crash is non-deterministic:three occurrences on the same build, different OS threads each time. The crashed thread's GC mode
is
Cooperative(all other threads:Preemptive), confirming it was inside CLR-managed JITinfrastructure at the time of the fault.
ip2md/dumpmdshow two simultaneously liveOptimizedTier1code versions forCreateDelegateat crash time —
OptimizedTier1 + Instrumented(NativeCodeVersion non-null, still live) andOptimizedTier1(current) — consistent with the JIT being mid-transition between tiers when thefault occurred.
Regression?
Unknown. We are running .NET 10 prerelease
10.0.626.17701and have not tested earlier builds.The service started crashing after upgrading to this build.
Known Workarounds
No response
Configuration
10.0.626.17701Other information
Hypotheses ruled out:
0x7f5756d096a0–0x7f5756d0bd30)ErrornotOOMKilledlibcoreclr.so+libc.so.6(CLR signal handling chain) — no third-party native librarypeon crashed thread: "There is no current managed exception on this thread"