Summary: | app-emulation/libvirt-0.7.5 libvirtd segfaults | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Etaoin Shrdlu <shrdlu> |
Component: | Current packages | Assignee: | Lance Albertson (RETIRED) <ramereth> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | cardoe, dwc, hauschild.markus, huataihuang, virtualization, weeve3 |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | backtrace for libvirtd segfaulting |
Description
Etaoin Shrdlu
2010-01-29 12:29:08 UTC
# strace libvirtd ... socket(PF_NETLINK, SOCK_DGRAM, 15) = 10 fcntl(10, F_GETFD) = 0 fcntl(10, F_SETFD, FD_CLOEXEC) = 0 bind(10, {sa_family=AF_NETLINK, pid=0, groups=00000002}, 12) = 0 getsockname(10, {sa_family=AF_NETLINK, pid=6732, groups=00000002}, [12]) = 0 setsockopt(10, SOL_SOCKET, SO_PASSCRED, [1], 4) = 0 write(4, "\0", 1) = 1 futex(0x6921a0, FUTEX_WAKE_PRIVATE, 1) = 1 readlink("/sys/devices/virtual/dmi/id", 0x7fff2306eec0, 1024) = -1 ENOENT (No such file or directory) stat("/sys/devices/virtual/dmi/id/uevent", 0x7fff2306ff20) = -1 ENOENT (No such file or directory) open("/etc/localtime", O_RDONLY) = 11 fstat(11, {st_mode=S_IFREG|0644, st_size=118, ...}) = 0 fstat(11, {st_mode=S_IFREG|0644, st_size=118, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe872d08000 read(11, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0"..., 4096) = 118 lseek(11, -62, SEEK_CUR) = 56 read(11, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0"..., 4096) = 62 close(11) = 0 munmap(0x7fe872d08000, 4096) = 0 write(2, "12:30:56.156: error : udevSetupS"..., 11712:30:56.156: error : udevSetupSystemDev:1409 : Failed to get udev device for syspath '/sys/devices/virtual/dmi/id' ) = 117 close(10) = 0 write(2, "12:30:56.158: error : virStateIn"..., 9212:30:56.158: error : virStateInitialize:890 : Initialization of (null) state driver failed ) = 92 open("/etc/libvirt/secrets", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 10 brk(0x241e000) = 0x241e000 getdents(10, /* 2 entries */, 32768) = 48 getdents(10, /* 0 entries */, 32768) = 0 brk(0x2416000) = 0x2416000 close(10) = 0 write(4, "\0", 1) = 1 futex(0x6921a0, FUTEX_WAKE_PRIVATE, 1 <unfinished ...> +++ killed by SIGSEGV +++ Segmentation fault I've seen bug #301217. Rebuilding libvirt with USE=-udev fixes the problem. And no, rebuilding udev does not help. If libvirt is built with USE=udev, it segfaults at startup, even if I previously rebuild udev. libvirtd-0.7.6 is somewhat better in that using USE=udev doen't segfaults, but still it doesn't start. # libvirtd 09:59:19.162: error : udevSetupSystemDev:1477 : Failed to get udev device for syspath '/sys/devices/virtual/dmi/id' or '/sys/class/dmi/id' 09:59:19.162: error : virStateInitialize:890 : Initialization of udev state driver failed 09:59:19.162: warning : qemudStartup:1099 : Unable to create cgroup for driver: No such device or address 09:59:19.187: error : main:3154 : Driver state initialization failed 09:59:19.187: warning : qemudDispatchSignalEvent:385 : Shutting down on signal 3 # strace libvirtd ... fstat(11, {st_mode=S_IFREG|0600, st_size=1242, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4273931000 read(11, "<domain type='kvm'>\n <name>CMED"..., 16384) = 1242 read(11, "", 12288) = 0 lseek(11, 0, SEEK_CUR) = 1242 lseek(11, 0, SEEK_SET) = 0 read(11, "<domain type='kvm'>\n <name>CMED"..., 4096) = 1242 read(11, "", 4096) = 0 read(11, "", 4096) = 0 close(11) = 0 munmap(0x7f4273931000, 4096) = 0 getdents(10, /* 0 entries */, 32768) = 0 close(10) = 0 getuid() = 0 geteuid() = 0 open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 10 lseek(10, 0, SEEK_CUR) = 0 fstat(10, {st_mode=S_IFREG|0644, st_size=1443, ...}) = 0 mmap(NULL, 1443, PROT_READ, MAP_SHARED, 10, 0) = 0x7f4273931000 lseek(10, 1443, SEEK_SET) = 1443 munmap(0x7f4273931000, 1443) = 0 close(10) = 0 uname({sys="Linux", node="rowlf", ...}) = 0 inotify_init() = 10 stat("/root/.uml", {st_mode=S_IFDIR|0755, st_size=48, ...}) = 0 inotify_add_watch(10, "/root/.uml", IN_MODIFY|IN_CREATE|IN_DELETE) = 1 write(4, "\0", 1) = 1 futex(0x69e580, FUTEX_WAKE_PRIVATE, 1) = 1 open("/etc/libvirt/uml", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory) getuid() = 0 write(2, "09:59:30.223: error : main:3154 "..., 69) = 69 kill(4122, SIGQUIT) = 0 --- SIGQUIT (Quit) @ 0 (0) --- write(6, "\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\32\20\0\0\0\0\0\0\"\v\222\0\0\0\0\0"..., 128) = 128 rt_sigreturn(0) = 0 futex(0x907ed0, FUTEX_WAKE_PRIVATE, 1) = 1 munmap(0x7f426d261000, 8392704) = 0 close(5) = 0 close(6) = 0 close(8) = 0 close(7) = 0 close(9) = 0 close(10) = 0 unlink("/var/run/libvirtd.pid") = 0 exit_group(1) = ? Another problem I see with 0.7.6 is that now PXE boot is broken. When trying to PXE boot with any driver, the message I get is: LC_ALL=C PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin HOME=/ QEMU_AUDIO_DRV=none /usr/bin/qemu-kvm -S -M pc-0.12 -cpu qemu32 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name XP2 -uuid b6bb9ab7-25f7-c6cb-ebc6-eaca098c0cfd -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/XP2.monitor,server,nowait -mon chardev=monitor,mode=readline -localtime -boot n -drive file=/home/shrdlu/virthd/XP2.img,if=none,id=drive-ide0-0-0,format=qcow2 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -device rtl8139,vlan=0,id=net0,mac=52:54:00:3e:41:23,bus=pci.0,addr=0x4 -net tap,fd=28,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -k en-gb -vga cirrus -device ES1370,id=sound0,bus=pci.0,addr=0x5 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 char device redirected to /dev/pts/5 Warning: vlan 0 with no nics Cannot boot from non-existent NIC while with 0.7.5 I get: LC_ALL=C PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.4 HOME=/root USER=root QEMU_AUDIO_DRV=none /usr/bin/qemu-kvm -S -M pc-0.12 -cpu qemu32 -enable-kvm -m 1024 -smp 1 -name XP2 -uuid b6bb9ab7-25f7-c6cb-ebc6-eaca098c0cfd -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/XP2.monitor,server,nowait -monitor chardev:monitor -localtime -boot n -drive file=/home/shrdlu/virthd/XP2.img,if=ide,index=0,format=qcow2 -net nic,macaddr=52:54:00:3e:41:23,vlan=0,name=nic.0 -net tap,fd=15,vlan=0,name=tap.0 -chardev pty,id=serial0 -serial chardev:serial0 -parallel none -usb -usbdevice tablet -vnc 127.0.0.1:0 -k en-gb -vga cirrus -soundhw es1370 char device redirected to /dev/pts/5 Option 'ipv4': Use 'on' or 'off' Failed to parse "yes" for "dummy.ipv4" but the VM at least starts. Can you follow the backtrace guide and provide a backtrace of libvirtd segfaulting, the guide is available here: http://www.gentoo.org/proj/en/qa/backtraces.xml Also, what does the following command output: $ udevadm info -q property --path /sys/devices/virtual/dmi/id (In reply to comment #5) > Also, what does the following command output: > > $ udevadm info -q property --path /sys/devices/virtual/dmi/id # udevadm info -q property --path /sys/devices/virtual/dmi/id device path not found For the backtrace, sorry but I won't be able to rebuild it with debugging enabled until the end of next week. Will provide the backtrace then. Thank you. Created attachment 220601 [details]
backtrace for libvirtd segfaulting
# emerge --info | grep FLAGS= CFLAGS="-march=native -O1 -pipe -ggdb" CXXFLAGS="-march=native -O1 -pipe -ggdb" LDFLAGS="-Wl,-O1" With the above flags, I rebuilt udev, glibc and libvirt (libvirt with USE=udev too, as that's what causes the problem) # gdb `which libvirtd` warning: Can not parse XML syscalls information; XML support was disabled at compile time. GNU gdb (Gentoo 7.0 p2) 7.0 Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". For bug reporting instructions, please see: <http://bugs.gentoo.org/>... Reading symbols from /usr/sbin/libvirtd...Reading symbols from /usr/lib64/debug/usr/sbin/libvirtd.debug...done. (no debugging symbols found)...done. (gdb) run Starting program: /usr/sbin/libvirtd [Thread debugging using libthread_db enabled] [New Thread 0x7ffff3133910 (LWP 22082)] [New Thread 0x7ffff2932910 (LWP 22083)] [New Thread 0x7ffff2131910 (LWP 22085)] [New Thread 0x7ffff1930910 (LWP 22089)] [New Thread 0x7ffff112f910 (LWP 22090)] [New Thread 0x7ffff092e910 (LWP 22094)] 16:03:52.429: error : udevSetupSystemDev:1409 : Failed to get udev device for syspath '/sys/devices/virtual/dmi/id' 16:03:52.429: error : virStateInitialize:890 : Initialization of (null) state driver failed 16:03:52.429: warning : qemudStartup:1067 : Unable to create cgroup for driver: No such device or address Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff3133910 (LWP 22082)] 0x000000000046d98b in udevEventHandleCallback (watch=3, fd=12, events=4, data=0x0) at node_device/node_device_udev.c:1345 1345 node_device/node_device_udev.c: No such file or directory. in node_device/node_device_udev.c (gdb) set logging file backtrace.log (gdb) set logging on Copying output to backtrace.log. (gdb) thread apply all bt full [see the attacchment http://bugs.gentoo.org/attachment.cgi?id=220601] Let me know if you need further information, thanks. Ok. Just to give you some feedback. There was a definite bug in the parser in 0.7.5, which is now fixed in 0.7.6 (mostly, I'm still seeing some issues). However, 0.7.6 considers missing dmi data as fatal. The fix is currently banging its way around the ML and once upstream commits it to their git master, I'll pull the patch in and that should fix the issue. Thanks! *** Bug 316063 has been marked as a duplicate of this bug. *** This is fixed for sure in the 0.8.1 versions in the tree. So this means that it will now be possible to build with USE=udev, is my understanding correct? (In reply to comment #13) > So this means that it will now be possible to build with USE=udev, is my > understanding correct? > Yep. You should be set now. |