Bug 523953 - Detaching device through virsh detach-device command fails - libvirtd segfault
Summary: Detaching device through virsh detach-device command fails - libvirtd segfault
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: rawhide
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Mark McLoughlin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F12VirtBlocker
TreeView+ depends on / blocked
 
Reported: 2009-09-17 11:33 UTC by Martin Banas
Modified: 2009-09-17 14:59 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-17 14:59:43 UTC


Attachments (Terms of Use)
VM_connection_failure traceback (15.80 KB, image/png)
2009-09-17 11:33 UTC, Martin Banas
no flags Details
VM_cannot_start traceback (15.83 KB, image/png)
2009-09-17 11:34 UTC, Martin Banas
no flags Details
gdb libvirtd (9.56 KB, text/plain)
2009-09-17 12:27 UTC, Martin Banas
no flags Details
(gdb) backtrace of libvirtd (1.72 KB, text/plain)
2009-09-17 12:35 UTC, Martin Banas
no flags Details

Description Martin Banas 2009-09-17 11:33:23 UTC
Created attachment 361483 [details]
VM_connection_failure traceback

Description of problem:
Detaching device through virsh detach-device command fails
error: Failed to detach device from XML-file
error: server closed connection

Version-Release number of selected component (if applicable):
libvirt-0.7.1-1.fc12.x86_64
virt-viewer-0.2.0-1.fc12.x86_64
virt-manager-0.8.0-3.fc12.noarch

How reproducible:
always

Steps to Reproduce:
1. install Fedora 12 by any means
2. install group Virtualization
3. run virt-manager and create new virtual machine
4. install F11-Gold into the virtual machine
5. reboot to the installed system and then shut down.

6. execute virsh edit <your_guest_name> , remove every <interface> blocks in the file, save the file
7. create new xml file:
<interface type='network'>
  <mac address='52:54:00:ab:cd:ef' />
  <source network='default' />
  <model type='virtio' />
</interface>
8. run the virtual machine through virt-manager. Open the window with your guest.

9. make sure that there is no interface in ifconfig than lo.
10. attach new interface by executing in console:
virsh attach-device <your_guest_name> <name_of_xml_file>
11. detach the interface by running:
virsh detach-device <your_guest_name> <name_of_xml_file>

  
Actual results:
in console:
error: Failed to detach device from XML-file
error: server closed connection

the viewer of the guest has closed, window "Virtual Machine Manager" is not responding.

running virt-manager again shows message:
see 'VM_connection_failure.png'

[root@hp-xw9400-01 ~]# /etc/init.d/libvirtd status
libvirtd dead but pid file exists

restarting libvirtd service and running virt-manager, virt-manager shows the guest is running. Stopping the guest and then running again shows error message: see 'VM_cannot_start.png'

Expected results:
No errors, root can detach device.

Additional info:
after rebooting the machine user is again able to start the virtual guest

Comment 1 Martin Banas 2009-09-17 11:34:35 UTC
Created attachment 361484 [details]
VM_cannot_start traceback

Comment 2 Martin Banas 2009-09-17 11:35:23 UTC
Kernel version: 2.6.31-14.fc12.x86_64

Comment 3 Mark McLoughlin 2009-09-17 11:56:57 UTC
Does /var/log/messages show that libvirtd segfaulted ?

if so, try this:

  $> service libvirtd stop
  $> yum install -y libvirt-debuginfo
  $> gdb libvirtd
  (gdb) run

and then repeat the procedure and capture a stack trace

Comment 4 Martin Banas 2009-09-17 12:27:16 UTC
Created attachment 361487 [details]
gdb libvirtd

Comment 5 Daniel Berrange 2009-09-17 12:30:58 UTC
You need to type 'backtrace' in the (gdb) prompt when it crashes to get a proper trace. The one you attached is just glibc output which isn't as detailed as what gdb will give us.

Comment 6 Martin Banas 2009-09-17 12:35:54 UTC
Created attachment 361491 [details]
(gdb) backtrace of libvirtd

Comment 7 Mark McLoughlin 2009-09-17 13:12:12 UTC
Looks like it's this:

  http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=2d6adabd53

+    } else {
+        VIR_FREE(vm->def->nets[0]);
+        vm->def->nnets = 0;
     }
+    virDomainNetDefFree(detach);

That should be:

+        VIR_FREE(vm->def->nets);

Fix coming soon

Comment 8 Mark McLoughlin 2009-09-17 14:59:43 UTC
Fixes are building in rawhide now:

* Thu Sep 17 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-4
- A couple of hot-unplug memory handling fixes (#523953)

I'll push them upstream too once they're reviewed

Thanks Marthin!


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