-
Notifications
You must be signed in to change notification settings - Fork 127
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
Deadlock on I/O #1000
Comments
I'm having the same issue, but in my case it seems it's getting stuck when I'm using the arrow keys during debugging session. Update 04.08.2023: when invoking debugger via |
arrow keys cause hanging for me as well. If I press the up arrow to get a previous command, about 90% of the time it hangs. |
Update: Try updating Reline to I think this is the same us #934 which could be worked around by disabling Reline with: |
Timeout's implementation relies on Thread, which would conflict with `ruby/debug`'s thread-freezing implementation and has casued issues like - ruby/debug#877 - ruby/debug#934 - ruby/debug#1000 This commit avoids the issue by completely removing the use of Timeout.
`ruby/debug`'s thread-freezing implementation and has casued issues like - ruby/debug#877 - ruby/debug#934 - ruby/debug#1000 This commit avoids the issue by completely removing the use of Timeout.
Timeout's implementation relies on Thread, which would conflict with `ruby/debug`'s thread-freezing implementation and has casued issues like - ruby/debug#877 - ruby/debug#934 - ruby/debug#1000 This commit avoids the issue by completely removing the use of Timeout.
Timeout's implementation relies on Thread, which would conflict with `ruby/debug`'s thread-freezing implementation and has casued issues like - ruby/debug#877 - ruby/debug#934 - ruby/debug#1000 This commit avoids the issue by completely removing the use of Timeout.
Timeout's implementation relies on Thread, which would conflict with `ruby/debug`'s thread-freezing implementation and has casued issues like - ruby/debug#877 - ruby/debug#934 - ruby/debug#1000 This commit avoids the issue by completely removing the use of Timeout.
Timeout's implementation relies on Thread, which would conflict with `ruby/debug`'s thread-freezing implementation and has casued issues like - ruby/debug#877 - ruby/debug#934 - ruby/debug#1000 This commit avoids the issue by completely removing the use of Timeout.
(ruby/reline#580) Timeout's implementation relies on Thread, which would conflict with `ruby/debug`'s thread-freezing implementation and has casued issues like - ruby/debug#877 - ruby/debug#934 - ruby/debug#1000 This commit avoids the issue by completely removing the use of Timeout. ruby/reline@d4f0cd3fe1
This worked for me. I just want to say that this has been the most irritating issue of using the debug gem, which is otherwise fantastic. I was getting bit by this on nearly every invocation of debug from 'binding.break' calls in my code. So glad this got fixed. Great work. I hope this gets backported to all live releases and is part of version 3.3 ruby. |
@ddoherty03 I actually forgot to update that if you install |
@st0012. Yes, that is my experience. Many thanks. You're my hero! |
Can we close it? |
@ko1, as far as I can tell, it’s fixed. Would be interested whether @jordanstephens agrees. |
Thanks for the tip! I'll point our gemfile to 3d0f4e3 for now. I'll report back if I continue experiencing this issue. 👍 |
I haven't encountered the deadlock issue since upgrading I am still encountering an issue where the repl will intermittently fail to print the results of the previous command. I'll open a new issue to track that (#1021), and I'll await a new release of Feel free to close this 👍 |
Your environment
ruby -v
:ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
rdbg -v
:rdbg 1.8.0
Describe the bug
rdbg hangs intermittently after (during?) I/O operations. I've noticed this most often when running code that executes a database query, reads a file, or makes a network request in the repl during a debugging session. No result is returned, and the console accepts no input until eventually it crashes with an exception report that includes
No live threads left. Deadlock?
(Full exception report below).I suspect this has something to do with resuming suspended threads, but I don't know enough about ruby's threading or I/O models (or how rdbg works) to debug this further. All I can offer is the stacktrace I get upon crash, and a process snapshots taken from Activity Monitor before and after the deadlock. I'll try to enable dtruss later to see if I can gain any further insight with that tool. Let me know if you have any specific recommendations for troubleshooting this further.
I looked at #725 and tried to downgrade to version 1.5.0, but I saw deadlocks there as well. I don't suspect this is related to readline, but I could try to disable it if you think it's worth it.
Thanks,
Exception Report (formatted manually for legibility)
To Reproduce
It's not deterministically reproducible, but seems to occur when i run commands which trigger database queries
Expected behavior
I expect the repl to execute a database query, return control back to the console, so that I may continue my debugging session.
Additional context
Add any other context about the problem here.
I also took a sample with activity monitor before and after a deadlock here:
The text was updated successfully, but these errors were encountered: