Bug 1124740

Summary: create connection via virt-manager will crash the remote libvirtd
Product: Red Hat Enterprise Linux 6 Reporter: yanbing du <ydu>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: high    
Version: 6.6CC: acathrow, dyuan, jtomko, mzhan, pkrempa, shyu, zhwang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-30 08:43:11 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:
Attachments:
Description Flags
libvirtd-crash.log none

Description yanbing du 2014-07-30 08:19:50 UTC
Description of problem:

On a Fedora20 host, when create a connection to connect libvirtd on a RHEL6.6 server via virt-manager, which will crash the server libvirtd. 

Version-Release number of selected component (if applicable):
Client:
virt-manager-1.0.1-3.fc20.noarch
Serevr:
libvirt-0.10.2-41.el6.x86_64
kernel-2.6.32-491.el6.x86_64 

How reproducible:
100%

Steps to Reproduce:
1. Create connection(rhel6.6 host) via virt-manager on a FC20 host. 
2.
3.

Actual results:
virt-manager raise:

Error polling connection 'qemu+ssh://root.7.209/system': internal error: client socket is closed

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 343, in _handle_tick_queue
    conn.tick(**kwargs)
  File "/usr/share/virt-manager/virtManager/connection.py", line 1209, in tick
    raise e  # pylint: disable=raising-bad-type
libvirtError: internal error: client socket is closed
    
And check the libvirtd status on remote server:
# service libvirtd status
libvirtd dead but pid file exists 

Expected results:
Connect successfully, and libvirtd on the server will not crash. 

Additional info:

Comment 3 yanbing du 2014-07-30 08:25:55 UTC
Created attachment 922456 [details]
libvirtd-crash.log

Comment 4 Ján Tomko 2014-07-30 08:36:59 UTC
Relevant backtrace from the core dump:
Thread 1 (Thread 0x7f192a742700 (LWP 32281)):
#0  0x0000003a9d281461 in __strlen_sse2 () from /lib64/libc.so.6
#1  0x0000003a9d281176 in strdup () from /lib64/libc.so.6
#2  0x0000003768ea9eee in virDomainObjGetMetadata (vm=0x7f191c152d30, type=1, uri=0x0, caps=<value optimized out>, flags=0)
    at conf/domain_conf.c:16610
#3  0x000000000044f7f4 in qemuDomainGetMetadata (dom=0x7f18f406a5d0, type=1, uri=0x0, flags=0) at qemu/qemu_driver.c:14894
#4  0x0000003768f0155b in virDomainGetMetadata (domain=0x7f18f406a5d0, type=1, uri=0x0, flags=0) at libvirt.c:9623
#5  0x0000000000429e8c in remoteDispatchDomainGetMetadata (server=<value optimized out>, client=<value optimized out>, 
    msg=<value optimized out>, rerr=0x7f192a741b80, args=0x7f18f40154a0, ret=0x7f18f4015480) at remote_dispatch.h:2218
#6  remoteDispatchDomainGetMetadataHelper (server=<value optimized out>, client=<value optimized out>, msg=<value optimized out>, 
    rerr=0x7f192a741b80, args=0x7f18f40154a0, ret=0x7f18f4015480) at remote_dispatch.h:2191
#7  0x0000003768f44252 in virNetServerProgramDispatchCall (prog=0x1261480, server=0x1258a30, client=0x125c940, msg=0x125c540)
    at rpc/virnetserverprogram.c:431
#8  virNetServerProgramDispatch (prog=0x1261480, server=0x1258a30, client=0x125c940, msg=0x125c540) at rpc/virnetserverprogram.c:304
#9  0x0000003768f44eee in virNetServerProcessMsg (srv=<value optimized out>, client=0x125c940, prog=<value optimized out>, 
    msg=0x125c540) at rpc/virnetserver.c:170
#10 0x0000003768f4558c in virNetServerHandleJob (jobOpaque=<value optimized out>, opaque=0x1258a30) at rpc/virnetserver.c:191
#11 0x0000003768e64b0c in virThreadPoolWorker (opaque=<value optimized out>) at util/threadpool.c:144
#12 0x0000003768e643f9 in virThreadHelper (data=<value optimized out>) at util/threads-pthread.c:161
#13 0x0000003a9d6079d1 in start_thread () from /lib64/libpthread.so.0
---Type <return> to continue, or q <return> to quit---
#14 0x0000003a9d2e8ccd in ?? () from /lib64/libc.so.6
#15 0x0000000000000000 in ?? ()

Comment 5 Peter Krempa 2014-07-30 08:43:11 UTC
This was already fixed as a part of the original backport but the build wasn't done yet.

commit 7705900c436f9f8391ed9517db5c54feca375789
Author: Peter Krempa <pkrempa>
Date:   Thu Jul 17 14:50:39 2014 +0200

    conf: Fix backport of metadata API code
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1115039
    
    RHEL-only, problems introduced in backport
    
    The clang checker found a few issues introduced by the backports of the
    metadata code. As the code is already in dist-git this patch fixes up
    the problems pointed out by Clang:
    
    1) few possible strdup()'s of NULL argument
    2) false positive as Clang considered the def local variable in
    virDomainObjGetMetadata as uninitialized
    
    Signed-off-by: Jiri Denemark <jdenemar>

*** This bug has been marked as a duplicate of bug 1115039 ***