All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1031920] [NEW] Linux user gdbserver does not respond to remote `Ctrl-C' interrupts
@ 2012-08-01 20:23 Meador Inge
  2015-10-14 15:27 ` [Qemu-devel] [Bug 1031920] " thierry bultel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Meador Inge @ 2012-08-01 20:23 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

The bug was reproduced in a recent mainline build for ARM Linux by
starting emulation with a gdbserver:

$ qemu-arm -g 1234 a.out

and then connecting from gdb:

(gdb) target remote :1234
Remote debugging using :1234
[New Remote target]
[Switching to Remote target]
0x00008ba8 in _start ()
(gdb) b main
Breakpoint 1 at 0x8cb0: file hello.c, line 5.
(gdb) cont
Continuing.

Breakpoint 1, main (argc=1, argv=0xf6fff24c) at hello.c:5
5	  int n = 0;
(gdb) l
1	#include <stdio.h>
2
3	int main (int argc, char **argv)
4	{
5	  int n = 0;
6
7	  for (;;) {
8	     printf ("Hello, World!\n");
9	     sleep (5);
10	  }
(gdb) cont
Continuing.
^C^CInterrupted while waiting for the program.
Give up (and stop debugging it)? (y or n) y

Notice that the `Ctrl-C' interrupts are ignored.

** Affects: qemu
     Importance: Undecided
         Status: New

** Description changed:

- The bug was reproduce in a recent mainline build for ARM Linux by
+ The bug was reproduced in a recent mainline build for ARM Linux by
  starting emulation with a gdbserver:
  
  $ qemu-arm -g 1234 a.out
  
  and then connecting from gdb:
  
  (gdb) target remote :1234
  Remote debugging using :1234
  [New Remote target]
  [Switching to Remote target]
  0x00008ba8 in _start ()
  (gdb) b main
  Breakpoint 1 at 0x8cb0: file hello.c, line 5.
  (gdb) cont
  Continuing.
  
  Breakpoint 1, main (argc=1, argv=0xf6fff24c) at hello.c:5
  5	  int n = 0;
  (gdb) l
  1	#include <stdio.h>
- 2	
+ 2
  3	int main (int argc, char **argv)
  4	{
  5	  int n = 0;
- 6	
+ 6
  7	  for (;;) {
  8	     printf ("Hello, World!\n");
  9	     sleep (5);
  10	  }
  (gdb) cont
  Continuing.
  ^C^CInterrupted while waiting for the program.
  Give up (and stop debugging it)? (y or n) y
  
  Notice that the `Ctrl-C' interrupts are ignored.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1031920

Title:
  Linux user gdbserver does not respond to remote  `Ctrl-C' interrupts

Status in QEMU:
  New

Bug description:
  The bug was reproduced in a recent mainline build for ARM Linux by
  starting emulation with a gdbserver:

  $ qemu-arm -g 1234 a.out

  and then connecting from gdb:

  (gdb) target remote :1234
  Remote debugging using :1234
  [New Remote target]
  [Switching to Remote target]
  0x00008ba8 in _start ()
  (gdb) b main
  Breakpoint 1 at 0x8cb0: file hello.c, line 5.
  (gdb) cont
  Continuing.

  Breakpoint 1, main (argc=1, argv=0xf6fff24c) at hello.c:5
  5	  int n = 0;
  (gdb) l
  1	#include <stdio.h>
  2
  3	int main (int argc, char **argv)
  4	{
  5	  int n = 0;
  6
  7	  for (;;) {
  8	     printf ("Hello, World!\n");
  9	     sleep (5);
  10	  }
  (gdb) cont
  Continuing.
  ^C^CInterrupted while waiting for the program.
  Give up (and stop debugging it)? (y or n) y

  Notice that the `Ctrl-C' interrupts are ignored.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1031920/+subscriptions

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

* [Qemu-devel] [Bug 1031920] Re: Linux user gdbserver does not respond to remote `Ctrl-C' interrupts
  2012-08-01 20:23 [Qemu-devel] [Bug 1031920] [NEW] Linux user gdbserver does not respond to remote `Ctrl-C' interrupts Meador Inge
@ 2015-10-14 15:27 ` thierry bultel
  2017-01-31  9:14 ` Thomas Huth
  2017-04-02  4:17 ` Launchpad Bug Tracker
  2 siblings, 0 replies; 4+ messages in thread
From: thierry bultel @ 2015-10-14 15:27 UTC (permalink / raw)
  To: qemu-devel

I have encountered that issue recently, and started some analysis.

The issue is due to  the fact that in qemu, gdbstub no longer reads the communication channel once
the debugged process is resumed with "cont".
Another way to say that, is that communication with gdb is only possible once the process thread execution
is re-routed in the gdb handler.

I am working on a fix.

The fix will consist in having an additional thread, launched that the internal gdbserver startup, 
that will be wakeup when the debugged process is resumed. 
That thread will be waiting on the communication channel for the eventually incoming CTRL-C request (0x3)
I start to have promising results but it still needs some testing.

Meanwhile, (this should likely be a separate discussion thread, but is somehow related with the named issue above)  ,
I also noticed that with multithreaded 
processes, a breakpoint does not suspend all the threads when it is hit. 
This is a little bit annoying, and does not match the expected behaviour that is typically seen on a pure native gdb debugging
session.

Once it is ready I will post a patch to qemu mailing list

Best regards
Thierry

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1031920

Title:
  Linux user gdbserver does not respond to remote  `Ctrl-C' interrupts

Status in QEMU:
  New

Bug description:
  The bug was reproduced in a recent mainline build for ARM Linux by
  starting emulation with a gdbserver:

  $ qemu-arm -g 1234 a.out

  and then connecting from gdb:

  (gdb) target remote :1234
  Remote debugging using :1234
  [New Remote target]
  [Switching to Remote target]
  0x00008ba8 in _start ()
  (gdb) b main
  Breakpoint 1 at 0x8cb0: file hello.c, line 5.
  (gdb) cont
  Continuing.

  Breakpoint 1, main (argc=1, argv=0xf6fff24c) at hello.c:5
  5	  int n = 0;
  (gdb) l
  1	#include <stdio.h>
  2
  3	int main (int argc, char **argv)
  4	{
  5	  int n = 0;
  6
  7	  for (;;) {
  8	     printf ("Hello, World!\n");
  9	     sleep (5);
  10	  }
  (gdb) cont
  Continuing.
  ^C^CInterrupted while waiting for the program.
  Give up (and stop debugging it)? (y or n) y

  Notice that the `Ctrl-C' interrupts are ignored.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1031920/+subscriptions

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

* [Qemu-devel] [Bug 1031920] Re: Linux user gdbserver does not respond to remote `Ctrl-C' interrupts
  2012-08-01 20:23 [Qemu-devel] [Bug 1031920] [NEW] Linux user gdbserver does not respond to remote `Ctrl-C' interrupts Meador Inge
  2015-10-14 15:27 ` [Qemu-devel] [Bug 1031920] " thierry bultel
@ 2017-01-31  9:14 ` Thomas Huth
  2017-04-02  4:17 ` Launchpad Bug Tracker
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2017-01-31  9:14 UTC (permalink / raw)
  To: qemu-devel

Has the fix mentioned in comment #1 been included in the QEMU
repository?

** Changed in: qemu
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1031920

Title:
  Linux user gdbserver does not respond to remote  `Ctrl-C' interrupts

Status in QEMU:
  Incomplete

Bug description:
  The bug was reproduced in a recent mainline build for ARM Linux by
  starting emulation with a gdbserver:

  $ qemu-arm -g 1234 a.out

  and then connecting from gdb:

  (gdb) target remote :1234
  Remote debugging using :1234
  [New Remote target]
  [Switching to Remote target]
  0x00008ba8 in _start ()
  (gdb) b main
  Breakpoint 1 at 0x8cb0: file hello.c, line 5.
  (gdb) cont
  Continuing.

  Breakpoint 1, main (argc=1, argv=0xf6fff24c) at hello.c:5
  5	  int n = 0;
  (gdb) l
  1	#include <stdio.h>
  2
  3	int main (int argc, char **argv)
  4	{
  5	  int n = 0;
  6
  7	  for (;;) {
  8	     printf ("Hello, World!\n");
  9	     sleep (5);
  10	  }
  (gdb) cont
  Continuing.
  ^C^CInterrupted while waiting for the program.
  Give up (and stop debugging it)? (y or n) y

  Notice that the `Ctrl-C' interrupts are ignored.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1031920/+subscriptions

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

* [Qemu-devel] [Bug 1031920] Re: Linux user gdbserver does not respond to remote `Ctrl-C' interrupts
  2012-08-01 20:23 [Qemu-devel] [Bug 1031920] [NEW] Linux user gdbserver does not respond to remote `Ctrl-C' interrupts Meador Inge
  2015-10-14 15:27 ` [Qemu-devel] [Bug 1031920] " thierry bultel
  2017-01-31  9:14 ` Thomas Huth
@ 2017-04-02  4:17 ` Launchpad Bug Tracker
  2 siblings, 0 replies; 4+ messages in thread
From: Launchpad Bug Tracker @ 2017-04-02  4:17 UTC (permalink / raw)
  To: qemu-devel

[Expired for QEMU because there has been no activity for 60 days.]

** Changed in: qemu
       Status: Incomplete => Expired

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1031920

Title:
  Linux user gdbserver does not respond to remote  `Ctrl-C' interrupts

Status in QEMU:
  Expired

Bug description:
  The bug was reproduced in a recent mainline build for ARM Linux by
  starting emulation with a gdbserver:

  $ qemu-arm -g 1234 a.out

  and then connecting from gdb:

  (gdb) target remote :1234
  Remote debugging using :1234
  [New Remote target]
  [Switching to Remote target]
  0x00008ba8 in _start ()
  (gdb) b main
  Breakpoint 1 at 0x8cb0: file hello.c, line 5.
  (gdb) cont
  Continuing.

  Breakpoint 1, main (argc=1, argv=0xf6fff24c) at hello.c:5
  5	  int n = 0;
  (gdb) l
  1	#include <stdio.h>
  2
  3	int main (int argc, char **argv)
  4	{
  5	  int n = 0;
  6
  7	  for (;;) {
  8	     printf ("Hello, World!\n");
  9	     sleep (5);
  10	  }
  (gdb) cont
  Continuing.
  ^C^CInterrupted while waiting for the program.
  Give up (and stop debugging it)? (y or n) y

  Notice that the `Ctrl-C' interrupts are ignored.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1031920/+subscriptions

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

end of thread, other threads:[~2017-04-02  4:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-01 20:23 [Qemu-devel] [Bug 1031920] [NEW] Linux user gdbserver does not respond to remote `Ctrl-C' interrupts Meador Inge
2015-10-14 15:27 ` [Qemu-devel] [Bug 1031920] " thierry bultel
2017-01-31  9:14 ` Thomas Huth
2017-04-02  4:17 ` Launchpad Bug Tracker

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.