Deadlock after issuing `Net::HTTP.get` request and using a Ruby Debug breakpoint after the request
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 42/100
Piste de recherche
Start with the reproduction script in test.rb and compare the behavior with net-http 0.2.0 and 0.3.0 or higher. Read lib/debug/thread_client.rb around lines 874 and 1233, along with the breakpoint and session paths in the stack trace; done means history navigation at the breakpoint no longer raises a deadlock.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
We noticed a thread deadlock issue with Ruby debug after our net/http version changed from 0.2.0 to 0.3.0.

When you are in the breakpoint after making any http request and you attempt to fetch your debug history (e.g. you arrow key up a few times), it crashes.
This error occurs in Ruby 3.1.3 which is using net-http (0.3.0). It does not occur in Ruby 3.1.2 (or earlier) which is using net-http (0.2.0).
Reproduction script (using net-http 0.3.0 or higher):
require "debug"
require "net/http"
Net::HTTP.get(URI.parse("https://google.com"))
binding.b
Stack trace:
["DEBUGGER Exception: .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:1233",
#<fatal: No live threads left. Deadlock?
3 threads, 3 sleeps current:0x000000014a83b950 main thread:0x000000015a6048e0
* #<Thread:0x0000000100ec4d10 sleep_forever>
rb_thread_t:0x000000015a6048e0 native:0x00000001faaf9b40 int:0
* #<Thread:0x000000010107e4a8@DEBUGGER__::SESSION@server .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/session.rb:177 sleep_forever>
rb_thread_t:0x000000014a83b950 native:0x000000016f393000 int:0
* #<Thread:0x0000000104d64548@Timeout stdlib thread .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/timeout-0.3.1/lib/timeout.rb:101 sleep_forever>
rb_thread_t:0x000000014a9f1ce0 native:0x000000016f59f000 int:0
>,
[".rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:874:in `pop'",
".rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:874:in `wait_next_action_'",
".rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:856:in `wait_next_action'",
".rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:320:in `suspend'",
".rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:251:in `on_breakpoint'",
".rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/breakpoint.rb:69:in `suspend'",
".rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/breakpoint.rb:178:in `block in setup'",
".rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/session.rb:2586:in `debugger'",
"test.rb:6:in `<main>'"]]
.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:874:in `pop': No live threads left. Deadlock? (fatal)
3 threads, 3 sleeps current:0x000000014a83b950 main thread:0x000000015a6048e0
* #<Thread:0x0000000100ec4d10 sleep_forever>
rb_thread_t:0x000000015a6048e0 native:0x00000001faaf9b40 int:0
* #<Thread:0x000000010107e4a8@DEBUGGER__::SESSION@server .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/session.rb:177 sleep_forever>
rb_thread_t:0x000000014a83b950 native:0x000000016f393000 int:0
* #<Thread:0x0000000104d64548@Timeout stdlib thread .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/timeout-0.3.1/lib/timeout.rb:101 sleep_forever>
rb_thread_t:0x000000014a9f1ce0 native:0x000000016f59f000 int:0
from .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:874:in `wait_next_action_'
from .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:856:in `wait_next_action'
from .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:320:in `suspend'
from .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/thread_client.rb:251:in `on_breakpoint'
from .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/breakpoint.rb:69:in `suspend'
from .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/breakpoint.rb:178:in `block in setup'
from .rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/debug-1.7.1/lib/debug/session.rb:2586:in `debugger'
from test.rb:6:in `<main>'
- Langage dominant
- Ruby
- Étoiles
- 1.3k
- Forks
- 146
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de ruby/debug
-
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
-
Support exceptionOptions in setExceptionBreakpoints to catch arbitrary exception classes via DAP Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
Toutes les issues de ruby/debug
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
バグ
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
-
Version bump for OpenVox 9 Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
voxpupuli/puppet-epel#186 · 1 commentaire ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) OuverteBug Frontend
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100