Skip to content
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

Debug freezes after a few keystrokes #934

Open
feliperaul opened this issue Mar 20, 2023 · 8 comments
Open

Debug freezes after a few keystrokes #934

feliperaul opened this issue Mar 20, 2023 · 8 comments

Comments

@feliperaul
Copy link

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)

@woto
Copy link

woto commented Mar 21, 2023

Same reason here. Check this #871 (comment). It helped me too.
Also take a note that for unknown reason setting value in ~/.rdbgrc does not work for me too nonsequitur/inf-ruby#158 (comment)

@Benoit-Baumann
Copy link

Benoit-Baumann commented Mar 22, 2023

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

@ko1
Copy link
Collaborator

ko1 commented Mar 22, 2023

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

@st0012
Copy link
Member

st0012 commented Mar 23, 2023

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 #871 (comment).

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

@st0012 st0012 mentioned this issue Aug 4, 2023
@kikonen
Copy link

kikonen commented Aug 14, 2023

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...)

st0012 added a commit to ruby/reline that referenced this issue Aug 14, 2023
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.
st0012 added a commit to ruby/reline that referenced this issue Aug 14, 2023
`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.
st0012 added a commit to ruby/reline that referenced this issue Aug 14, 2023
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.
st0012 added a commit to ruby/reline that referenced this issue Aug 14, 2023
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.
st0012 added a commit to ruby/reline that referenced this issue Aug 16, 2023
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.
tompng pushed a commit to ruby/reline that referenced this issue Aug 20, 2023
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.
matzbot pushed a commit to ruby/ruby that referenced this issue Aug 20, 2023
(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
@st0012
Copy link
Member

st0012 commented Aug 20, 2023

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

@top4ek
Copy link

top4ek commented Aug 21, 2023

Awesome. Looks like it fixed!

@kikonen
Copy link

kikonen commented Aug 21, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants