Bug 845460 - exit console will crash libvirtd
exit console will crash libvirtd
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2012-08-03 03:11 EDT by zhpeng
Modified: 2013-09-08 20:03 EDT (History)
11 users (show)

See Also:
Fixed In Version: libvirt-0.10.0-0rc1.el6
Doc Type: Bug Fix
Doc Text:
Bug in previously added feature
Story Points: ---
Clone Of:
Last Closed: 2013-02-21 02:20:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
libvirtd log (64.12 KB, text/plain)
2012-08-03 03:11 EDT, zhpeng
no flags Details

  None (edit)
Description zhpeng 2012-08-03 03:11:03 EDT
Created attachment 602074 [details]
libvirtd log

Description of problem:
exit console will crash libvirtd

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

How reproducible:

Steps to Reproduce:
[root@zhpeng ~]# virsh console test
Connected to domain test
Escape character is ^]           ------> press ctrl+]

[root@zhpeng ~]# 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

[root@zhpeng ~]# service libvirtd status
libvirtd dead but pid file exists

Actually results:
libvirtd crashed

Expected results:
all be fine

Additional info:
pls use "less" view the libvirtd.log
Comment 2 Alex Jia 2012-08-03 05:06:34 EDT
BTW, libvirt upstream is fine without this issue.
Comment 3 Peter Krempa 2012-08-03 05:14:01 EDT
(In reply to comment #2)
> BTW, libvirt upstream is fine without this issue.

The crash is reproducible also on upstream.
Comment 4 Alex Jia 2012-08-03 05:21:01 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > BTW, libvirt upstream is fine without this issue.
> The crash is reproducible also on upstream.

It's strange for me, I haven't reproduce it on upstream, but the crash is indeed reproducible on libvirt-0.10.0-0rc0.el6.x86_64, it's a use after free issue.
Comment 5 Peter Krempa 2012-08-03 05:29:25 EDT
Fix sent for review upstream

Comment 7 Peter Krempa 2012-08-03 17:50:39 EDT
Fixed upstream with:

commit 45edefc7a7bcbec988f54331ff37fc32e4bc2718
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Fri Aug 3 11:20:29 2012 +0200

    conf: Remove console stream callback only when freeing console helper
    Commit ba226d334acbc49f6751b430e0c4e00f69eef6bf tried to fix crash of
    the daemon when a domain with an open console was destroyed. The fix was
    wrong as it tried to remove the callback also when the stream was
    aborted, where at that point the fd stream driver was already freed and
    This patch clears the callbacks with a helper right before the hash is
    freed, so that it doesn't interfere with other codepaths where the
    stream object is freed.

and moving to POST.
Comment 9 hongming 2012-08-26 22:01:25 EDT
Verified it using libvirt-0.10.0-0rc1.el6.x86_64 , The result is expected. So move its status to VERIFIED.


1. # virsh console rhel6
Connected to domain rhel6
Escape character is ^]   ------> press ctrl+]

2.# virsh list 
 Id    Name                           State
 43    win                            running
 44    rhel6                          running

3.# service libvirtd status
libvirtd (pid  23792) is running...
Comment 10 errata-xmlrpc 2013-02-21 02:20:42 EST
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.


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