qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* linux-user emulation hangs during fork
@ 2024-06-05  9:14 Andreas Schwab
  2024-06-05 11:10 ` Andreas Schwab
  2024-06-05 23:14 ` Richard Henderson
  0 siblings, 2 replies; 5+ messages in thread
From: Andreas Schwab @ 2024-06-05  9:14 UTC (permalink / raw)
  To: qemu-devel

$ qemu-x86_64 --version
qemu-x86_64 version 9.0.50 (v9.0.0-1211-gd16cab541a)
Copyright (c) 2003-2024 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
$ ruby fork.rb
child
child: wait
grandchild
child: kill
$ qemu-x86_64 /usr/bin/ruby fork.rb
child
child: wait
^Z
[1]+  Stopped                 qemu-x86_64 /usr/bin/ruby fork.rb
$ grep SigB $(for p in $(pidof qemu-x86_64); do echo /proc/$p/status; done | sort)
/proc/3221/status:SigBlk:       0000000000000000
/proc/3224/status:SigBlk:       0000000000000000
/proc/3228/status:SigBlk:       fffffff27ffbfa9f

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-06-06 14:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-05  9:14 linux-user emulation hangs during fork Andreas Schwab
2024-06-05 11:10 ` Andreas Schwab
2024-06-05 23:14 ` Richard Henderson
2024-06-06  8:27   ` Andreas Schwab
2024-06-06 14:27     ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).