qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Crash when using -daemonize
@ 2015-03-09 21:03 Stefan Berger
  2015-03-09 21:34 ` Christian Borntraeger
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Berger @ 2015-03-09 21:03 UTC (permalink / raw)
  To: qemu-devel

Since an upgrade to Fedora 21, I get crashes with QEMU when using 
-daemonize. I noticed this since libvirt could not QMP probe QEMU.

This is the command line used:

x86_64-softmmu/qemu-system-x86_64 -S -no-user-config -nodefaults 
-nographic -M none -pidfile /tmp/foo -daemonize

Here's the backtrace from the coredump:

#0  0x00007fe653d5c8d7 in __GI_raise (sig=sig@entry=6)
     at ../sysdeps/unix/sysv/linux/raise.c:55
#1  0x00007fe653d5e53a in __GI_abort () at abort.c:89
#2  0x00007fe658c4cb80 in error_exit (err=<optimized out>,
     msg=msg@entry=0x7fe658f58580 <__func__.6036> "qemu_mutex_unlock")
     at util/qemu-thread-posix.c:48
#3  0x00007fe658edcab0 in qemu_mutex_unlock (
     mutex=mutex@entry=0x7fe6593a01c0 <qemu_global_mutex>)
     at util/qemu-thread-posix.c:93
#4  0x00007fe658c7a96c in qemu_mutex_unlock_iothread ()
     at /root/qemu/qemu-git.pt/cpus.c:1137
#5  0x00007fe658e7695f in os_host_main_loop_wait (timeout=-1)
     at main-loop.c:234
#6  main_loop_wait (nonblocking=<optimized out>) at main-loop.c:494
#7  0x00007fe658c4e82e in main_loop () at vl.c:1795
#8  main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
     at vl.c:4354

I am using today's tip of the QEMU git tree, but I don't think that's 
the actual problem.

Anyone have an idea? I reinstalled glibc, but that doesn't seem to solve 
what looks like a mutex problem.

    Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Crash when using -daemonize
  2015-03-09 21:03 [Qemu-devel] Crash when using -daemonize Stefan Berger
@ 2015-03-09 21:34 ` Christian Borntraeger
  2015-03-09 23:39   ` Stefan Berger
  2015-03-10  9:35   ` Paolo Bonzini
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Borntraeger @ 2015-03-09 21:34 UTC (permalink / raw)
  To: Stefan Berger, qemu-devel, Paolo Bonzini, Peter Maydell

Am 09.03.2015 um 22:03 schrieb Stefan Berger:
> Since an upgrade to Fedora 21, I get crashes with QEMU when using -daemonize. I noticed this since libvirt could not QMP probe QEMU.
> 
> This is the command line used:
> 
> x86_64-softmmu/qemu-system-x86_64 -S -no-user-config -nodefaults -nographic -M none -pidfile /tmp/foo -daemonize
> 
> Here's the backtrace from the coredump:
> 
> #0  0x00007fe653d5c8d7 in __GI_raise (sig=sig@entry=6)
>     at ../sysdeps/unix/sysv/linux/raise.c:55
> #1  0x00007fe653d5e53a in __GI_abort () at abort.c:89
> #2  0x00007fe658c4cb80 in error_exit (err=<optimized out>,
>     msg=msg@entry=0x7fe658f58580 <__func__.6036> "qemu_mutex_unlock")
>     at util/qemu-thread-posix.c:48
> #3  0x00007fe658edcab0 in qemu_mutex_unlock (
>     mutex=mutex@entry=0x7fe6593a01c0 <qemu_global_mutex>)
>     at util/qemu-thread-posix.c:93
> #4  0x00007fe658c7a96c in qemu_mutex_unlock_iothread ()
>     at /root/qemu/qemu-git.pt/cpus.c:1137
> #5  0x00007fe658e7695f in os_host_main_loop_wait (timeout=-1)
>     at main-loop.c:234
> #6  main_loop_wait (nonblocking=<optimized out>) at main-loop.c:494
> #7  0x00007fe658c4e82e in main_loop () at vl.c:1795
> #8  main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
>     at vl.c:4354
> 
> I am using today's tip of the QEMU git tree, but I don't think that's the actual problem.

