Re: [uml-devel] How to reliably kill all vmlinux processes for a single VM?
On Mon, Aug 12, 2013 at 09:53:00AM +0100, Richard W.M. Jones wrote: > On Mon, Aug 12, 2013 at 10:15:24AM +0200, richard -rw- weinberger wrote: > > Found the root cause, patch is on the way. > > I can test patches if you CC me on them. I'm still available to test patches :-) Didn't see anything on this list nor on LKML. In particular I'm having a problem where it looks as if vmlinux is sending a signal to its parent process on shutdown. I can reliably reproduce this, although not with anything very minimal. But if you run the libguestfs test suite like this you'll see it: make -C tests/regressions check TESTS=rhbz914931 The parent process (a C program which for unrelated reasons is called 'rhbz914931') receives a SIGTERM. I checked the siginfo struct for this signal, and it appears to come from the vmlinux main process, which should not be happening. So .. possibly there's something awry with how vmlinux delivers signals to its child processes on shutdown which is causing it both to miss out some children, and to kill other unrelated processes. Or maybe this is just a coincidence. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] How to reliably kill all vmlinux processes for a single VM?
Am 13.08.2013 12:36, schrieb Richard W.M. Jones: > On Mon, Aug 12, 2013 at 09:53:00AM +0100, Richard W.M. Jones wrote: >> On Mon, Aug 12, 2013 at 10:15:24AM +0200, richard -rw- weinberger wrote: >>> Found the root cause, patch is on the way. >> >> I can test patches if you CC me on them. > > I'm still available to test patches :-) Didn't see anything on > this list nor on LKML. I'm currently on the road... > In particular I'm having a problem where it looks as if vmlinux is > sending a signal to its parent process on shutdown. > Really? If so, why does it not kill my shell if I run it directly? Thanks, //richard > I can reliably reproduce this, although not with anything very > minimal. But if you run the libguestfs test suite like this you'll > see it: > > make -C tests/regressions check TESTS=rhbz914931 > > The parent process (a C program which for unrelated reasons is called > 'rhbz914931') receives a SIGTERM. I checked the siginfo struct for > this signal, and it appears to come from the vmlinux main process, > which should not be happening. > > So .. possibly there's something awry with how vmlinux delivers > signals to its child processes on shutdown which is causing it both to > miss out some children, and to kill other unrelated processes. Or > maybe this is just a coincidence. > > Rich. > -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] How to reliably kill all vmlinux processes for a single VM?
On Tue, Aug 13, 2013 at 12:49:25PM +0200, Richard Weinberger wrote: > Am 13.08.2013 12:36, schrieb Richard W.M. Jones: > > In particular I'm having a problem where it looks as if vmlinux is > > sending a signal to its parent process on shutdown. > > Really? > If so, why does it not kill my shell if I run it directly? I've no idea. Perhaps you never send SIGTERM to the vmlinux process, or maybe this is just a very strange bug. Although it happens reliably in two tests from the test suite, it doesn't happen in any of the other tests (about 100 of them). Perhaps I'm wrong about the nature of the bug and the signal is coming from somewhere else. Is there a way that a process inside the guest could send a signal to a process on the host? (I would hope not, but have to ask in case something in the guest is going rogue). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] Using UML in libguestfs
On Sun, Aug 11, 2013 at 9:27 PM, Richard W.M. Jones wrote: > On Sun, Aug 11, 2013 at 09:05:08PM +0200, Geert Uytterhoeven wrote: >> On Fri, Aug 9, 2013 at 10:43 PM, Richard W.M. Jones >> wrote: >> > * UML is pretty fast! It's certainly faster (by a factor of > 5) than >> > spinning up a lightweight KVM VM. > >> This is interesting. Typically people say you have to use KVM or XEN >> for good virtualization performance. But for that you need >> sufficient privileges. > > I think this is true of Xen, but to be fair to KVM it doesn't require > special privileges, with one exception. If you want KVM to use a tunX > network interface then you have to start it as root (or use a setuid > helper). I think this is probably true of UML too although I've not There you name it... > explored UML's networking yet. Basically it's a restriction in Linux > itself. > >> With UML, all you need is to be able to compile and run your own >> executables. With UML, I can use slirp-fullbolt. So if I want to run e.g. wireshark on the development machine at work (no root for me), I just launch a UML with a Debian root fs that has wireshark and run my app. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk ___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Re: [uml-devel] How to reliably kill all vmlinux processes for a single VM?
OK, I understand what's going wrong and how to reproduce the signal-to-parent problem. It does look like a bug in vmlinux. It happens if the init process (PID 1) inside the VM gets a segfault. In libguestfs we can force that easily, as there is a test path for exercising segfaults in our init process: -- #!/bin/bash - export LIBGUESTFS_BACKEND=uml export LIBGUESTFS_QEMU=/home/rjones/d/linux/vmlinux export LIBGUESTFS_DEBUG=1 export LIBGUESTFS_TRACE=1 ./run strace -o /tmp/strace.log ./fish/guestfish -a /dev/null
Re: [uml-devel] How to reliably kill all vmlinux processes for a single VM?
On Tue, Aug 13, 2013 at 01:04:01PM +0100, Richard W.M. Jones wrote: > OK, I understand what's going wrong and how to reproduce the > signal-to-parent problem. It does look like a bug in vmlinux. > > It happens if the init process (PID 1) inside the VM gets a segfault. To add an additional data-point, applying the attached patch causes the rogue SIGTERM-to-parent signal to disappear. So at least we know where it comes from! Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v >From 73e2153039803d6f8cec7425ae501f857d9523a9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 13 Aug 2013 13:24:32 +0100 Subject: [PATCH] COMMENT OUT KILL SIGTERM --- arch/um/os-Linux/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c index 492ef5e..a0f308e 100644 --- a/arch/um/os-Linux/util.c +++ b/arch/um/os-Linux/util.c @@ -108,7 +108,7 @@ void os_dump_core(void) */ signal(SIGTERM, SIG_IGN); - kill(0, SIGTERM); + //kill(0, SIGTERM); /* * Most of the other processes associated with this UML are * likely sTopped, so give them a SIGCONT so they see the -- 1.8.3.1 -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel