You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deadlock on executing commands from binding.b in Rails app #725
@yshmarov Thanks for noting the downgrade suggestion. My reproduction case succeeds on 1.5.0. Running against a local copy of debug and bisecting I get the first bad commit as 00ec229. That's a threading related commit, so it seems plausible.
❯ git bisect log
git bisect start
# bad: [4b50fc669e0c96284bfeb7f69f4ce0b5ddf19659] Fix rdbg's RUBYOPT handling logic
git bisect bad 4b50fc669e0c96284bfeb7f69f4ce0b5ddf19659
# good: [32eba515549eaf5f3eb841b19e3d339fe916c880] v1.5.0
git bisect good 32eba515549eaf5f3eb841b19e3d339fe916c880
# bad: [50763033fc661d5e72b5a3d470558e76a8f47dec] Centralize configuration defaults (#642)
git bisect bad 50763033fc661d5e72b5a3d470558e76a8f47dec
# good: [a2c95efc8722000e5cf89460c04e037008447b2c] Update CONTRIBUTING.md
git bisect good a2c95efc8722000e5cf89460c04e037008447b2c
# bad: [39f21d90c68856cc3ee7cd7cf77a7b73ba9959ec] Add debug logging
git bisect bad 39f21d90c68856cc3ee7cd7cf77a7b73ba9959ec
# bad: [f4b267d6d3b33ab16e9f9e7de526bd13b326d92f] Rename WebSocketClient#cleanup to #close because it's all it does
git bisect bad f4b267d6d3b33ab16e9f9e7de526bd13b326d92f
# bad: [b0d34c629047375290c4d5f8f0f3c243bdc79e67] restart_all_threads should send cmd to all tcs instead of @tc
git bisect bad b0d34c629047375290c4d5f8f0f3c243bdc79e67
# bad: [00ec229cb46e5c9059c0285a4a4de5f6ac322292] Use Session#request_tc to replace manual 'tc <<' calls
git bisect bad 00ec229cb46e5c9059c0285a4a4de5f6ac322292
# good: [49514f6bee91eeb1a5113a872d072ece3f62cce6] Extract get_src method
git bisect good 49514f6bee91eeb1a5113a872d072ece3f62cce6
# first bad commit: [00ec229cb46e5c9059c0285a4a4de5f6ac322292] Use Session#request_tc to replace manual 'tc <<' calls
@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 :thread_begin event.
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.
Activity
yshmarov commentedon Jul 21, 2022
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
gem 'debug', '~> 1.5.0', '<= 1.6.0'=> no deadlockianterrell commentedon Jul 21, 2022
@yshmarov Thanks for noting the downgrade suggestion. My reproduction case succeeds on 1.5.0. Running against a local copy of
debugand bisecting I get the first bad commit as 00ec229. That's a threading related commit, so it seems plausible.st0012 commentedon Jul 21, 2022
I haven't located the cause, but I found that we can reproduce it just by using these:
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
Timeout.send :create_timeout_threadwhen entering the console.ianterrell commentedon Jul 21, 2022
@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
:thread_beginevent.st0012 commentedon Jul 21, 2022
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:
Thanks
ianterrell commentedon Jul 22, 2022
@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.
st0012 commentedon Jul 22, 2022
Thank you for the feedback ❤️
Petercopter commentedon Jul 29, 2022
@st0012 Works for me as well. Doing a lot of debugging right now and it was driving me crazy! Thanks 👍