Bug 249072

Summary: libvirtd crash on python-virtinst installation w/o vnc
Product: [Fedora] Fedora Reporter: Michael DeHaan <mdehaan>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 7CC: xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: x Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-04 12:14:17 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
Fix to avoid the crash scenario in cleanup
none
Fix to make VMs without VNC enabled startup correctly none

Description Michael DeHaan 2007-07-20 14:50:12 EDT
Description of problem:

In the process of adding qemu support to koan, danpb and I have discovered that
creating a qemu guest without a VNC option via libvirt results in a crash in
libvirtd, as libvirt cannot read any output from the creation and then
subsequently kills itself.  danpb indicated this may be a double free in libvirtd.

It is desirable to sometimes install qemu for security reasons.

(backtrace from gdb)

   1.
      Reading symbols from /lib/libnsl.so.1...done.
   2.
      Loaded symbols for /lib/libnsl.so.1
   3.
      Core was generated by `/usr/sbin/libvirtd'.
   4.
      Program terminated with signal 11, Segmentation fault.
   5.
      #0  qemudRemoveInactiveVM (driver=0x9c8f268, vm=0x9c938d8) at qemu_conf.c:1696
   6.
      1696            curr = curr->next;
   7.
      (gdb) backtrace
   8.
      #0  qemudRemoveInactiveVM (driver=0x9c8f268, vm=0x9c938d8) at qemu_conf.c:1696
   9.
      #1  0x00713a01 in qemudDomainCreate (conn=0x9c8e3b0,
  10.
          xml=0x9c93430 "<domain type='qemu'>\n  <name>asdf16</name>\n 
<currentMemory>524288</currentMemory>\n  <memory>524288</memory>\n 
<uuid>2a318787-d93a-472d-4e5b-8cb5376a969c</uuid>\n  <os>\n   
<type>hvm</type>\n    <kernel"...,
  11.
          flags=0) at qemu_driver.c:1833
  12.
      #2  0x006e7bab in virDomainCreateLinux (conn=0x9c8e3b0,
  13.
          xmlDesc=0x9c938d8 '�' <repeats 24 times>, "\005", flags=0) at
libvirt.c:741
  14.
      #3  0x08053c6c in ?? ()
  15.
      #4  0x09c8e3b0 in ?? ()
  16.
      #5  0x09c93430 in ?? ()
  17.
      #6  0x00000000 in ?? ()
  18.
      (gdb) 

print lastErr

$1 = {code = 1, domain = 10, 
<mdehaan>   message = 0x9c8d130 "Timed out while reading console startup output", 
<mdehaan>   level = VIR_ERR_ERROR, conn = 0x0, dom = 0x0, str1 = 0x0, str2 = 0x0, 
<mdehaan>   str3 = 0x0, int1 = -1, int2 = -1, net = 0x0}

From the logs:

/usr/bin/qemu -M pc -no-kqemu -m 512 -smp 1 -monitor pty -no-reboot -boot c
-kernel /tmp/vmlinuz -initrd /tmp/initrd.img -append
ks=http://172.16.57.21/cblr/kickstarts/c5-i386/ks.cfg ksdevice=eth0 lang=  text
syslog=172.16.57.21:25150 
method=http://mdehaan.rdu.redhat.com/cblr/links/c5-i386 -hda /opt/qemu/asdf16
-net nic,macaddr=00:16:3e:48:e8:b9,vlan=0 -net user,vlan=0 -nographic


Version-Release number of selected component (if applicable):

libvirt-0.3.0-1.fc7

How reproducible:

Very

Steps to Reproduce:

See description
  
Actual results:

libvirtd segfault

Expected results:

no libvirtd segfault

Additional info:

Can provide more info, help debug as needed.  Let me know.
Comment 1 Michael DeHaan 2007-07-20 14:51:25 EDT
line above should read "sometimes desirable to install qemu without VNC for
security reasons"

Comment 2 Daniel Berrange 2007-07-23 15:58:30 EDT
Created attachment 159809 [details]
Fix to avoid the crash scenario in cleanup
Comment 3 Daniel Berrange 2007-07-23 15:59:09 EDT
Created attachment 159810 [details]
Fix to make VMs without VNC enabled startup correctly
Comment 4 Daniel Berrange 2007-07-24 10:50:02 EDT
Committed upstream.
Comment 5 Daniel Berrange 2008-04-04 12:14:17 EDT
Long since pushed to F7 updates.