Skip to content

Production server freeze/deadlock on .NET 9.0.7, CPU 0, gdb points to __GI_cfsetispeed in multiple threads #121461

Closed

Description

@vrecluse

Description

Environment

  • .NET Runtime Version: 9.0.7
  • Operating System: Linux Debian 12
  • Architecture: x64
  • GC Mode: Server GC
  • Environment Variable: DOTNET_GCName=libclrgc.so

Problem Description

We are running a .NET 9 server application in our production environment. The server application intermittently experiences a total freeze or deadlock, becoming completely unresponsive.

Observed Symptoms

When the freeze occurs, we observe the following:

  1. No Response: All HTTP API endpoints stop responding.
  2. No Logs: The application stops writing any new logs.
  3. Delayed Timers: We have System.Threading.Timer instances that are observed to trigger significantly later than their scheduled time, indicating the entire process is stalled.
  4. Correlation with GC: The freeze often correlates with a high-activity GC period (e.g., GC pause times reported as > 2 seconds just before the incident).
  5. Process State: During the freeze, htop or top shows the process's CPU usage drops to 0.
  6. Thread Pool: The thread pool queue length drops to near 0, even as new requests should be queuing.
  7. Diagnostics Fail: Attempting to use dotnet-stack report on the hung process also hangs indefinitely and provides no output.

GDB Stack Traces

We successfully attached gdb to the hung process. We found that the vast majority of .NET TP Worker threads are idle, but a few critical threads seem to be involved in a deadlock.

1. Suspicious Stacks (Potential Deadlock)

Two threads, including the crucial .NET SynchManag thread, are stuck in __GI_cfsetispeed. This appears to be the core of the deadlock.

Thread 2 (Thread 0x7fb6b2fb56c0 (LWP 7) ".NET SynchManag"):
#0  0x00007fb6b38c121f in __GI_cfsetispeed (termios_p=0x7fb6b2fb4d78, speed=1) at ../sysdeps/unix/sysv/linux/speed.c:96
#1  0x00007fb6b2fb4db0 in ?? ()
#2  0x00007fb6b2fb4d78 in ?? ()
#3  0x0000000000000001 in ?? ()
#4  0xffffffff00000000 in ?? ()
#5  0x000055a8504b0f58 in ?? ()
#6  0x00007fb6b3628fa0 in ?? () from /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.7/libcoreclr.so
#7  0x00007fb6b3628603 in ?? () from /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.7/libcoreclr.so
#8  0x00007fb6b363214e in ?? () from /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.7/libcoreclr.so
#9  0x00007fb6b384e1f5 in __pthread_create_2_1 (newthread=<optimized out>, attr=<optimized out>, start_routine=<optimized out>, arg=<optimized out>) at ./nptl/pthread_create.c:846
#10 0x0000000000000000 in ?? ()

Thread 181 (Thread 0x7e83927fc6c0 (LWP 255) "rdk:broker10265"):
#0  0x00007fb6b38c121f in __GI_cfsetispeed (termios_p=0x7e83740049b8, speed=2) at ../sysdeps/unix/sysv/linux/speed.c:96
#1# 0x0000000000000000 in ?? ()

2. Idle Worker Threads

Most other threads, especially .NET TP Worker threads, are idle and appear to be waiting for work (stuck in __pthread_attr_extension).

Thread 194 (Thread 0x7e8651ffb6c0 (LWP 311668) ".NET TP Worker"):
#0  0x00007fb6b384af16 in __pthread_attr_extension (attr=0x0) at ./nptl/pthread_attr_extension.c:30
#1  0x0000000000000189 in ?? ()
#2  0x000055a8504e83b8 in ?? ()
#3  0x0000000000000000 in ?? ()

Thread 193 (Thread 0x7e84fdffb6c0 (LWP 311660) ".NET TP Worker"):
#0  0x00007fb6b384af16 in __pthread_attr_extension (attr=0x0) at ./nptl/pthread_attr_extension.c:30
#1  0x000055a800000189 in ?? ()
#2  0x000055a8504e83b8 in ?? ()
#3  0x0000000000000000 in ?? ()

Thread 192 (Thread 0x7e851effd6c0 (LWP 311650) ".NET TP Worker"):
#0  0x00007fb6b384af16 in __pthread_attr_extension (attr=0x0) at ./nptl/pthread_attr_extension.c:30
#1  0x0000000000000189 in ?? ()
#2  0x000055a8504e83b8 in ?? ()
#3  0x0000000000000000 in ?? ()

Summary

The presence of __GI_cfsetispeed in the stack for the .NET SynchManag thread is highly suspicious and suggests a potential native-level deadlock, possibly within glibc or how the runtime interacts with it. This stall prevents all managed code (including timers and the thread pool) from making progress.

Given that diagnostic tools like dotnet-stack also fail, this points to a very low-level lock or stall.


Reproduction Steps

Hard to reproduce, occured sometimes in production environment

Expected behavior

Should not hang forever

Actual behavior

Hangs forever

Regression?

No response

Known Workarounds

No response

Configuration

  • .NET Runtime Version: 9.0.7
  • Operating System: Linux (inferred from stack trace)
  • Architecture: x64 (inferred from stack trace)
  • GC Mode: Server GC
  • Environment Variable: DOTNET_GCName=libclrgc.so

Other information

No response

