-
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 executing commands from binding.b in Rails app #725
Comments
I'm experiencing the same issue right at this moment. When running some console commands the binding just dies out
I tried downgrading the gem to |
@yshmarov Thanks for noting the downgrade suggestion. My reproduction case succeeds on 1.5.0. Running against a local copy of
|
I haven't located the cause, but I found that we can reproduce it just by using these: require "test_helper"
class ExampleTest < ActiveSupport::TestCase
test "the truth" do
debugger
end
end And it seems that there's a thread created before things hang:
It's the thread's suspension caused the hang and deadlock.
But I'm still figuring out:
@yshmarov Can you briefly describe the way you encountered this problem? Is it also in minitest? Update: repro steps can be further reduced to just type |
@st0012 I've noticed the issue is happening if I use my up key to go through the history. That appears to be what triggers queuing the |
I've created #727 for this. Can you give my branch a try and let me know if the issue still persists or something else occurs? You can do it with: gem "debug", github: "st0012/debug", branch: "fix-#725" Thanks |
@st0012 So far that fix looks good! 🎉 It fixes my reproduction case and the similar one in our actual codebase. My colleague had a different reproduction case that occurred outside of MiniTest while simply running the app. We think that one may have been occurring even on the 1.5.0 release. But so far that appears fixed on this branch, too. |
Thank you for the feedback ❤️ |
@st0012 Works for me as well. Doing a lot of debugging right now and it was driving me crazy! Thanks 👍 |
Your environment
Describe the bug
When using
binding.b
in our Rails app — in various places: code run from test suites, code run from serving web requests — the debug REPL will hang.Here is an example session entering the debugger from unit tests:
full logfile
To Reproduce
From debugger, repeatedly enter
false == true
.Expected behavior
No deadlock.
Additional context
The text was updated successfully, but these errors were encountered: