All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "John Y." <wjseven1707@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Guest crash when VNC connection is established with password (QEMU 2.5.1.1)
Date: Tue, 28 Aug 2018 10:33:07 +0100	[thread overview]
Message-ID: <20180828093307.GD25114@redhat.com> (raw)
In-Reply-To: <CAKAH_gkRfw1aPb8osySr+qj5vhiW_32coL95NgkQo4YE83zT6Q@mail.gmail.com>

On Tue, Aug 28, 2018 at 09:01:24AM +0800, John Y. wrote:
> (Sorry for repost,  I had asked in qemu-stable, but someone told me that I
> should send to qemu-devel.)
> 
> After I updated my Centos to 7.5.1804, my virtual machine crashed when I
> connected with vnc password.

[snip]

> > (qemu) change vnc password 12345678
> > (qemu)
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x00007ffff528cc80 in pthread_mutex_lock () from /lib64/libpthread.so.0
> > (gdb) bt
> > #0  0x00007ffff528cc80 in pthread_mutex_lock () from /lib64/libpthread.so.0
> > #1  0x0000555555a97f4a in qemu_mutex_lock (mutex=0x0) at
> > util/qemu-thread-posix.c:73
> > #2  0x0000555555a5cce3 in qcrypto_gcrypt_mutex_lock (priv=0x7ffff6e90ca0)
> > at crypto/init.c:97
> > #3  0x00007ffff6c217c5 in mutex_init () from /lib64/libgcrypt.so.11
> > #4  0x00007ffff6c21baa in _gcry_ath_mutex_lock () from
> > /lib64/libgcrypt.so.11
> > #5  0x00007ffff6c5ad20 in lock_pool () from /lib64/libgcrypt.so.11
> > #6  0x00007ffff6c5be2e in _gcry_rngcsprng_fast_poll () from
> > /lib64/libgcrypt.so.11
> > #7  0x00007ffff6c23d4d in _gcry_cipher_open () from /lib64/libgcrypt.so.11
> > #8  0x0000555555a60251 in qcrypto_cipher_new
> > (alg=QCRYPTO_CIPHER_ALG_DES_RFB, mode=QCRYPTO_CIPHER_MODE_ECB,
> > key=0x7fffffffdf30 "12345678\020", nkey=8, errp=0x7fffffffdf08) at
> > ./crypto/cipher-gcrypt.c:97

THis crash is caused by missing init of gcrypt. It is fixed in QEMU 2.8.0
with

commit 373166636b9f07c60d7c32610bd346acf7d143e9 (tag: pull-qcrypto-2016-10-20-1)
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Mon Oct 10 12:17:50 2016 +0100

    crypto: fix initialization of gcrypt threading
    
    The gcrypt threads implementation must be set before calling
    any other gcrypt APIs, especially gcry_check_version(),
    since that triggers initialization of the random pool. After
    that is initialized, changes to the threads impl won't be
    honoured by the random pool code. This means that gcrypt
    will think thread locking is needed and so try to acquire
    the random pool mutex, but this is NULL as no threads impl
    was set originally. This results in a crash in the random
    pool code.
    
    For the same reasons, we must set the gcrypt threads impl
    before calling gnutls_init, since that will also trigger
    gcry_check_version
    
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

> *3.  My Question*
> For some reasons I have to use qemu 2.5.11 and update Centos.
> (1) What causes this problem and how can I solve it ?

Upgrade to a newer QEMU, or backport the above patch (should be easy to
backport)

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

      reply	other threads:[~2018-08-28  9:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28  1:01 [Qemu-devel] Guest crash when VNC connection is established with password (QEMU 2.5.1.1) John Y.
2018-08-28  9:33 ` Daniel P. Berrangé [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180828093307.GD25114@redhat.com \
    --to=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wjseven1707@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.