Activity

  1. added
    untriaged
    on Nov 8, 2025
  2. added
    needs-area-label
    on Nov 8, 2025
  3. am11 commented on Nov 8, 2025

    @am11
    Member

    The presence of __GI_cfsetispeed in the stack for the .NET SynchManag thread is highly suspicious and suggests a potential native-level deadlock, possibly within glibc or how the runtime interacts with it. This stall prevents all managed code (including timers and the thread pool) from making progress.

    Do you have full backtrace to __GI_cfsetispeed? You can use dotnet symbol to download the native runtime symbols:

    $ dotnet tool install --global dotnet-symbol
    $ dotnet symbol --recurse-subdirectories --timeout 20 --symbols '/usr/share/dotnet/*.so'

    The only place we are (explicitly) calling cfsetispeed(3p) is in src/native/libs/System.IO.Ports.Native/pal_termios.c, so unless you are using System.IO.Ports to connect to serial/comm interfaces etc. that's likely something outside the runtime causing it.

  4. vrecluse commented on Nov 8, 2025

    @vrecluse
    Author

    The presence of __GI_cfsetispeed in the stack for the .NET SynchManag thread is highly suspicious and suggests a potential native-level deadlock, possibly within glibc or how the runtime interacts with it. This stall prevents all managed code (including timers and the thread pool) from making progress.

    Do you have full backtrace to __GI_cfsetispeed? You can use dotnet symbol to download the native runtime symbols:

    $ dotnet tool install --global dotnet-symbol
    $ dotnet symbol --recurse-subdirectories --timeout 20 --symbols '/usr/share/dotnet/*.so'
    The only place we are (explicitly) calling cfsetispeed(3p) is in src/native/libs/System.IO.Ports.Native/pal_termios.c, so unless you are using System.IO.Ports to connect to serial/comm interfaces etc. that's likely something outside the runtime causing it.

    No, the server has been restarted. We don't use System.IO.Ports directly. Any other clues or workarounds? What can I do if next time it happens again?

  5. am11 commented on Nov 8, 2025

    @am11
    Member

    It would be nice if you could get the native symbols uploaded to the server then capture the error logs and/or coredump.

    For selfhosted/singlefile publish, you could uploaded the .dbg file(s) by running dotnet-symbol command on build machine. For framework-dependent deployment (e.g. on VM server), you could run dotnet-symbol command on the target machine as shown above (which will place .dbg files for all native libs like libcoreclr.so etc. next to the shared libs).

  6. vrecluse commented on Nov 8, 2025

    @vrecluse
    Author

    It would be nice if you could get the native symbols uploaded to the server then capture the error logs and/or coredump.

    For selfhosted/singlefile publish, you could uploaded the .dbg file(s) by running dotnet-symbol command on build machine. For framework-dependent deployment (e.g. on VM server), you could run dotnet-symbol command on the target machine as shown above (which will place .dbg files for all native libs like libcoreclr.so etc. next to the shared libs).

    I captured core dump with gcore.
    Does this commands require excactly the same environment as the core dump generated (os version, dotnet runtime version, etc)?

    $ dotnet tool install --global dotnet-symbol
    $ dotnet symbol --recurse-subdirectories --timeout 20 --symbols '/usr/share/dotnet/*.so'
    
  7. am11 commented on Nov 9, 2025

    @am11
    Member

    It depends on how you published the app. If you are using:

    • framework-dependent deployment (i.e. you have dotnet runtime installed on the server), then you'd need to run dotnet symbol --recurse.. command on the server by adjusting the path to dotnet install directory.
    • for self-contained or singlefile apps, you can run the symbol command for your publish directory which will download all the required .dbg files next to the binaries on build machine before deployment: find /path/to/your-publish-dir -type f -exec sh -c 'for f; do file -L --mime-type "$f" 2>/dev/null | grep -qE "application/x-(sharedlib|(pie-)?executable)" && echo "$f"; done' _ {} + | xargs dotnet symbol --timeout 20
  8. dotnet-policy-service commented on Nov 10, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @mangod9
    See info in area-owners.md if you want to be subscribed.

  9. removed
    needs-area-label
    on Nov 10, 2025
  10. vrecluse commented on Nov 11, 2025

    @vrecluse
    Author

    It depends on how you published the app. If you are using:

    • framework-dependent deployment (i.e. you have dotnet runtime installed on the server), then you'd need to run dotnet symbol --recurse.. command on the server by adjusting the path to dotnet install directory.
    • for self-contained or singlefile apps, you can run the symbol command for your publish directory which will download all the required .dbg files next to the binaries on build machine before deployment: find /path/to/your-publish-dir -type f -exec sh -c 'for f; do file -L --mime-type "$f" 2>/dev/null | grep -qE "application/x-(sharedlib|(pie-)?executable)" && echo "$f"; done' _ {} + | xargs dotnet symbol --timeout 20

    It's framework-dependent deployment on k8s. The noted stacks with symbols:

    Thread 2 (Thread 0x7fb6b2fb56c0 (LWP 7) ".NET SynchManag"):
    #0  0x00007fb6b38c121f in __GI_cfsetispeed (termios_p=0x7fb6b2fb4d78, speed=1) at ../sysdeps/unix/sysv/linux/speed.c:96
    #1  0x00007fb6b2fb4db0 in ?? ()
    #2  0x00007fb6b2fb4d78 in ?? ()
    #3  0x0000000000000001 in ?? ()
    #4  0xffffffff00000000 in ?? ()
    #5  0x000055a8504b0f58 in ?? ()
    #6  0x00007fb6b3628fa0 in CorUnix::CPalSynchronizationManager::ReadBytesFromProcessPipe (this=this@entry=0x55a85050bbc0, iTimeout=iTimeout@entry=-1, pRecvBuf=pRecvBuf@entry=0x7fb6b2fb4df7 "", iBytes=iBytes@entry=1) at /__w/1/s/src/coreclr/pal/src/synchmgr/synchmanager.cpp:2238
    #7  0x00007fb6b3628603 in CorUnix::CPalSynchronizationManager::ReadCmdFromProcessPipe (this=0x55a85050bbc0, iPollTimeout=-1, pswcWorkerCmd=<optimized out>, pshridMarshaledData=<optimized out>, pdwData=<optimized out>) at /__w/1/s/src/coreclr/pal/src/synchmgr/synchmanager.cpp:2016
    #8  CorUnix::CPalSynchronizationManager::WorkerThread (pArg=0x55a85050bbc0) at /__w/1/s/src/coreclr/pal/src/synchmgr/synchmanager.cpp:1719
    #9  0x00007fb6b363214e in CorUnix::CPalThread::ThreadEntry (pvParam=0x55a8504b0f40) at /__w/1/s/src/coreclr/pal/src/thread/thread.cpp:1744
    #10 0x00007fb6b384e1f5 in __pthread_create_2_1 (newthread=<optimized out>, attr=<optimized out>, start_routine=<optimized out>, arg=<optimized out>) at ./nptl/pthread_create.c:846
    #11 0x0000000000000000 in ?? ()
    
    
    Thread 67 (Thread 0x7e8764be66c0 (LWP 73) ".NET SigHandler"):
    #0  0x00007fb6b38bd29c in __getcwd_generic (size=<optimized out>, buf=<optimized out>) at ../sysdeps/posix/getcwd.c:464
    #1  __GI___getcwd (buf=<optimized out>, size=<optimized out>) at ../sysdeps/unix/sysv/linux/getcwd.c:110
    #2  0x0000000000000000 in ?? ()
    
    Thread 108 (Thread 0x7e85fbfff6c0 (LWP 168) ".NET File Watch"):
    #0  0x00007fb6b38bd29c in __getcwd_generic (size=<optimized out>, buf=<optimized out>) at ../sysdeps/posix/getcwd.c:464
    #1  __GI___getcwd (buf=<optimized out>, size=<optimized out>) at ../sysdeps/unix/sysv/linux/getcwd.c:110
    #2  0x00007fb6b36cfb38 in ?? () from /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.7/libcoreclr.so
    #3  0x00000000fffffffc in ?? ()
    #4  0x00007e85f4001cc8 in ?? ()
    #5  0x00007eb71c72e3e0 in ?? ()
    #6  0x00007eb71c303450 in ?? ()
    #7  0x0000000000000000 in ?? ()
    
    Thread 122 (Thread 0x7e84ab7fe6c0 (LWP 182) ".NET BGC"):
    #0  0x00007fb6b384af16 in __pthread_attr_extension (attr=0x0) at ./nptl/pthread_attr_extension.c:30
    #1  0x00007fb600000189 in ?? ()
    #2  0x00007fb6b3718404 in CorUnix::CPalSynchronizationManager::s_csSynchProcessLock () from /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.7/libcoreclr.so
    #3  0x0000000000000000 in ?? ()
    
    Thread 126 (Thread 0x7e84a97fa6c0 (LWP 186) ".NET BGC"):
    #0  0x00007fb6b384af16 in __pthread_attr_extension (attr=0x0) at ./nptl/pthread_attr_extension.c:30
    #1  0xffffffff00000189 in ?? ()
    #2  0x00007fb6b3718404 in CorUnix::CPalSynchronizationManager::s_csSynchProcessLock () from /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.7/libcoreclr.so
    #3  0x0000000000000000 in ?? ()
    
    Thread 151 (Thread 0x7e842affd6c0 (LWP 211) ".NET BGC"):
    #0  0x00007fb6b384af16 in __pthread_attr_extension (attr=0x0) at ./nptl/pthread_attr_extension.c:30
    #1  0x0000000000000189 in ?? ()
    #2  0x00007fb6b3718404 in CorUnix::CPalSynchronizationManager::s_csSynchProcessLock () from /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.7/libcoreclr.so
    #3  0x0000000000000000 in ?? ()
    
    
    Thread 179 (Thread 0x7e83c0ff96c0 (LWP 251) "rdk:broker10265"):
    #0  0x00007fb6b38c121f in __GI_cfsetispeed (termios_p=0x7e8384005a98, speed=2) at ../sysdeps/unix/sysv/linux/speed.c:96
    #1  0x0000000000000000 in ?? ()
    
    

    The other call stacks are still like

    Thread 220 (Thread 0x7e85d9ffb6c0 (LWP 311745) ".NET TP Worker"):
    #0  0x00007fb6b384af16 in __pthread_attr_extension (attr=0x0) at ./nptl/pthread_attr_extension.c:30
    #1  0x0000000000000189 in ?? ()
    #2  0x000055a8504e83b8 in ?? ()
    #3  0x0000000000000000 in ?? ()
    
    

    @am11

  11. vrecluse commented on Nov 11, 2025

    @vrecluse
    Author

    related locals:

    (gdb) bt
    
    #0  0x00007fb6b38c121f in __GI_cfsetispeed (termios_p=0x7fb6b2fb4d78, speed=1) at ../sysdeps/unix/sysv/linux/speed.c:96
    #1  0x00007fb6b2fb4db0 in ?? ()
    #2  0x00007fb6b2fb4d78 in ?? ()
    #3  0x0000000000000001 in ?? ()
    #4  0xffffffff00000000 in ?? ()
    #5  0x000055a8504b0f58 in ?? ()
    #6  0x00007fb6b3628fa0 in CorUnix::CPalSynchronizationManager::ReadBytesFromProcessPipe (this=this@entry=0x55a85050bbc0, iTimeout=iTimeout@entry=-1, pRecvBuf=pRecvBuf@entry=0x7fb6b2fb4df7 "", iBytes=iBytes@entry=1)
        at /__w/1/s/src/coreclr/pal/src/synchmgr/synchmanager.cpp:2238
    #7  0x00007fb6b3628603 in CorUnix::CPalSynchronizationManager::ReadCmdFromProcessPipe (this=0x55a85050bbc0, iPollTimeout=-1, pswcWorkerCmd=<optimized out>, pshridMarshaledData=<optimized out>, pdwData=<optimized out>)
        at /__w/1/s/src/coreclr/pal/src/synchmgr/synchmanager.cpp:2016
    #8  CorUnix::CPalSynchronizationManager::WorkerThread (pArg=0x55a85050bbc0) at /__w/1/s/src/coreclr/pal/src/synchmgr/synchmanager.cpp:1719
    #9  0x00007fb6b363214e in CorUnix::CPalThread::ThreadEntry (pvParam=0x55a8504b0f40) at /__w/1/s/src/coreclr/pal/src/thread/thread.cpp:1744
    #10 0x00007fb6b384e1f5 in __pthread_create_2_1 (newthread=<optimized out>, attr=<optimized out>, start_routine=<optimized out>, arg=<optimized out>) at ./nptl/pthread_create.c:846
    #11 0x0000000000000000 in ?? ()
    (gdb) info locals
    
    iErrno = 0
    Poll = {fd = 3, events = 1, revents = 0}
    iRet = <optimized out>
    iConsecutiveEintrs = <optimized out>
    iBytesRead = 0
    pPos = 0x7fb6b2fb4df7 ""
    (gdb) up
    
    #7  0x00007fb6b3628603 in CorUnix::CPalSynchronizationManager::ReadCmdFromProcessPipe (this=0x55a85050bbc0, iPollTimeout=-1, pswcWorkerCmd=<optimized out>, pshridMarshaledData=<optimized out>, pdwData=<optimized out>)
        at /__w/1/s/src/coreclr/pal/src/synchmgr/synchmanager.cpp:2016
    2016    in /__w/1/s/src/coreclr/pal/src/synchmgr/synchmanager.cpp
    (gdb) info locals
    
    swcWorkerCmd = CorUnix::CPalSynchronizationManager::SynchWorkerCmdNop
    byVal = 0 '\000'
    iRet = <optimized out>
    shridMarshaledId = <optimized out>
    dwData = <optimized out>
    (gdb) up
    
    #8  CorUnix::CPalSynchronizationManager::WorkerThread (pArg=0x55a85050bbc0) at /__w/1/s/src/coreclr/pal/src/synchmgr/synchmanager.cpp:1719
    1719    in /__w/1/s/src/coreclr/pal/src/synchmgr/synchmanager.cpp
    (gdb) info locals
    
    lProcessCount = <optimized out>
    fShuttingDown = false
    fWorkerIsDone = false
    iPollTimeout = -1
    pthrWorker = 0x55a8504b0f40
    shridMarshaledData = <optimized out>
    palErr = <optimized out>
    swcCmd = <optimized out>
    dwData = <optimized out>
    twrWakeUpReason = <optimized out>
    ptnwdWorkerThreadNativeData = <optimized out>
    iRet = <optimized out>
    pSynchManager = <optimized out>
    (gdb) 
    
    
  12. am11 commented on Nov 11, 2025

    @am11
    Member

    .NET SynchManag thread might not be interesting, but BGC ones seem like runtime is stalling in GC (probably due to contention around s_csSynchProcessLock?)

    cc @janvorli

  13. janvorli commented on Nov 11, 2025

    @janvorli
    Member

    @vrecluse could you please capture the stack traces using lldb instead of gdb? GDB is unable to walk frames of the .NET managed code and usually a first managed frame puts it off the rails.

  14. 6 remaining items

  15. vrecluse commented on Nov 12, 2025

    @vrecluse
    Author

    Is this thread suspicious? No GCEvent::Wait on stack:
    @jkotas

            Child SP               IP Call Site
    00007E85FBFFE930 00007FB6B38BD29C libc.so.6!read + 12 at sysdeps/unix/sysv/linux/read.c:26
    00007E85FBFFE938 0073006500690074 
    00007E85FBFFE990 00007FB63638390C 
    00007E85FBFFE9B8                  [InlinedCallFrame: 00007e85fbffe9b8] 
    00007E85FBFFE9B8                  [InlinedCallFrame: 00007e85fbffe9b8] 
    00007E85FBFFE990 00007FB6363838EF System.IO.FileSystem.Watcher.dll!Interop+Sys.Read(System.Runtime.InteropServices.SafeHandle, Byte*, Int32) + 143 [/_/artifacts/obj/System.IO.FileSystem.Watcher/Release/net9.0-linux/Microsoft.Interop.LibraryImportGenerator/Microsoft.Interop.LibraryImportGenerator/LibraryImports.g.cs @ 22]
    00007E85FBFFEA50 00007FB636387C71 System.IO.FileSystem.Watcher.dll!System.IO.FileSystemWatcher+RunningInstance.TryReadEvent(NotifyEvent ByRef) + 129 [/_/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.Linux.cs @ 804]
    00007E85FBFFEAD0 00007FB636387AA4 System.IO.FileSystem.Watcher.dll!System.IO.FileSystemWatcher+RunningInstance.ProcessEvents() + 212 [/_/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.Linux.cs @ 763]
    00007E85FBFFEB80 00007FB6B347F5B4 libcoreclr.so!CallDescrWorkerInternal + 124 at /__w/1/s/src/coreclr/vm/amd64/calldescrworkeramd64.S:74
    00007E85FBFFEBA0 00007FB6B32BBBC5 libcoreclr.so!DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 245 at /__w/1/s/src/coreclr/pal/inc/pal.h:4239
    00007E85FBFFEBA0 00007FB6B32BBB6E libcoreclr.so!DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 158 at /__w/1/s/src/coreclr/vm/threads.inl:42
    00007E85FBFFEC30 00007FB6B32D1882 libcoreclr.so!ThreadNative::KickOffThread_Worker(void*) + 146 at /__w/1/s/src/coreclr/vm/comsynchronizable.cpp:158
    00007E85FBFFEC80 00007FB6B3289DC8 libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 344 at /__w/1/s/src/coreclr/vm/threads.inl:42
    00007E85FBFFEC80 00007FB6B3289DC6 libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 342 at /__w/1/s/src/coreclr/vm/threads.cpp:7126
    00007E85FBFFEC80 00007FB6B3289D77 libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 263 at /__w/1/s/src/coreclr/vm/threads.inl:37
    00007E85FBFFEC80 00007FB6B3289D77 libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 263 at /__w/1/s/src/coreclr/vm/threads.inl:37
    00007E85FBFFEC80 00007FB6B3289D51 libcoreclr.so!ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 225 at /__w/1/s/src/coreclr/pal/inc/pal.h:4257
    00007E85FBFFECA0                  [DebuggerU2MCatchHandlerFrame: 00007e85fbffeca0] 
    00007E85FBFFED90 00007FB6B328A27D libcoreclr.so!ManagedThreadBase::KickOff(void (*)(void*), void*) + 45 at /__w/1/s/src/coreclr/vm/threads.cpp:7410
    00007E85FBFFED90 00007FB6B328A265 libcoreclr.so!ManagedThreadBase::KickOff(void (*)(void*), void*) + 21 at /__w/1/s/src/coreclr/vm/threads.cpp:7100
    00007E85FBFFEDC0 00007FB6B32D199C libcoreclr.so!ThreadNative::KickOffThread(void*) + 252 at /__w/1/s/src/coreclr/vm/comsynchronizable.cpp:230
    00007E85FBFFEE30 00007FB6B363214E libcoreclr.so!CorUnix::CPalThread::ThreadEntry(void*) + 510 at /__w/1/s/src/coreclr/pal/src/include/pal/thread.hpp:454
    00007E85FBFFEEE0 00007FB6B384E1F5 libc.so.6!start_thread + 773 at nptl/nptl/pthread_create.c:442
    00007E85FBFFEF80 00007FB6B38CE89C libc.so.6!__closefrom_fallback + 460 at sysdeps/unix/sysv/linux/closefrom_fallback.c:52
    
  16. vrecluse commented on Nov 12, 2025

    @vrecluse
    Author

    Here are stacks without GCEvent::Impl::Wait

    nogcwait.txt

  17. janvorli commented on Nov 12, 2025

    @janvorli
    Member

    @vrecluse can you please run clrthreads instead of sos threads?

  18. vrecluse commented on Nov 12, 2025

    @vrecluse
    Author

    @vrecluse can you please run clrthreads instead of sos threads?

    @janvorli seems all preemptive

    (lldb) clrthreads
    ThreadCount:      184
    UnstartedThread:  0
    BackgroundThread: 149
    PendingThread:    0
    DeadThread:       34
    Hosted Runtime:   no
                                                                                                                Lock  
     DBG   ID     OSID ThreadOBJ           State GC Mode     GC Alloc Context                  Domain           Count Apt Exception
       1    1        1 000055A8504D0E60  2020020 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
       6    2        b 000055A8504B54E0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Finalizer) 
      68    4       4a 000055A8510C7300    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      69    6       4c 00007E8660004310  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
      70    8       4e 000055A851294BF0  2021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      71   11       51 00007E864800C3E0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      72   12       52 00007E8648016FD0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      73   19       5f 000055A8511EA580  2021220 Preemptive  00007EB6303B0FD8:00007EB6303B1968 000055A8504B9770 -00001 Ukn 
     185   20      10d 000055A8513FCE90    21220 Preemptive  00007EC3312A59C0:00007EC3312A78D8 000055A8504B9770 -00001 Ukn 
      74   21       60 000055A851D3F3B0  2021220 Preemptive  00007E8A29372880:00007E8A29373A68 000055A8504B9770 -00001 Ukn 
      75   22       61 000055A851D40B50  2021220 Preemptive  00007E8A293365E0:00007E8A29337B00 000055A8504B9770 -00001 Ukn 
      76   23       62 000055A851D424C0  2021220 Preemptive  00007E9130B600D0:00007E9130B617D8 000055A8504B9770 -00001 Ukn 
      77   24       63 000055A851D43C70  2021220 Preemptive  00007E9430D50968:00007E9430D523B0 000055A8504B9770 -00001 Ukn 
      78   25       64 000055A851D45A50  2021220 Preemptive  00007E8A29350AB8:00007E8A29351F00 000055A8504B9770 -00001 Ukn 
      79   26       65 000055A851D47830  2021220 Preemptive  00007E8A293743F8:00007E8A29375A88 000055A8504B9770 -00001 Ukn 
      80   27       66 000055A851D49610  2021220 Preemptive  00007E8A29332BB8:00007E8A29333AC0 000055A8504B9770 -00001 Ukn 
      81   28       67 000055A851D4B410  2021220 Preemptive  00007E8A29352DB8:00007E8A29353F20 000055A8504B9770 -00001 Ukn 
      82   29       68 000055A851D4D230  2021220 Preemptive  00007E9E30FEE810:00007E9E30FEFE18 000055A8504B9770 -00001 Ukn 
      83   30       69 000055A851D4F050  2021220 Preemptive  00007E8A2934EBF8:00007E8A2934FEE0 000055A8504B9770 -00001 Ukn 
      84   50       7d 000055A852C98C40    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      85   51       7e 000055A852C983A0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      87   52       80 00007E859C00E6D0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      86   53       7f 00007E8598006FA0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      88   54       81 00007E859800E8A0  2021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      89   55       82 00007E859C011240  2021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      90   56       83 000055A851B69990    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      91   57       84 000055A8513D7620    21220 Preemptive  00007E9C31681E10:00007E9C31683C90 000055A8504B9770 -00001 Ukn 
      92   58       85 000055A851447B30    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      93   59       86 000055A85140C230    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      94   60       87 000055A85140E030    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      95   61       88 000055A85141F780    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      96   62       89 00007E85780012B0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      97   63       8a 00007E8574001430    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      98   64       8b 00007E8584001AB0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     101   65       8e 00007E8580001520    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     100   66       8d 00007E8568003150    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
      99   67       8c 00007E8570001140    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     102   68       8f 00007E8578003760  2021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     103   69       90 00007E8574003480  2021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     104   70       91 00007E8584003CC0  2021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     105   71       92 00007E8570002F60  2021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     106   72       93 00007E8568004F70  2021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     107   73       94 00007E85800039A0  2021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     108   93       a8 000055A8513E7C00    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     109   94       a9 000055A852C2C510    21220 Preemptive  00007E8A29382470:00007E8A29383B68 000055A8504B9770 -00001 Ukn 
     110   95       aa 00007E8760000F70    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (GC) 
     111   96       ab 00007E8760002E00    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     112   97       ac 00007E8760004C20    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     113   98       ad 00007E8760006A40    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     114   99       ae 00007E8760008860    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     115  100       af 00007E876000A680    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     116  101       b0 00007E876000C4A0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     117  102       b1 00007E876000E2C0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     118  103       b2 00007E87600100E0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     119  104       b3 00007E8760011F00    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     120  105       b4 00007E8760013D20    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     121  106       b5 00007E8760015B40    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     122  107       b6 00007E8760017960    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     123  108       b7 00007E8760019780    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     124  109       b8 00007E876001B5A0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     125  110       b9 00007E876001D3C0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     126  111       ba 00007E876001F1E0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     127  112       bb 00007E8760021000    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     128  113       bc 00007E8760022E20    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     129  114       bd 00007E8760024C40    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     130  115       be 00007E8760026A60    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     131  116       bf 00007E8760028880    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     132  117       c0 00007E876002A6A0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     133  118       c1 00007E876002C4C0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     134  119       c2 00007E876002E2E0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     135  120       c3 00007E8760030100    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     136  121       c4 00007E8760031F20    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     137  122       c5 00007E8760033D40    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     138  123       c6 00007E8760035B60    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     139  124       c7 00007E8760037980    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     140  125       c8 00007E87600397A0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     141  126       c9 00007E876003B5C0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     142  127       ca 00007E876003D3E0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     143  128       cb 00007E876003F200    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     144  129       cc 00007E8760041830    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     145  130       cd 00007E8760043650    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     146  131       ce 00007E8760045470    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     147  132       cf 00007E8760047290    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     148  133       d0 00007E87600490B0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     149  134       d1 00007E876004AED0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     150  135       d2 00007E876004CCF0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     151  136       d3 00007E876004EB10    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     152  137       d4 00007E8760050930    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     153  138       d5 00007E8760052750    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     154  139       d6 00007E8760054570    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     155  140       d7 00007E8760056390    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     156  141       d8 00007E87600581B0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     157  142       d9 00007E8760059FD0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     158  143       da 00007E876005BDF0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     159  144       db 00007E876005DC10    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     160  145       dc 00007E876005FA30    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     161  146       dd 00007E8760061850    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     162  147       de 00007E8760063670    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     163  148       df 00007E8760065490    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     164  149       e0 00007E87600672B0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     165  150       e1 00007E87600690D0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     166  151       e2 00007E876006AEF0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     167  152       e3 00007E876006CD10    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     168  153       e4 00007E876006EB30    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     169  154       e5 00007E8760070950    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     172   18       f1 00007E85280072E0    21220 Preemptive  00007E8A29F744F0:00007E8A29F74A68 000055A8504B9770 -00001 Ukn 
     175   17       f5 00007E8528048E60    21220 Preemptive  00007E8A29F67300:00007E8A29F689A8 000055A8504B9770 -00001 Ukn 
     182  157      105 00007E8528032C00    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     183  158      106 00007E8528033060    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     184  159      107 00007E864808BFF0    21220 Preemptive  00007E9B2FEE2E38:00007E9B2FEE4DE0 000055A8504B9770 -00001 Ukn 
     186  188    3e846 00007E85D0099390    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
    XXXX   81        0 00007E82F401F900  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  170        0 00007E82E4110F00  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  160        0 00007E85E00E9AE0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  193        0 00007E828800F4A0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  207        0 00007E828C126A00  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     187  168    4c10c 00007E82F40F4F50  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX   10        0 00007E85EC144E30  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  191        0 00007E837C0970D0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     188   44    4c138 00007E86481DCA90  1021220 Preemptive  00007EA031211C20:00007EA031212C70 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     189    5    4c13e 00007E82EC00FDE0  1021220 Preemptive  00007EB2316A31C8:00007EB2316A3FE0 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX   79        0 00007E830C0518F0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX   46        0 00007E8518159DA0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     190   89    4c151 00007E82E410E0A0  1021220 Preemptive  00007E8F2FF0A870:00007E8F2FF0AF50 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     191    7    4c152 00007E82780026F0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX   74        0 00007E85AC1DD810  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  186        0 00007E85A411A130    31820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
    XXXX   33        0 00007E862815F980  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     192  171    4c162 00007E8258017F10  1021220 Preemptive  00007E8A2A223888:00007E8A2A224F00 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  203        0 00007E8334054DD0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     193  163    4c16c 00007E85B405BDD0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     195  198    4c175 00007E85F013BB50  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     194  209    4c174 00007E830010EEC0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX    9        0 00007E85B417D770  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  204        0 00007E82640179C0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  200        0 00007E8288029320  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     196   76    4c17e 00007E833C02E870  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     197  179    4c180 00007E837C08E120  1021220 Preemptive  00007EB5300312E8:00007EB530032AA0 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX   78        0 00007E85F005B820  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     200  194    4c184 00007E85E004F8A0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     198   40    4c181 00007E837811BCD0  1021220 Preemptive  00007E8A29AF5C70:00007E8A29AF75C8 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     199   43    4c183 00007E84F005AAF0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  167        0 00007E838C0075E0    31820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     201   88    4c190 00007E85E4063D10  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     202   16    4c191 00007E8258002EC0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX   82        0 00007E828802DD30  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  219        0 00007E837813C220  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX   87        0 00007E828C126E60  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     203   90    4c19b 00007E83340FC460  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  182        0 00007E8328030ED0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     204  156    4c19e 00007E851814A2A0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  197        0 00007E838C128E10  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     205   49    4c1a0 00007E837C06E570  1021220 Preemptive  00007E972FCDCDF8:00007E972FCDE748 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX   38        0 00007E84F01202D0    31820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
    XXXX  215        0 00007E828C001150    31820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     206  155    4c1a3 00007E83781163F0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     207   84    4c1a5 00007E852C08D000  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  181        0 00007E8264022AF0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     208   35    4c1a7 00007E830C021B90  1021220 Preemptive  00007E8E314E6928:00007E8E314E7860 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     209    3    4c1a8 00007E834000D350  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     210   86    4c1a9 00007E8640107E20  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  172        0 00007E82580191E0    31820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     211  213    4c1b2 00007E8524019940    21220 Preemptive  00007E8A29406AF8:00007E8A29408AC8 000055A8504B9770 -00001 Ukn 
     212  212    4c1b4 00007E826C016A20  1021220 Preemptive  00007EA930D57058:00007EA930D58E50 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     213   39    4c1b6 00007E82800B2DE0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     214  173    4c1b7 00007E8258004980  1021220 Preemptive  00007EB63005A368:00007EB63005AFB0 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX   48        0 00007E85EC04B4E0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     215  199    4c1b9 00007E85041164F0  1021220 Preemptive  00007EB6303B35E8:00007EB6303B3988 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     216  192    4c1ba 00007E826C0127A0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     217  180    4c1bb 00007E85040969C0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
    XXXX   32        0 00007E8510142420    31820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
    XXXX  189        0 00007E831C034760    31820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     218   37    4c1be 00007E85A8027ED0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  187        0 00007E86300497D0  1031820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     219  175    4c1c0 00007E830C008A90  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     220   14    4c1c1 00007E85A4125AA0  1021220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     221  201    4c1c2 00007E828C0FDE20  1021220 Preemptive  00007E8A29393008:00007E8A29393C68 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     222   41    4c1c3 00007E8644003890  1021220 Preemptive  00007E972FC5D518:00007E972FC5D5D0 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
     223   80    4c1c4 00007E837802CA20  1021220 Preemptive  00007EC5322209F8:00007EC532221DC0 000055A8504B9770 -00001 Ukn (Threadpool Worker) 
    XXXX  210        0 00007E864010D920    31820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     224  184    4c1c6 00007E831C02ADD0    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
    XXXX   36        0 00007E83400222D0    31820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
    XXXX  196        0 00007E83340B6970    31820 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn 
     225   34    4c1c9 00007E838C119950    21220 Preemptive  0000000000000000:0000000000000000 000055A8504B9770 -00001 Ukn
    
  19. jkotas commented on Nov 12, 2025

    @jkotas
    Member

    After feeding stack trace to Gemini, it said most threads are preemptive, except this one:

    This is invalid analysis.

    Is this thread suspicious? No GCEvent::Wait on stack:

    This thread is not suspicious. The thread is blocked inside P/Invoke, nothing problematic about that.

  20. jkotas commented on Nov 12, 2025

    @jkotas
    Member

    seems all preemptive

    It means that the thread suspension succeeded, but the GC is not making progress for some reason. It would be interesting to find the thread that owns the thread store lock. Could you please dump the value ThreadStore::s_pThreadStore->m_HoldingThread?

    It is possible that you are hitting this glibc bug: #47700 (comment) . Ubuntu has a workaround for it, but I am not sure whether the workaround is 100% reliable. Any chance you can check whether this problem happens with .NET 10 too? We have refactored some of the runtime internals in .NET 10 to make it less prone to this glibc bug.

  21. vrecluse commented on Nov 13, 2025

    @vrecluse
    Author

    seems all preemptive

    It means that the thread suspension succeeded, but the GC is not making progress for some reason. It would be interesting to find the thread that owns the thread store lock. Could you please dump the value ThreadStore::s_pThreadStore->m_HoldingThread?

    It is possible that you are hitting this glibc bug: #47700 (comment) . Ubuntu has a workaround for it, but I am not sure whether the workaround is 100% reliable. Any chance you can check whether this problem happens with .NET 10 too? We have refactored some of the runtime internals in .NET 10 to make it less prone to this glibc bug.

    @jkotas

    (lldb) target v ThreadStore::s_pThreadStore->m_HoldingThread
    (Thread *) ThreadStore::s_pThreadStore->m_HoldingThread = 0x00007e8760000f70
    (lldb) target v *ThreadStore::s_pThreadStore->m_HoldingThread
    (Thread) *ThreadStore::s_pThreadStore->m_HoldingThread = {
      m_State = (m_val = 135712)
      m_fPreemptiveGCDisabled = (m_val = 0)
      m_pFrame = 0xffffffffffffffff
      m_ThreadId = 95
      m_pBlockingLock = {
        Volatile<DeadlockAwareLock *> = {
          m_val = NULL
        }
      }
      m_pRuntimeThreadLocals = 0x00007e84d4000bc8
      m_thAllocContextObj = {
         = {
          m_asTAddr = 0
          m_asPtr = 0x0000000000000000
          m_asMT = NULL
          m_asTypeDesc = NULL
          m_asParamTypeDesc = NULL
          m_asTypeVarTypeDesc = NULL
          m_asFnPtrTypeDesc = NULL
        }
      }
      m_ThreadTasks =
      m_StateNC = TSNC_ExistInThreadStore
      m_dwForbidSuspendThread = (m_val = 0)
      m_dwHashCodeSeed = 1547199780
      m_AbortType = 0
      m_AbortEndTime = 18446744073709551615
      m_RudeAbortEndTime = 18446744073709551615
      m_fRudeAbortInitiated = NO
      m_AbortController = 0
      m_AbortRequestLock = 0
      m_ThrewControlForThread = 0
      m_OSContext = 0x00007e87600013d0
      m_Link = {
        m_pNext = 0x00007e8760002e70
      }
      m_CacheStackBase = 0x00007e84e6536000
      m_CacheStackLimit = 0x00007e84e5d36000
      m_CacheStackSufficientExecutionLimit = 139109256749056
      m_CacheStackStackAllocNonRiskyExecutionLimit = 139109257142272
      m_pvHJRetAddr = 0xcccccccccccccccc
      m_ppvHJRetAddrPtr = 0xcccccccccccccccc
      m_HijackedFunction = NULL
      m_UserInterrupt = 0
      m_DebugSuspendEvent = {
        CLREventBase = {
          m_handle = 0x00000000000000a0
          m_dwFlags = (m_val = 0)
        }
      }
      m_EventWait = {
        CLREventBase = {
          m_handle = 0x00000000000000a4
          m_dwFlags = (m_val = 0)
        }
      }
      m_WaitEventLink = {
        m_WaitSB = NULL
        m_EventWait = NULL
        m_Thread = NULL
        m_Next = NULL
        m_LinkSB = {
          m_pNext = NULL
        }
        m_RefCount = 0
      }
      m_ThreadHandle = 0x00000000000000a8
      m_ThreadHandleForClose = 0xffffffffffffffff
      m_ThreadHandleForResume = 0xffffffffffffffff
      m_WeOwnThreadHandle = YES
      m_OSThreadId = 170
      m_ExposedObject = 0x00007fb6b1e91048
      m_StrongHndToExposedObject = 0x00007fb6b1e91230
      m_Priority = 2147483648
      m_ExternalRefCount = 1
      m_TraceCallCount = 0
      m_LastThrownObjectHandle = NULL
      m_ltoIsUnhandled = NO
      m_ExceptionState = {
        m_pCurrentTracker = NULL
        m_OOMTracker = {
          ExceptionTrackerBase = {
            m_pPrevNestedInfo = NULL
            m_hThrowable = NULL
            m_ptrs = {
              ExceptionRecord = NULL
              ContextRecord = NULL
            }
            m_EHClauseInfo = {
              m_IPForEHClause = 0
              m_sfForEHClause = (SP = 0)
              m_csfEHClause = {
                StackFrame = (SP = 0)
              }
              m_ClauseType = COR_PRF_CLAUSE_NONE
              m_fManagedCodeEntered = NO
            }
            m_ExceptionFlags = (m_flags = 0)
            m_fDeliveredFirstChanceNotification = NO
            m_ExceptionCode = 0
            m_DebuggerExState = {
              m_sfDebuggerIndicatedFramePointer = (SP = 0)
              m_pDebuggerInterceptFunc = NULL
              m_sfDebuggerInterceptFramePointer = (SP = 0)
              m_pDebuggerContext = 0x0000000000000000
              m_pDebuggerInterceptNativeOffset = 0
              m_dDebuggerInterceptHandlerDepth = 0
            }
            m_ScannedStackRange = {
              m_sfLowBound = (SP = 18446744073709551615)
              m_sfHighBound = (SP = 0)
            }
          }
          m_pThread = NULL
          m_fOwnsExceptionPointers = NO
          m_uCatchToCallPC = 0
          m_fResetEnclosingClauseSPForCatchFunclet = NO
           = {
            m_pSkipToParentFunctionMD = NULL
            m_pMethodDescOfCatcher = NULL
          }
          m_sfResumeStackFrame = (SP = 0)
          m_sfFirstPassTopmostFrame = (SP = 0)
          m_pClauseForCatchToken = 0x0000000000000000
          m_ClauseForCatch = {
            Flags = COR_ILEXCEPTION_CLAUSE_NONE
            TryStartPC = 0
            TryEndPC = 0
            HandlerStartPC = 0
            HandlerEndPC = 0
             = (TypeHandle = 0x0000000000000000, ClassToken = 0, FilterOffset = 0)
          }
          m_dwIndexClauseForCatch = 0
          m_sfEstablisherOfActualHandlerFrame = (SP = 0)
          m_sfCallerOfActualHandlerFrame = (SP = 0)
          m_pLimitFrame = NULL
          m_EnclosingClauseInfo = {
            m_uEnclosingClauseCallerSP = 0
            m_dwEnclosingClauseOffset = 0
            m_fEnclosingClauseIsFunclet = false
          }
          m_EnclosingClauseInfoForGCReporting = {
            m_uEnclosingClauseCallerSP = 0
            m_dwEnclosingClauseOffset = 0
            m_fEnclosingClauseIsFunclet = false
          }
          m_fFixupCallerSPForGCReporting = false
          m_sfCurrentEstablisherFrame = (SP = 0)
          m_sfLastUnwoundEstablisherFrame = (SP = 0)
          m_pInitialExplicitFrame = NULL
          m_csfEHClauseOfCollapsedTracker = {
            StackFrame = (SP = 0)
          }
          m_EnclosingClauseInfoOfCollapsedTracker = {
            m_uEnclosingClauseCallerSP = 0
            m_dwEnclosingClauseOffset = 0
            m_fEnclosingClauseIsFunclet = false
          }
        }
        m_flag = TEF_None
      }
      m_debuggerFilterContext = NULL
      m_pProfilerFilterContext = NULL
      m_hijackLock = (m_val = 0)
      m_hCurrNotification = NULL
      m_fInteropDebuggingHijacked = NO
      m_profilerCallbackState = 0
      m_dwProfilerEvacuationCounters = {
        [0] = (m_val = 0)
        [1] = (m_val = 0)
        [2] = (m_val = 0)
        [3] = (m_val = 0)
        [4] = (m_val = 0)
        [5] = (m_val = 0)
        [6] = (m_val = 0)
        [7] = (m_val = 0)
        [8] = (m_val = 0)
        [9] = (m_val = 0)
        [10] = (m_val = 0)
        [11] = (m_val = 0)
        [12] = (m_val = 0)
        [13] = (m_val = 0)
        [14] = (m_val = 0)
        [15] = (m_val = 0)
        [16] = (m_val = 0)
        [17] = (m_val = 0)
        [18] = (m_val = 0)
        [19] = (m_val = 0)
        [20] = (m_val = 0)
        [21] = (m_val = 0)
        [22] = (m_val = 0)
        [23] = (m_val = 0)
        [24] = (m_val = 0)
        [25] = (m_val = 0)
        [26] = (m_val = 0)
        [27] = (m_val = 0)
        [28] = (m_val = 0)
        [29] = (m_val = 0)
        [30] = (m_val = 0)
        [31] = (m_val = 0)
        [32] = (m_val = 0)
      }
      m_monitorLockContentionCount = 0
      m_PreventAsync = 0
      m_PreventAbort = 0
      m_pSavedRedirectContext = NULL
      m_pOSContextBuffer = 0x0000000000000000
      m_ThreadLocalDataPtr = 0x00007e84d4000c30
      cLoaderHandles = 0
      pLoaderHandles = 0x0000000000000000
      m_TlsSpinLock = {
         = (m_lock = 0)
      }
      m_tailCallTls = {
        m_frame = 0x00007fb6b3097db0
        m_argBuffer = NULL
      }
      m_dwAVInRuntimeImplOkayCount = 0
      m_pExceptionDuringStartup = NULL
      m_debuggerActivePatchSkipper = {
        Volatile<DebuggerPatchSkip *> = {
          m_val = NULL
        }
      }
      m_fAllowProfilerCallbacks = YES
      m_dwThreadHandleBeingUsed = (m_val = 0)
      m_pCreatingThrowableForException = NULL
      m_dwIndexClauseForCatch = 0
      m_sfEstablisherOfActualHandlerFrame = (SP = 0)
      DebugBlockingInfo = {
        m_firstBlockingItem = NULL
      }
      m_fDisableComObjectEagerCleanup = false
      m_fHasDeadThreadBeenConsideredForGCTrigger = false
      m_fGCSpecial = true
      m_pGCFrame = NULL
      m_pAllLoggedTypes = NULL
      m_gcModeOnSuspension = (m_val = 0)
      m_activityId = (Data1 = 0, Data2 = 0, Data3 = 0, Data4 = "\0\0\0\0\0\0\0")
      m_HijackReturnKind = RT_Illegal
      m_currentPrepareCodeConfig = NULL
      m_isInForbidSuspendForDebuggerRegion = false
      m_hasPendingActivation = false
    }
    
    

    We are using debian 12, based on the official dotnet 9 docker image:

    cat /etc/os-release
    PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
    NAME="Debian GNU/Linux"
    VERSION_ID="12"
    VERSION="12 (bookworm)"
    VERSION_CODENAME=bookworm
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"
    

    Is it helpful if we update os to new version?

    Btw, we found this in kafka c library, is it related to that glibc bug? @jkotas

    Image
  22. vrecluse commented on Nov 13, 2025

    @vrecluse
    Author

    #47700 (comment)
    This issue seems been fixed in version 2.41
    .Net 9 sdk image is using 2.36

    ldd --version
    ldd (Debian GLIBC 2.36-9+deb12u13) 2.36
    Copyright (C) 2022 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Roland McGrath and Ulrich Drepper.
    
    
  23. vrecluse commented on Nov 13, 2025

    @vrecluse
    Author

    Maybe updating debian to trixie (which includes glibc 2.42) can fix this problem?
    Or change to ubuntu noble (glibc version 2.39, fixed in 2.32)?
    https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1899800

  24. jkotas commented on Nov 13, 2025

    @jkotas
    Member

    ThreadStore::s_pThreadStore->m_HoldingThread

    So this is the lock that's everything is stuck on:

        frame #3: 0x00007fb6b384d500 libc.so.6`___pthread_cond_wait(cond=0x00007fb6b37183d8, mutex=0x00007fb6b37183b0) at pthread_cond_wait.c:618:10
        frame #4: 0x00007fb6b3621735 libcoreclr.so`CorUnix::InternalEnterCriticalSection(CorUnix::CPalThread*, _CRITICAL_SECTION*) [inlined] CorUnix::PALCS_DoActualWait(pPalCriticalSection=0x00007fb6b3718388) at cs.cpp:1147:20 [opt]
        frame #5: 0x00007fb6b36216f6 libcoreclr.so`CorUnix::InternalEnterCriticalSection(CorUnix::CPalThread*, _CRITICAL_SECTION*) [inlined] CorUnix::PALCS_WaitOnCS(pPalCriticalSection=0x00007fb6b3718388, lInc=<unavailable>) at cs.cpp:1115:18 [opt]
        frame #6: 0x00007fb6b36216c5 libcoreclr.so`CorUnix::InternalEnterCriticalSection(pThread=<unavailable>, pCriticalSection=0x00007fb6b3718388) at cs.cpp:761:20 [opt]
        frame #7: 0x00007fb6b3618595 libcoreclr.so`CorUnix::CSharedMemoryWaitableObject::GetSynchStateController(this=0x000055a8504b5060, pthr=0x00007e8760018e50, ppStateController=0x00007e84ab7fdb08) at shmobject.cpp:1108:32 [opt]
        frame #8: 0x00007fb6b3621d72 libcoreclr.so`::SetEvent(HANDLE) [inlined] CorUnix::InternalSetEvent(pthr=0x00007e8760018e50, hEvent=<unavailable>, fSetEvent=YES) at event.cpp:388:27 [opt]
        frame #9: 0x00007fb6b3621d29 libcoreclr.so`::SetEvent(hEvent=<unavailable>) at event.cpp:301:16 [opt]
        frame #10: 0x00007fb6b1f05a84 libclrgc.so`SVR::CFinalize::ScanForFinalization(void (*)(Object**, ScanContext*, unsigned int), int, SVR::gc_heap*) [inlined] GCToEEInterface::EnableFinalization(gcHasWorkForFinalizerThread=true) at gcenv.ee.standalone.inl:192:19 [opt]
    

    It matches the symptoms of the glibc bug.

    Upgrading to .NET 10 and/or switching to Ubuntu-based container should fix it,

  25. vrecluse commented on Nov 13, 2025

    @vrecluse
    Author

    ThreadStore::s_pThreadStore->m_HoldingThread

    So this is the lock that's everything is stuck on:

        frame #3: 0x00007fb6b384d500 libc.so.6`___pthread_cond_wait(cond=0x00007fb6b37183d8, mutex=0x00007fb6b37183b0) at pthread_cond_wait.c:618:10
        frame #4: 0x00007fb6b3621735 libcoreclr.so`CorUnix::InternalEnterCriticalSection(CorUnix::CPalThread*, _CRITICAL_SECTION*) [inlined] CorUnix::PALCS_DoActualWait(pPalCriticalSection=0x00007fb6b3718388) at cs.cpp:1147:20 [opt]
        frame #5: 0x00007fb6b36216f6 libcoreclr.so`CorUnix::InternalEnterCriticalSection(CorUnix::CPalThread*, _CRITICAL_SECTION*) [inlined] CorUnix::PALCS_WaitOnCS(pPalCriticalSection=0x00007fb6b3718388, lInc=<unavailable>) at cs.cpp:1115:18 [opt]
        frame #6: 0x00007fb6b36216c5 libcoreclr.so`CorUnix::InternalEnterCriticalSection(pThread=<unavailable>, pCriticalSection=0x00007fb6b3718388) at cs.cpp:761:20 [opt]
        frame #7: 0x00007fb6b3618595 libcoreclr.so`CorUnix::CSharedMemoryWaitableObject::GetSynchStateController(this=0x000055a8504b5060, pthr=0x00007e8760018e50, ppStateController=0x00007e84ab7fdb08) at shmobject.cpp:1108:32 [opt]
        frame #8: 0x00007fb6b3621d72 libcoreclr.so`::SetEvent(HANDLE) [inlined] CorUnix::InternalSetEvent(pthr=0x00007e8760018e50, hEvent=<unavailable>, fSetEvent=YES) at event.cpp:388:27 [opt]
        frame #9: 0x00007fb6b3621d29 libcoreclr.so`::SetEvent(hEvent=<unavailable>) at event.cpp:301:16 [opt]
        frame #10: 0x00007fb6b1f05a84 libclrgc.so`SVR::CFinalize::ScanForFinalization(void (*)(Object**, ScanContext*, unsigned int), int, SVR::gc_heap*) [inlined] GCToEEInterface::EnableFinalization(gcHasWorkForFinalizerThread=true) at gcenv.ee.standalone.inl:192:19 [opt]
    

    It matches the symptoms of the glibc bug.

    Upgrading to .NET 10 and/or switching to Ubuntu-based container should fix it,

    Ok, thanks.

  26. removed
    untriaged
    on Nov 14, 2025
  27. locked and limited conversation to collaborators on Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions