qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu-system-nios2 hangs when emulator is quit
@ 2017-10-10  7:20 Thomas Huth
  2017-10-10  7:57 ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2017-10-10  7:20 UTC (permalink / raw)
  To: Chris Wulff, Marek Vasut; +Cc: QEMU Developers

 Hi Chris, hi Marek,

I recently noticed that when I start qemu-system-nios2 (build from the
very latest git master branch) and then type "quit" at the monitor (or
simply try to close the GTK window), QEMU does not shut down right and
hangs somewhere in pause_all_vcpus() forever.
Do you have any idea what might be wrong here?

 Thanks,
  Thomas

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

* Re: [Qemu-devel] qemu-system-nios2 hangs when emulator is quit
  2017-10-10  7:20 [Qemu-devel] qemu-system-nios2 hangs when emulator is quit Thomas Huth
@ 2017-10-10  7:57 ` Marek Vasut
  2017-10-10  8:15   ` Thomas Huth
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2017-10-10  7:57 UTC (permalink / raw)
  To: Thomas Huth, Chris Wulff; +Cc: QEMU Developers

On 10/10/2017 09:20 AM, Thomas Huth wrote:
>  Hi Chris, hi Marek,

Hi,

> I recently noticed that when I start qemu-system-nios2 (build from the
> very latest git master branch) and then type "quit" at the monitor (or
> simply try to close the GTK window), QEMU does not shut down right and
> hangs somewhere in pause_all_vcpus() forever.
> Do you have any idea what might be wrong here?

Nope, can you debug it and ev. send patch ? We're talking about git
HEAD, right ?

>  Thanks,
>   Thomas
> 


-- 
Best regards,
Marek Vasut

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

* Re: [Qemu-devel] qemu-system-nios2 hangs when emulator is quit
  2017-10-10  7:57 ` Marek Vasut
@ 2017-10-10  8:15   ` Thomas Huth
  2017-10-10  8:58     ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2017-10-10  8:15 UTC (permalink / raw)
  To: Marek Vasut, Chris Wulff
  Cc: Richard Henderson, QEMU Developers, Paolo Bonzini

On 10.10.2017 09:57, Marek Vasut wrote:
> On 10/10/2017 09:20 AM, Thomas Huth wrote:
>>  Hi Chris, hi Marek,
> 
> Hi,
> 
>> I recently noticed that when I start qemu-system-nios2 (build from the
>> very latest git master branch) and then type "quit" at the monitor (or
>> simply try to close the GTK window), QEMU does not shut down right and
>> hangs somewhere in pause_all_vcpus() forever.
>> Do you have any idea what might be wrong here?
> 
> Nope, can you debug it and ev. send patch ?

Backtrace looks like this:

#0  0x00007ffff7931945 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00005555557cf9c5 in qemu_cond_wait (cond=cond@entry=0x555555b5f9c0 <qemu_pause_cond>, mutex=mutex@entry=0x555555b5fa40 <qemu_global_mutex>) at util/qemu-thread-posix.c:161
#2  0x0000555555606ee8 in pause_all_vcpus () at cpus.c:1620
#3  0x00005555555cc43a in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
    at vl.c:4906

Looks like the CPU does not get stopped right? Unfortunately, I've got no
good clue how to debug that further right now...

> We're talking about git HEAD, right ?

Yes.

 Thomas

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

* Re: [Qemu-devel] qemu-system-nios2 hangs when emulator is quit
  2017-10-10  8:15   ` Thomas Huth
@ 2017-10-10  8:58     ` Marek Vasut
  2017-10-10 15:19       ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2017-10-10  8:58 UTC (permalink / raw)
  To: Thomas Huth, Chris Wulff
  Cc: Richard Henderson, QEMU Developers, Paolo Bonzini

On 10/10/2017 10:15 AM, Thomas Huth wrote:
> On 10.10.2017 09:57, Marek Vasut wrote:
>> On 10/10/2017 09:20 AM, Thomas Huth wrote:
>>>  Hi Chris, hi Marek,
>>
>> Hi,
>>
>>> I recently noticed that when I start qemu-system-nios2 (build from the
>>> very latest git master branch) and then type "quit" at the monitor (or
>>> simply try to close the GTK window), QEMU does not shut down right and
>>> hangs somewhere in pause_all_vcpus() forever.
>>> Do you have any idea what might be wrong here?
>>
>> Nope, can you debug it and ev. send patch ?
> 
> Backtrace looks like this:
> 
> #0  0x00007ffff7931945 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
> #1  0x00005555557cf9c5 in qemu_cond_wait (cond=cond@entry=0x555555b5f9c0 <qemu_pause_cond>, mutex=mutex@entry=0x555555b5fa40 <qemu_global_mutex>) at util/qemu-thread-posix.c:161
> #2  0x0000555555606ee8 in pause_all_vcpus () at cpus.c:1620
> #3  0x00005555555cc43a in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
>     at vl.c:4906
> 
> Looks like the CPU does not get stopped right? Unfortunately, I've got no
> good clue how to debug that further right now...

