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
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)`
The text was updated successfully, but these errors were encountered:
Your environment
ruby -v
: ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [x86_64-linux]rdbg -v
: rdbg 1.4.0Describe 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 thevalidate
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)`The text was updated successfully, but these errors were encountered: