Bug 1226029 - qemu linux-user emulation hangs on fork
Summary: qemu linux-user emulation hangs on fork
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: KVM (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-06 08:28 UTC by Andreas Schwab
Modified: 2024-06-06 13:10 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.