I'd look at pause_all_vcpus() and check why it is stuck.
I'm a bit overloaded at the moment, so I don't have time to dig in it.

>> We're talking about git HEAD, right ?
> 
> Yes.
> 
>  Thomas
> 


-- 
Best regards,
Marek Vasut

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

* Re: [Qemu-devel] qemu-system-nios2 hangs when emulator is quit
  2017-10-10  8:58     ` Marek Vasut
@ 2017-10-10 15:19       ` Paolo Bonzini
  2017-10-10 16:23         ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2017-10-10 15:19 UTC (permalink / raw)
  To: Marek Vasut, Thomas Huth, Chris Wulff; +Cc: Richard Henderson, QEMU Developers

On 10/10/2017 10:58, Marek Vasut wrote:
>> #0  0x00007ffff7931945 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
>> #1  0x00005555557cf9c5 in qemu_cond_wait (cond=cond@entry=0x555555b5f9c0 <qemu_pause_cond>, mutex=mutex@entry=0x555555b5fa40 <qemu_global_mutex>) at util/qemu-thread-posix.c:161
>> #2  0x0000555555606ee8 in pause_all_vcpus () at cpus.c:1620
>> #3  0x00005555555cc43a in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
>>     at vl.c:4906
>>
>> Looks like the CPU does not get stopped right? Unfortunately, I've got no
>> good clue how to debug that further right now...
> I'd look at pause_all_vcpus() and check why it is stuck.
> I'm a bit overloaded at the moment, so I don't have time to dig in it.
> 

It's actually the CPU thread that is stuck because the
start-of-translation-block test is wrong and never succeeds:

0x7fd715fff0c0:  mov    -0x14(%rsp),%ebp
0x7fd715fff0c4:  test   %ebp,%ebp
0x7fd715fff0c6:  jl     0x7fd715fff0e4

It should be using %r14, not %rsp.  I've sent a patch.

Paolo

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

* Re: [Qemu-devel] qemu-system-nios2 hangs when emulator is quit
  2017-10-10 15:19       ` Paolo Bonzini
@ 2017-10-10 16:23         ` Marek Vasut
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2017-10-10 16:23 UTC (permalink / raw)
  To: Paolo Bonzini, Thomas Huth, Chris Wulff
  Cc: Richard Henderson, QEMU Developers

On 10/10/2017 05:19 PM, Paolo Bonzini wrote:
> On 10/10/2017 10:58, Marek Vasut wrote:
>>> #0  0x00007ffff7931945 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
>>> #1  0x00005555557cf9c5 in qemu_cond_wait (cond=cond@entry=0x555555b5f9c0 <qemu_pause_cond>, mutex=mutex@entry=0x555555b5fa40 <qemu_global_mutex>) at util/qemu-thread-posix.c:161
>>> #2  0x0000555555606ee8 in pause_all_vcpus () at cpus.c:1620
>>> #3  0x00005555555cc43a in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>)
>>>     at vl.c:4906
>>>
>>> Looks like the CPU does not get stopped right? Unfortunately, I've got no
>>> good clue how to debug that further right now...
>> I'd look at pause_all_vcpus() and check why it is stuck.
>> I'm a bit overloaded at the moment, so I don't have time to dig in it.
>>
> 
> It's actually the CPU thread that is stuck because the
> start-of-translation-block test is wrong and never succeeds:
> 
> 0x7fd715fff0c0:  mov    -0x14(%rsp),%ebp
> 0x7fd715fff0c4:  test   %ebp,%ebp
> 0x7fd715fff0c6:  jl     0x7fd715fff0e4
> 
> It should be using %r14, not %rsp.  I've sent a patch.

Oh nice, thank you :)

-- 
Best regards,
Marek Vasut

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

end of thread, other threads:[~2017-10-10 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-10  7:20 [Qemu-devel] qemu-system-nios2 hangs when emulator is quit Thomas Huth
2017-10-10  7:57 ` Marek Vasut
2017-10-10  8:15   ` Thomas Huth
2017-10-10  8:58     ` Marek Vasut
2017-10-10 15:19       ` Paolo Bonzini
2017-10-10 16:23         ` Marek Vasut

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).