-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ThreadPoolWorkQueue..ctor
randomly will never return
#104322
Comments
Tagging subscribers to this area: @mangod9 |
I'm not sure if I'm doing this right, but dumping the memory at the IP of the "dynamic helper frame" shows repeated 32 byte blocks of memory:
|
Hey @colejohnson66, are you able to share a repro for this issue? |
We unfortunately do not have anything we could share, and I haven’t narrowed anything down. I still have the dump if you’d like anything from it, and I can do some more debugging if necessary. I wonder if #104457 is related? It being intermittent would be an indication of some race condition. |
OS thread 0x6600 has locked EventListener.EventListenersLock, and I think it is waiting for the static constructor of FrameworkEventSource.
OS thread 0xbd4 has entered the static constructor of FrameworkEventSource, and is waiting to lock EventListener.EventListenersLock.
I wonder what caused EventPipeEventProvider.Callback to be called. Had you connected some diagnostic tools to the process before the deadlock occurred? EventSource.SendCommand has code to enqueue commands if the EventSource hasn't finished initializing yet. Could the deadlock be fixed by making RuntimeEventSource also enqueue commands until FrameworkEventSource finishes initializing? Alternatively, could the ThreadPool counters implemented in RuntimeEventSource.OnEventCommand return 0 if ThreadPool hasn't been initialized yet? Rather than wait for ThreadPool and FrameworkEventSource to be initialized. |
No, that's for TraceSource, and this deadlock is with EventSource. |
This only started recently, so maybe Rider changed how something in the backend in the 2024.2 EAPs? I'm not ruling that possibility out. My reproduction steps are: click the "debug" button, observe the debugger start, but not the GUI, click "pause" to investigate, then see the deadlock. Every time, it's the same stack trace. After a few times of this happening, I used As for program execution, we have an internal static class Program
{
[STAThread]
public static async Task Main(string[] args)
{
Logger.Instance.Start("Logs.db"); I'll see if the callback parameters have any information next time this happens. |
I can't access the stack variables in the debugger:
What I can see is that the event counter being incremented in Also, if the
|
This may be a duplicate of #93175. |
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti |
Description
Periodically, I've experienced a deadlock on program start through
ThreadPoolWorkQueue..ctor
. According to the debugger, that constructor is stuck atRefreshLoggingEnabled
, and it never continues.dotnet-dump
provided this information, implying it's stuck in a "dynamic helper frame".Reproduction Steps
Unsure, but when it happens, restarting the program/debug session will usually fix it.
Expected behavior
Program starts the thread pool queue just fine and no deadlock occurs.
Actual behavior
Deadlock due to the lock never being released.
Regression?
No response
Known Workarounds
No response
Configuration
Microsoft.Data.SQLite
Other information
No response
The text was updated successfully, but these errors were encountered: