Community Packages

Please read this before reporting a bug:
http://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#28735 - [libvirt] virsh segmentation fault

Attached to Project: Community Packages
Opened by yanglei (hydra35) - Thursday, 01 March 2012, 18:05 GMT
Last edited by Sergej Pupykin (sergej) - Thursday, 17 May 2012, 10:23 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 13
Private No

Details

Description: The following package combination will cause virsh to crash with segmentation fault every time it is invoked.

Libvirt: 0.9.10-1
Libnl: libnl-3.2.7-1
Libpcap:libpcap-1.2.1-2

While the following combination works:
Libvirt: 0.9.10-1
Libnl: libnl-1.1-3
Libpcap:libpcap-1.2.1-1

* config and/or log files etc.
Mar 2 01:43:40 D01 libvirtd: 6219: info : libvirt version: 0.9.10
Mar 2 01:43:40 D01 libvirtd: 6219: info : networkReloadIptablesRules:1512 : Reloading iptables rules
Mar 2 01:43:40 D01 libvirtd: 6219: info : qemudStartup:569 : Unable to create cgroup for driver: No such device or address
Mar 2 01:43:40 D01 libvirtd: 6219: info : qemudLoadDriverConfig:326 : Configured cgroup controller 'cpu'
Mar 2 01:43:40 D01 libvirtd: 6219: info : qemudLoadDriverConfig:326 : Configured cgroup controller 'cpuset'
Mar 2 01:43:40 D01 libvirtd: 6219: info : qemudLoadDriverConfig:326 : Configured cgroup controller 'memory'
Mar 2 01:43:40 D01 libvirtd: 6219: info : qemudLoadDriverConfig:326 : Configured cgroup controller 'devices'
Mar 2 01:43:40 D01 libvirtd: 6219: info : qemudLoadDriverConfig:326 : Configured cgroup controller 'blkio'
Mar 2 01:43:41 D01 libvirtd: 6219: info : virDomainLoadAllConfigs:12254 : Scanning for configs in /var/run/libvirt/qemu
Mar 2 01:43:41 D01 libvirtd: 6219: info : virDomainLoadAllConfigs:12254 : Scanning for configs in /etc/libvirt/qemu
Mar 2 01:43:41 D01 libvirtd: 6219: info : virDomainLoadAllConfigs:12254 : Scanning for configs in /var/run/libvirt/lxc
Mar 2 01:43:41 D01 libvirtd: 6219: info : virDomainLoadAllConfigs:12254 : Scanning for configs in /etc/libvirt/lxc
Mar 2 01:43:41 D01 libvirtd: 6219: info : umlStartup:478 : Adding inotify watch on /var/run/libvirt/uml-guest
Mar 2 01:43:41 D01 libvirtd: 6219: info : virDomainLoadAllConfigs:12254 : Scanning for configs in /etc/libvirt/uml
Mar 2 01:44:30 D01 kernel: [19286.538661] virsh[6280]: segfault at 28 ip 00007f8af921ab8d sp 00007fff6bbe8640 error 4 in libnl.so.1.1[7f8af91e4000+4d000]

Steps to reproduce:
1. Upgrade system: pacman -Syu
2. rc.d libvirtd start
3. virsh list <-- 100% segmentation fault
This task depends upon

Closed by  Sergej Pupykin (sergej)
Thursday, 17 May 2012, 10:23 GMT
Reason for closing:  Fixed
Additional comments about closing:  probably fixed with  FS#28945 
Comment by Nikos Skalkotos (skalkoto) - Thursday, 01 March 2012, 21:39 GMT
I want to confirm this. I think (wild guess) this has to do with the fact that libvirt ends up being linked against both libnl-3 and libnl-1.

In my case libguestfs segfaulted too, because it was linked against libvirt. All libvirt programs segfaults at the end when calling genl_unregister from /usr/lib/libnl.so.1

root@darkstar ~]# gdb virsh
GNU gdb (GDB) 7.4
Copyright (C) 2012 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-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/virsh...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/virsh
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[New Thread 0x7ffff0dde700 (LWP 476)]
Welcome to virsh, the virtualization interactive terminal.

Type: 'help' for help with commands
'quit' to quit

virsh # quit

[Thread 0x7ffff0dde700 (LWP 476) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff731fb8d in genl_unregister () from /usr/lib/libnl.so.1
(gdb) quit
A debugging session is active.

Inferior 1 [process 473] will be killed.

Quit anyway? (y or n) y



Comment by Sakis Hrist (sakishrist) - Friday, 02 March 2012, 11:23 GMT
I would like to confirm this as well. The behavior is exactly the same.
Comment by LoopBack (LoopBack) - Monday, 05 March 2012, 08:58 GMT
This also stops libvirt-glib (unsupported) from compiling.
Comment by Nikos Skalkotos (skalkoto) - Monday, 05 March 2012, 20:14 GMT
I did some debugging and my initial suspicion was correct. The problem is that libvirt links against libpcap and netcf. The former was patched recently to link against libnl-3 and the latter links against libnl-1. I recompiled libpcap without the "link_against_libnl-3" patch and after this libvirt works fine. I'm going to report this as a libpcap bug. Does libpcap gain anything by linking against a newer version of libnl?
Comment by yanglei (hydra35) - Tuesday, 06 March 2012, 19:01 GMT
Downgrade libpcap won't solve this issue. Assmue we roll back libpcap to depend on libnl 1.x which of course made Libvirt works.
But then we can not install any package that depend on libnl 3.x because it conflicts with libnl 1.x.

For now, packages such as net-snmp already depends on libnl 3.x and libnl is a core package which many other packages depend on, it will push its dependents to patching and upgrading.

It seems for me that the cleanest solution is to patch netcf to use libnl 3.x.
Comment by Tobias Hunger (hunger) - Monday, 14 May 2012, 22:06 GMT
This patch fixes netcf to build against libnl 3 for me:-)

No more crashes with virsh:-)
Comment by Tobias Hunger (hunger) - Monday, 14 May 2012, 22:07 GMT
Here is the actual file... somehow it get lost in the last comment.
Comment by Tobias Hunger (hunger) - Monday, 14 May 2012, 22:17 GMT
Note: the patch contains the existing patch to netcf...
Comment by Tobias Hunger (hunger) - Wednesday, 16 May 2012, 06:46 GMT
I filed https://bugs.archlinux.org/task/29908 against netcf, with a patch and updated PKGBUILD (to regenerate the configure script with the update in configure.ac).
Comment by Sergej Pupykin (sergej) - Thursday, 17 May 2012, 09:48 GMT
please try libvirt-0.9.12-3 and netcf-0.1.9-2

Loading...