On 11 July 2014 05:58, Liliang <liangx.z...@intel.com> wrote: > From: Li Liang <liangx.z...@intel.com> > > This bug was introduced in the commit > 9005b2a7589540a3733b3abdcfbccfe7746cd1a1, > it will cause deadlock when create a vm with the parameter "-monitor pty" and > then try to read from /dev/pts/x. > > Signed-off-by: Li Liang <liangx.z...@intel.com> > --- > qemu-char.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/qemu-char.c b/qemu-char.c > index 55e372c..55cdded 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -1103,9 +1103,11 @@ static gboolean pty_chr_timer(gpointer opaque) > s->timer_tag = 0; > if (!s->connected) { > /* Next poll ... */ > + qemu_mutex_unlock(&chr->chr_write_lock); > pty_chr_update_read_handler_locked(chr); > + } else { > + qemu_mutex_unlock(&chr->chr_write_lock); > } > - qemu_mutex_unlock(&chr->chr_write_lock); > return FALSE; > }
This is clearly not the correct fix -- it is now calling pty_chr_update_read_handler_locked() without holding the chr_write_lock mutex, which is not permitted. thanks -- PMM