Repository navigation
Remote Debuggee crashes on Debugger's "quit" command #622
Copy link
Copy link
Closed
Milestone
Description
Your environment
Windows 11: Using Docker Desktop container (with docker compose) running Alpine, using foreman to run Procfile on start
ruby -v:ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]rdbg -v:rdbg 1.5.0
Describe the bug
Running quit command on attached debugger causes the debuggee to exit (logs provided below).
To Reproduce
- Set up a rails application on a docker container (I can provide my configurations if needed).
- Add a
require 'debug/open_nonstop'in thebin/railsfile at the top of the file. - Add a line in Procfile to start
bin/rails server -p 3000 -b 0.0.0.0if it's not already there - Set up your docker-compose.yml to run the
bin/devcommand on start to run foreman using the Procfile - Start docker container
docker compose up -d - Attach to debuggee using
docker compose exec <container name> rdbg --attach - Add
debuggerline in the application and trigger the breakpoint (by visiting a web page or any method you prefer) - In rdbg console you attached to (in step 6) type
quit - Debugging process quits but the container also breaks saying:
--unsupported: \ exited with code 1
Expected behavior
Debugger should gracefully detach and debuggee should be open to accept a new debugger attachment.
Additional context
Dockerfile uses FROM ruby:3.1.1-alpine3.15 base image.
Whole docker container terminal output when following above steps to reproduce:
20:26:35 web.1 | started with pid 10
20:26:35 web.1 | DEBUGGER: Debugger can attach via UNIX domain socket (/tmp/ruby-debug-sock-0/ruby-debug-ruby-debug-10)
20:26:37 web.1 | DEBUGGER: Connected.
20:26:43 web.1 | => Booting Puma
20:26:43 web.1 | => Rails 7.0.2.3 application starting in development
20:26:43 web.1 | => Run `bin/rails server --help` for more startup options
20:26:44 web.1 | Puma starting in single mode...
20:26:44 web.1 | * Puma version: 5.6.4 (ruby 3.1.1-p18) ("Birdie's Version")
20:26:44 web.1 | * Min threads: 5
20:26:44 web.1 | * Max threads: 5
20:26:44 web.1 | * Environment: development
20:26:44 web.1 | * PID: 10
20:26:44 web.1 | * Listening on http://0.0.0.0:3000
20:26:44 web.1 | Use Ctrl-C to stop
20:26:47 web.1 | Started GET "/" for 192.168.32.1 at 2022-04-13 20:26:47 +0000
20:26:47 web.1 | Cannot render console from 192.168.32.1! Allowed networks: 127.0.0.0/127.255.255.255, ::1
20:26:47 web.1 | ActiveRecord::SchemaMigration Pluck (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
20:26:47 web.1 | Processing by ApplicationController#index as HTML
20:26:50 web.1 | unsupported:
20:26:51 web.1 | exited with code 1
20:26:51 system | sending SIGTERM to all processes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
ko1 commentedon Apr 17, 2022
Thank you. Does it work on multi-process mode?
(Can I see debug REPL console log?)
jpau-besmartee commentedon Apr 18, 2022
Here's the REPL console log including the command I used to attach to the remote debugger:
After that
quitcommand is where the docker container exits.When you say "multi-process mode" are you referring to
rdbg --open? If so, here's the docker terminal output when I remove therequire 'debug/open_nonstop'and add this to my Procfilerdbg --open -c -- bin/rails server -p 3000 -b 0.0.0.0:And the corresponding REPL console:
As you can see I forgot to run this in
nonstopmode so it stopped on therailscommand which I continued. Let me know if there is anything you need.BobbyMcWho commentedon Apr 21, 2022
I can confirm this is happening for me as well:
BobbyMcWho commentedon Apr 21, 2022
Bugsnag caught this the last time I quit via vscode, not certain if it's relevant
BobbyMcWho commentedon Apr 21, 2022
Seems like
@sockwas nil here maybe?ko1 commentedon Jun 27, 2022
Thank you I confirmed without foreman.
Add a require 'debug/open_nonstop' in the bin/rails file at the top of the file.bin/rails server -p 3000 -b 0.0.0.0rdbg -aquitcommandreturn when `line` is `nil`
return when `line` is `nil`