Skip to content

Kernel.#fork failed in child process when fork_mode is parent #623

@nirareba1969

Description

@nirareba1969

Your environment

  • ruby -v: ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]
  • rdbg -v: rdbg 1.5.0

Describe the bug

Kernel.#fork failed in child process when fork_mode is parent

To Reproduce

Script

require "debug"

DEBUGGER__::CONFIG[:fork_mode] = :parent

fork do
  puts 'parent forked.'
  fork do
    puts 'child forked.'
  end
end

Repository for try easily

https://github.com/nirareba1969/debug-test#for-docker

Expected behavior

DEBUGGER: Detaching after fork from child process 9
parent forked.
child forked.

Actual behavior

DEBUGGER: Detaching after fork from child process 9
parent forked.
/usr/local/bundle/gems/debug-1.5.0/lib/debug/session.rb:2140:in `_fork': no block given (yield) (LocalJumpError)
  from repro.rb:7:in `fork'
  from repro.rb:7:in `block in <main>'
  from repro.rb:5:in `fork'
  from repro.rb:5:in `<main>'

Additional context

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions