Bug 996831 - qemu-kvm segmentation fault while boot guest from glusterfs with wrong host name
qemu-kvm segmentation fault while boot guest from glusterfs with wrong host name
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Ademar Reis
Virtualization Bugs
: TestOnly
Depends On:
  Show dependency treegraph
Reported: 2013-08-14 01:45 EDT by mazhang
Modified: 2016-09-20 00:39 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 996829
: 998778 (view as bug list)
Last Closed: 2014-06-13 06:26:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description mazhang 2013-08-14 01:45:50 EDT
+++ This bug was initially created as a clone of Bug #996829 +++

Description of problem:
Actually , this problem from a mistake. Just wanna access image with host name from gluster server , but forgot add host name and ip address into /etc/hosts. then try boot up guest will segmentation fault.

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

host: RHEL-7.0-20130628.0

gluster server: RHS-2.1-20130806.n.2

How reproducible:

Steps to Reproduce:
1. [root@m-qz ~]# ping gluster-server
ping: unknown host gluster-server

2. boot up guest with:
-netdev tap,id=hostnet0,vhost=on \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:39:13:2c \
-drive file=gluster://gluster-server/vol/rhel6u5.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=threads \
-device virtio-blk-pci,scsi=off,bus=pci.0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=0 \ 

Actual results:
qemu-kvm segmentation fault.

Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffeaa26700 (LWP 19877)]
[New Thread 0x7fffea225700 (LWP 19878)]
[New Thread 0x7fffe8f49700 (LWP 19879)]
[New Thread 0x7fffe8122700 (LWP 19880)]
qemu-kvm: -drive file=gluster://gluster-server/vol/rhel6u5.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=threads: Gluster connection failed for server=gluster-server port=0 volume=vol image=rhel6u5.qcow2 transport=tcp

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5c475c8 in glfs_lseek () from /lib64/libgfapi.so.0
(gdb) bt
#0  0x00007ffff5c475c8 in glfs_lseek () from /lib64/libgfapi.so.0
#1  0x00005555555e5788 in qemu_gluster_getlength ()
#2  0x00005555555da700 in bdrv_open_common ()
#3  0x00005555555df7fa in bdrv_file_open ()
#4  0x00005555555df9e5 in bdrv_open ()
#5  0x000055555560e24e in drive_init ()
#6  0x000055555572d0ab in drive_init_func ()
#7  0x000055555585b96b in qemu_opts_foreach ()
#8  0x00005555555c401a in main ()

Expected results:
quit with warning.

Additional info:
1. add ip address and host name in to "/etc/hosts", will works well.
2. rhel6u5 hit this problem, but backtrace seems like different.
Comment 2 Asias He 2013-08-14 03:03:20 EDT
Reproduced. This affects upstream qemu as well.
Comment 3 Asias He 2013-08-14 03:12:06 EDT
In block/gluster.c

qemu_gluster_init {
   ret = glfs_init(glfs);
    if (ret) {
        goto out;
    return glfs;

    if (glfs) {
        old_errno = errno;
        errno = old_errno;
    return NULL;

glfs_init does not setup errno. So even if glfs_init fails errno is set to 0.

In block/gluster.c, we will return 0 when qemu_gluster_init fails.
qemu_gluster_open {
    s->glfs = qemu_gluster_init(gconf, filename);
    if (!s->glfs) {
        ret = -errno;
        goto out;


  glfs_init: Initialize the 'virtual mount'


  This function initializes the glfs_t object. This consists of many steps:
  - Spawn a poll-loop thread.
  - Establish connection to management daemon and receive volume specification.
  - Construct translator graph and initialize graph.
  - Wait for initialization (connecting to all bricks) to complete.


  @fs: The 'virtual mount' object to be initialized.


   0 : Success.
  -1 : Failure. @errno will be set with the type of failure.
Comment 4 Ben Turner 2013-09-25 14:28:06 EDT
Patch posted in:

Comment 5 Ademar Reis 2013-10-08 22:17:14 EDT
Asias believes no code changes are needed now that the glusterfs bug has been fixed. Please test.
Comment 7 mazhang 2014-01-22 01:43:49 EST
(In reply to Ademar Reis from comment #5)
> Asias believes no code changes are needed now that the glusterfs bug has
> been fixed. Please test.

Glusterfs bug has been fixed, qemu-kvm no code changes.

Installed the latest package and test this bug.


Start qemu-kvm with:
-drive file=gluster://gluster/gv0/rhel7-64-bak.raw,if=none,id=drive-ide0-0-1,format=raw,cache=none,aio=threads \
-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-0-1,id=ide0-0-1,bootindex=0 \

Qemu-kvm quit with warning, no crash found.

qemu-kvm: -drive file=gluster://gluster/gv0/rhel7-64-bak.raw,if=none,id=drive-ide0-0-1,format=raw,cache=none,aio=threads: Gluster connection failed for server=gluster port=0 volume=gv0 image=rhel7-64-bak.raw transport=tcp
qemu-kvm: -drive file=gluster://gluster/gv0/rhel7-64-bak.raw,if=none,id=drive-ide0-0-1,format=raw,cache=none,aio=threads: could not open disk image gluster://gluster/gv0/rhel7-64-bak.raw: Could not open 'glusterfs:data_pair_t': Transport endpoint is not connected

This bug has been fixed.
Comment 9 Ludek Smid 2014-06-13 06:26:10 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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