Bug 1226029

Summary: qemu linux-user emulation hangs on fork
Product: [openSUSE] openSUSE Tumbleweed Reporter: Andreas Schwab <schwab>
Component: KVMAssignee: E-mail List <kvm-bugs>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: fabiano.rosas
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Andreas Schwab 2024-06-06 08:28:56 UTC
$ qemu-x86_64 --version
qemu-x86_64 version 8.2.3 (openSUSE Tumbleweed)
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers
$ cat fork.rb 
begin
  r, w = IO.pipe
  if pid1 = fork
    w.close
    r.read 1
    Process.kill "USR1", pid1
    Process.wait2 pid1
  else
    print "child\n"
    r.close
    if pid2 = fork
      trap("USR1") { print "child: kill\n"; Process.kill "USR2", pid2 }
      w.close
      print "child: wait\n"
      Process.wait2 pid2
    else
      print "grandchild\n"
      w.close
      sleep 0.2
    end
  end
end
$ /usr/bin/ruby fork.rb
child
child: wait
grandchild
child: kill
$ qemu-x86_64 /usr/bin/ruby fork.rb 
child
child: wait
^Cfork.rb:5:in `read': Interrupt
        from fork.rb:5:in `<main>'
fork.rb:15:in `wait2': Interrupt
        from fork.rb:15:in `<main>'
Comment 1 Fabiano Rosas 2024-06-06 13:03:16 UTC
Hi Andreas, I see that you already started a discussion[1] upstream about this problem (thanks!). Do you believe there is something specific to Tumbleweed that is causing the issue? 

(just asking to make sure we don't start a new line of investigation on TW for no reason)

1- https://lore.kernel.org/r/mvm5xunu4ye.fsf@suse.de
Comment 2 Andreas Schwab 2024-06-06 13:10:13 UTC
I have no idea.