Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/debug/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,14 @@ def get_thread_client th = Thread.current

private def thread_stopper
TracePoint.new(:line) do
# When leave_subsession pops the subsession stack and sets @tc = nil,
# there is a window before the TracePoint is disabled where this block
# can still fire on other threads. Without this guard, the main thread
# (back in IRB's eval loop) would be paused by on_pause, but the
# session server is already waiting on @q_evt.pop -- causing a mutual
# deadlock ("No live threads left. Deadlock?").
next unless in_subsession?

# run on each thread
tc = ThreadClient.current
next if tc.management?
Expand Down