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 crashes on closing a parenthesis while calling a method with parens and an argument #961

Closed
jesselasalle opened this issue Apr 11, 2023 · 1 comment

Comments

@jesselasalle
Copy link

jesselasalle commented Apr 11, 2023

Your environment

  • ruby -v: ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [x86_64-linux]
  • rdbg -v: rdbg 1.4.0

Describe the bug
When in a debug session in the rails console, trying to run a method on an object that requires an argument in parentheses, the debugger crashes with the error:

unmatched close parenthesis: /\Aobject)/ (RegexpError)

To Reproduce
In this exact scenario, I am using a custom validator object that inherits from ActiveModel::Validator. I call Object.create!(arg1: arg1, arg2: arg2) and hit the debugger inside the validate method as expected. At this point, I need to call a class method from the object that is being validated: Object.find_parents(object). When I close the parentheses on (object), I receive the above error. I also tried calling an instance method on the object with the same behavior.

Expected behavior
I would expect the debugger not to crash.

Additional context
Stack trace:
Object.find_parents(object)#<Thread:0x00005618cc1412a8@DEBUGGER__::SESSION@server /usr/local/bundle/gems/debug-1.4.0/lib/debug/session.rb:148 run> terminated with exception (report_on_exception is true): from /usr/local/bundle/gems/reline-0.3.1/lib/reline.rb:328:in each'
from /usr/local/bundle/gems/reline-0.3.1/lib/reline.rb:328:in block (2 levels) in inner_readline' from /usr/local/bundle/gems/reline-0.3.1/lib/reline.rb:403:in block in read_io'
from /usr/local/bundle/gems/reline-0.3.1/lib/reline.rb:373:in loop' from /usr/local/bundle/gems/reline-0.3.1/lib/reline.rb:373:in read_io'
from /usr/local/bundle/gems/reline-0.3.1/lib/reline.rb:326:in block in inner_readline' from /usr/local/lib/ruby/3.0.0/forwardable.rb:238:in readmultiline'
from /usr/local/bundle/gems/debug-1.4.0/lib/debug/console.rb:101:in block in readline' from /usr/local/bundle/gems/debug-1.4.0/lib/debug/console.rb:82:in readline_setup'
from /usr/local/bundle/gems/debug-1.4.0/lib/debug/console.rb:100:in readline' from /usr/local/bundle/gems/debug-1.4.0/lib/debug/local.rb:72:in block in readline'
from /usr/local/bundle/gems/debug-1.4.0/lib/debug/local.rb:84:in block in setup_interrupt' from /usr/local/bundle/gems/debug-1.4.0/lib/debug/session.rb:1689:in intercept_trap_sigint'
from /usr/local/bundle/gems/debug-1.4.0/lib/debug/local.rb:77:in setup_interrupt' from /usr/local/bundle/gems/debug-1.4.0/lib/debug/local.rb:71:in readline'
from /usr/local/bundle/gems/debug-1.4.0/lib/debug/session.rb:373:in wait_command' from /usr/local/bundle/gems/debug-1.4.0/lib/debug/session.rb:333:in block in wait_command_loop'
from /usr/local/bundle/gems/debug-1.4.0/lib/debug/session.rb:332:in loop' from /usr/local/bundle/gems/debug-1.4.0/lib/debug/session.rb:332:in wait_command_loop'
from /usr/local/bundle/gems/debug-1.4.0/lib/debug/session.rb:254:in process_event' from /usr/local/bundle/gems/debug-1.4.0/lib/debug/session.rb:198:in session_server_main'
from /usr/local/bundle/gems/debug-1.4.0/lib/debug/session.rb:168:in block in activate' /usr/local/bundle/gems/debug-1.4.0/lib/debug/console.rb:55:in block in readline_setup': unmatched close parenthesis: /\Aobject)/ (RegexpError)`

@jesselasalle
Copy link
Author

Noticed there was a newer version, and this issue seems to be resolved there. Closing issue.

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

1 participant