debug icon indicating copy to clipboard operation
debug copied to clipboard

Debug freezes after a few keystrokes

Open feliperaul opened this issue 2 years ago • 8 comments

Your environment

  • ruby -v: ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [arm64-darwin21]
  • rdbg -v: rdbg 1.7.1

Describe the bug Debugger is freezing after typing a few keystrokes at random; almost reliably freezing with 3+ keystrokes. Any new key pressed just echoes in the screen the key pressed, but nothing happens.

image

It freezes the terminal window so bad that not even CTRL C can escape it:

image

To Reproduce

Just install a debugger anywhere in the code and start typing on the console.

Expected behavior I expected it not to freeze.

If I use binding.pry instead, everything works just fine.

Additional context Rails application (7.0.4.3)

feliperaul avatar Mar 20 '23 20:03 feliperaul

Same reason here. Check this https://github.com/ruby/debug/issues/871#issuecomment-1366186813. It helped me too. Also take a note that for unknown reason setting value in ~/.rdbgrc does not work for me too https://github.com/nonsequitur/inf-ruby/issues/158#issuecomment-1016684874

woto avatar Mar 21 '23 20:03 woto

Thanks for the tip @woto, exporting RUBY_DEBUG_NO_RELINE=1 in my .zshrc did the trick for me.

As discussed in the comment you linked, the problem seems to come from the reline gem. A patch has been merged recently but it has not yet been released

Benoit-Baumann avatar Mar 22 '23 10:03 Benoit-Baumann

Thank you for survey. I want to wait the next release of reline.

ko1 avatar Mar 22 '23 18:03 ko1

I'm afraid this is not a reline issue but the same as #877. It's related to reline simply because it calls Timeout.timeout. That's why I original proposed RUBY_DEBUG_NO_RELINE=1 as a workaround in https://github.com/ruby/debug/issues/871#issuecomment-1364690830.

If we use a simpler repro I mentioned in this comment with the latest reline, it still freezes.

st0012 avatar Mar 23 '23 02:03 st0012

I think I was hit by this, and spent several weeks in agony due to "random" freezes. Now trying this "RUBY_DEBUG_NO_RELINE" workaround (and crossing fingers that it will resolve my problem with docker container).

Perhaps you should put this workaround as default option, and to get away from workaround behind env var instead (likely less time lost by random people around the world...)

kikonen avatar Aug 14 '23 11:08 kikonen

Hi folks, could you try updating reline to 0.3.8 and let me know if that resolves the issue?

st0012 avatar Aug 20 '23 17:08 st0012

Awesome. Looks like it fixed!

top4ek avatar Aug 21 '23 06:08 top4ek

sounds, marvellous [insert trumpet fanfare and confetti here], need to try it when possible

kikonen avatar Aug 21 '23 12:08 kikonen