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

IRB crashes when started from ruby/debug session in Rails #1003

Closed
dhh opened this issue Sep 9, 2024 · 1 comment
Closed

IRB crashes when started from ruby/debug session in Rails #1003

dhh opened this issue Sep 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dhh
Copy link

dhh commented Sep 9, 2024

With a new Rails app created from rails/main, IRB consistently crashes when invoked from a ruby/debug session started using debugger on Ruby 3.3.5. This is the error and backtrace:

(rdbg) irb    # command
irb_console = true                 # UI: Use IRB as the console (default: false)
>> #<Thread:0x000074c1d2f0d170@DEBUGGER__::SESSION@server /home/dhh/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/debug-1.9.2/lib/debug/session.rb:179 run> terminated with exception (report_on_exception is true):
/home/dhh/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/irb-1.14.0/lib/irb/debug.rb:72:in `block in setup': undefined method `call' for nil (NoMethodError)

            irb_output_modifier_proc.call(output, complete: complete)
                                    ^^^^^
        from /home/dhh/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/reline-0.5.10/lib/reline/line_editor.rb:783:in `modify_lines'
        from /home/dhh/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/reline-0.5.10/lib/reline/line_editor.rb:353:in `block in modified_lines'
        from /home/dhh/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/reline-0.5.10/lib/reline/line_editor.rb:346:in `with_cache'
        from /home/dhh/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/reline-0.5.10/lib/reline/line_editor.rb:352:in `modified_lines'
        from /home/dhh/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/reline-0.5.10/lib/reline/line_editor.rb:376:in `wrapped_prompt_and_input_lines'
        from /home/dhh/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/reline-0.5.10/lib/reline/line_editor.rb:441:in `wrapped_cursor_position'

Steps to reproduce:

rails new myapp
cd myapp
bin/rails generate scaffold message title:string
# edit app/controllers/messages_controller.rb and add "debugger" in the new action
bin/rails server
# Visit http://localhost:3000/messages/new
# Enter "irb" in the rdbg session that is started in the console

This is with debug 1.9.2, Ruby 3.3.5, and rails/main.

IRB does not crash if instead of debugger you start the IRB session using binding.irb. But that's not a replacement. Often it's useful to run in rdbg to use the full debugger, and only occasionally hoping into IRB.

@dhh dhh changed the title IRB frequently crashes when started from ruby/debug session in Rails IRB crashes when started from ruby/debug session in Rails Sep 9, 2024
@st0012
Copy link
Member

st0012 commented Oct 1, 2024

Closing as it's been fixed in #1006 and was released in v1.14.1.

@st0012 st0012 closed this as completed Oct 1, 2024
@st0012 st0012 added the bug Something isn't working label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants