Bug 837470

Summary: libvirtd crash when virsh find-storage-pool-sources
Product: Red Hat Enterprise Linux 6 Reporter: Huang Wenlong <whuang>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.4CC: acathrow, cwei, dallan, dyasny, dyuan, mzhan, rwu, zhpeng
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.0-0rc0.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:18:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 840699    
Attachments:
Description Flags
libvirtd gdb debug none

Description Huang Wenlong 2012-07-04 03:24:23 UTC
Created attachment 596130 [details]
libvirtd gdb debug

Description of problem:
libvirtd crash when  virsh find-storage-pool-sources

Version-Release number of selected component (if applicable):
libvirt-0.9.13-2.el6.x86_64

How reproducible:
100%

Steps to Reproduce:


1.[root@intel-q9400-4-1 tmp]# virsh  find-storage-pool-sources netfs /tmp/netfs.xml
error: Failed to find any netfs pool sources
error: End of file while reading data: Input/output error

2.[root@intel-q9400-4-1 tmp]# virsh list
error: Failed to reconnect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused

3.# /etc/init.d/libvirtd status
libvirtd dead but pid file exists


4.# cat netfs.xml
<source>
    <host name="10.66.90.121"/>
    <dir path="/vol/S3/libvirtauto"/>
    <format type="nfs"/>
</source>



Actual results:
as steps

Expected results:
libvirtd do not crash

Additional info:

Comment 3 Peter Krempa 2012-07-09 14:38:49 UTC
Crash fixed upstream with:
commit ab9c72ae9e55e7190f52ad1550624630a5c7f78b
Author: Peter Krempa <pkrempa>
Date:   Mon Jul 9 14:10:05 2012 +0200

    storage_backend_fs: Don't free a part of a structure on error


With this commit applied the command still regresses outputing an error every time. This regression is also now fixed upstream by:

commit 48b78519983d403f0c81b9abc37e9de773331aef
Author: Peter Krempa <pkrempa>
Date:   Mon Jul 9 14:37:01 2012 +0200

    storage_backend_fs: Allocate entry for host before accessing it
    
    Commit 122fa379de44a2fd0a6d5fbcb634535d647ada17 introduces option to
    store more than one host entry in a storage pool source definition. That
    commit causes a regression, where a check is added that only one host
    entry should be present (that actualy is not present as the source
    structure was just allocated and zeroed) instead of allocating memory
    for the host entry.

Moving to POST, as 6.4 will be picking this up in a rebase.

Comment 5 zhpeng 2012-08-06 05:17:04 UTC
Test it with libvirt-0.10.0-0rc0.el6:

# cat /tmp/netfs.xml 

<source>
    <host name="10.66.6.209"/>
            <format type="nfs"/>
</source>
# virsh find-storage-pool-sources netfs /tmp/netfs.xml 
<sources>
  <source>
    <host name='10.66.6.209'/>
    <dir path='/nfs'/>
    <format type='nfs'/>
  </source>
  <source>
    <host name='10.66.6.209'/>
    <dir path='/virt'/>
    <format type='nfs'/>
  </source>
</sources>

# service libvirtd status
libvirtd (pid  15155) is running...


Change this to verified

Comment 6 errata-xmlrpc 2013-02-21 07:18:28 UTC
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/RHSA-2013-0276.html