I think it is. 
Paolo has posted a quick fix in the thread of "vl: take iothread lock very early".

Can you verify? 

Paolo, what is the status of this fix?



diff --git a/vl.c b/vl.c
index e1ffd0a..af61835 100644
--- a/vl.c
+++ b/vl.c
@@ -3759,7 +3759,9 @@ int main(int argc, char **argv, char **envp)

     loc_set_none();

+    qemu_mutex_unlock_iothread();
     os_daemonize();
+    qemu_mutex_lock_iothread();

     if (qemu_init_main_loop(&main_loop_err)) {
         error_report_err(main_loop_err);

> 
> Anyone have an idea? I reinstalled glibc, but that doesn't seem to solve what looks like a mutex problem.
> 
>    Stefan
> 
> 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Crash when using -daemonize
  2015-03-09 21:34 ` Christian Borntraeger
@ 2015-03-09 23:39   ` Stefan Berger
  2015-03-10  9:35   ` Paolo Bonzini
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Berger @ 2015-03-09 23:39 UTC (permalink / raw)
  To: Christian Borntraeger, qemu-devel, Paolo Bonzini, Peter Maydell

On 03/09/2015 05:34 PM, Christian Borntraeger wrote:
> Am 09.03.2015 um 22:03 schrieb Stefan Berger:
>> Since an upgrade to Fedora 21, I get crashes with QEMU when using -daemonize. I noticed this since libvirt could not QMP probe QEMU.
>>
>> This is the command line used:
>>
>> x86_64-softmmu/qemu-system-x86_64 -S -no-user-config -nodefaults -nographic -M none -pidfile /tmp/foo -daemonize
>>
>> Here's the backtrace from the coredump:
>>
>> #0  0x00007fe653d5c8d7 in __GI_raise (sig=sig@entry=6)
>>      at ../sysdeps/unix/sysv/linux/raise.c:55
>> #1  0x00007fe653d5e53a in __GI_abort () at abort.c:89
>> #2  0x00007fe658c4cb80 in error_exit (err=<optimized out>,
>>      msg=msg@entry=0x7fe658f58580 <__func__.6036> "qemu_mutex_unlock")
>>      at util/qemu-thread-posix.c:48
>> #3  0x00007fe658edcab0 in qemu_mutex_unlock (
>>      mutex=mutex@entry=0x7fe6593a01c0 <qemu_global_mutex>)
>>      at util/qemu-thread-posix.c:93
>> #4  0x00007fe658c7a96c in qemu_mutex_unlock_iothread ()
>>      at /root/qemu/qemu-git.pt/cpus.c:1137
>> #5  0x00007fe658e7695f in os_host_main_loop_wait (timeout=-1)
>>      at main-loop.c:234
>> #6  main_loop_wait (nonblocking=<optimized out>) at main-loop.c:494
>> #7  0x00007fe658c4e82e in main_loop () at vl.c:1795
>> #8  main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
>>      at vl.c:4354
>>
>> I am using today's tip of the QEMU git tree, but I don't think that's the actual problem.
> I think it is.
> Paolo has posted a quick fix in the thread of "vl: take iothread lock very early".
>
> Can you verify?

Yes, verified. And this solves this problem.

    Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Crash when using -daemonize
  2015-03-09 21:34 ` Christian Borntraeger
  2015-03-09 23:39   ` Stefan Berger
@ 2015-03-10  9:35   ` Paolo Bonzini
  1 sibling, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2015-03-10  9:35 UTC (permalink / raw)
  To: Christian Borntraeger, Stefan Berger, qemu-devel, Peter Maydell



On 09/03/2015 22:34, Christian Borntraeger wrote:
> I think it is. 
> Paolo has posted a quick fix in the thread of "vl: take iothread lock very early".
> 
> Can you verify? 
> 
> Paolo, what is the status of this fix?
> 

Sending a pull request today with the proper fix.

Paolo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-10  9:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-09 21:03 [Qemu-devel] Crash when using -daemonize Stefan Berger
2015-03-09 21:34 ` Christian Borntraeger
2015-03-09 23:39   ` Stefan Berger
2015-03-10  9:35   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).