remote debugger failing on first hit with puma

Abierto
#1,121 6 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
docker, ruby
Área
devtools

Línea de trabajo

Start by reproducing the first-hit failure with Ruby 3.3.5, rdbg 1.9.2, Puma in a local Docker container, and the Sinatra request flow described. Inspect the remote debugger behavior around the initial SIGURG and step transition, including the reported Puma and Rack paths. Done means the first breakpoint can be stepped through normally without losing context.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Your environment

  • ruby -v: 3.3.5
  • rdbg -v: 1.9.2

Describe the bug
When hitting breakpoint via placing "debugger" into source code, and connecting with remote debugger, with sinatra controller and puma web server in local docker container, first time when "debugger" is hit will fail, as described below

For example,
Puma started freshly serving sinatra app in local docker container

    33|       def some_method_called_via_puma_via_sinatra_controller
=>  34|         debugger
    35|         some logic...
    37|       end
    38|
(rdbg:remote) n
# No sourcefile available for /usr/local/bundle/gems/puma-6.4.2/lib/puma/single.rb

Stop by SIGURG
(rdbg:remote) n
# it looks like it tries to step in code, but in reality context is lost
(rdbg:remote) n
[1, 7] in $(Gem)/rack-2.2.9/lib/rack/file.rb
     1| # frozen_string_literal: true
     2|
     3| require_relative 'files'
     4|
=>   5| module Rack
     6|   File = Files
     7| end
(rdbg:remote) c

Thus only way to end to proceed is to hit "continue", since control flow has jumped into some odd place, and now, after this failure when doing same request again, debugger works as espected (i.e. does not hit this "SIGURG" which seems to break thing).

Makes usage rather irritating since after every modify of code (and restart of web server thus), have to first hit debugger "cold", and failing, and hitting continue, and now it seems to be "hot", and can actually succeed.

To Reproduce

  • Local docker container
  • running sinatra app with puma on it
  • setting up remote debugger
  • adding breakpoint via placing "debugger" into code
  • launching app on container
  • performing some request hitting "debugger" put in code
  • connect remote debugger to process
    => fails on first time, if hitting continue, and retrying request it works as expected

Expected behavior
It would not fail on first time, since it makes debugging few cases difficult.

Additional context
Issue has been there for a while, i.e. it has had this failure always for me with this debug gem

Lenguaje dominante
Ruby
Estrellas
1.3k
Forks
146
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ruby/debug

Todos los issues de ruby/debug

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.