Bug 971904 - libvirtd crashes on startup with udev_log="debug" in /etc/udev/udev.conf
libvirtd crashes on startup with udev_log="debug" in /etc/udev/udev.conf
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
x86_64 Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
:
Depends On: 969152
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-07 10:21 EDT by Ján Tomko
Modified: 2013-11-21 04:02 EST (History)
6 users (show)

See Also:
Fixed In Version: libvirt-0.10.2-19.el6
Doc Type: Bug Fix
Doc Text:
Cause: Libvirt's logging function that was passed to libudev didn't handle strings with multiple parameters correctly. Consequence: Libvirtd could crash when libudev logged a message. Fix: Handle multiple parameters correctly. Result: Libvirtd doesn't crash when libudev logs messages.
Story Points: ---
Clone Of: 969152
Environment:
Last Closed: 2013-11-21 04:02:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ján Tomko 2013-06-07 10:21:59 EDT
+++ This bug was initially created as a clone of Bug #969152 +++

Version-Release number of selected component:
libvirt-daemon-0.10.2.4-1.fc18

Additional info:
reporter:       libreport-2.1.4
backtrace_rating: 4
cmdline:        /usr/sbin/libvirtd
crash_function: vasprintf
executable:     /usr/sbin/libvirtd
kernel:         3.9.4-200.fc18.x86_64
runlevel:       N 5
uid:            0

Truncated backtrace:
Thread no. 1 (10 frames)
 #2 vasprintf at /usr/include/bits/stdio2.h:210
 #3 virVasprintf at util/util.c:1984
 #4 virLogVMessage at util/logging.c:723
 #5 virLogMessage at util/logging.c:670
 #6 udev_log at src/libudev/libudev.c:64
 #7 udev_device_new_from_syspath at src/libudev/libudev-device.c:726
 #8 udevProcessDeviceListEntry at node_device/node_device_udev.c:1353
 #9 udevEnumerateDevices at node_device/node_device_udev.c:1386
 #10 udevDeviceMonitorStartup at node_device/node_device_udev.c:1704
 #11 virStateInitialize at libvirt.c:804

--- Additional comment from Ivan Makfinsky on 2013-06-06 19:17:05 EDT ---

Apparently I had udev_log="debug" in /etc/udev/udev.conf.

I set the log to info and libvirtd service starts up normally.

I found the solution here:

https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/968930

It shouldn't crash just because udev is logging debug messages.

--- Additional comment from Jan Tomko on 2013-06-07 09:48:10 EDT ---

Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2013-June/msg00349.html
Comment 2 Ján Tomko 2013-06-14 08:24:15 EDT
Fix is now committed upstream:
commit f753dd62f951cc62e164421d0c6491f39e4c68ad
Author:     Ján Tomko <jtomko@redhat.com>
AuthorDate: 2013-06-07 11:55:27 +0200
Commit:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2013-06-14 13:17:27 +0200

    udev: fix crash in libudev logging
    
    Call virLogVMessage instead of virLogMessage, since libudev
    called us with a va_list object, not a list of arguments.
    
    Honor message priority and strip the trailing newline.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=969152

git describe: v1.0.6-76-gf753dd6
And posted downstream:
http://post-office.corp.redhat.com/archives/rhvirt-patches/2013-June/msg00259.html
Comment 9 zhenfeng wang 2013-07-09 03:55:57 EDT
Verify this bug on libvirt libvirt-0.10.2-19.el6.x86_64
1.set the udev_log="debug" in /etc/udev/udev.conf
2.restart the libvirtd service
#service libvirtd restart
3.check the service status
# virsh list
 Id    Name                           State
----------------------------------------------------
 1     rhelguest1                     running

# ps aux|grep libvirtd
root      3083  0.0  0.0 1037828 14780 ?       Sl   14:16   0:00 libvirtd --daemon
# service libvirtd status
libvirtd (pid  3083) is running...
4.set the udev_log="error","udev_log=info" , udev_log="warning" or udev_log=$invalid value in the /etc/udev/udev.conf,then do the step 2,we can get the same result with step 3

Also I can reproduce this bug on libvirt-0.10.2-18
1.set the udev_log="debug" in /etc/udev/udev.conf
2.restart the libvirtd service
3.check the service status
# ps aux|grep libvirtd
root      3675  0.0  0.0 103244   828 pts/0    S+   14:49   0:00 grep libvirtd
# service libvirtd status
libvirtd dead but pid file exists

Since this issue works well in libvirt 0.10.2-19, also i can reproduce it on libvirt-0.10.2-18, so mark this bug verified
Comment 11 errata-xmlrpc 2013-11-21 04:02:32 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1581.html

Note You need to log in before you can comment on or make changes to this bug.