public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/31107] New: In non-stop mode ^C pauses 1-st thread disregarding currently focused one
@ 2023-12-01 14:02 hi-angel at yandex dot ru
  0 siblings, 0 replies; only message in thread
From: hi-angel at yandex dot ru @ 2023-12-01 14:02 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31107

            Bug ID: 31107
           Summary: In non-stop mode ^C pauses 1-st thread disregarding
                    currently focused one
           Product: gdb
           Version: 13.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: hi-angel at yandex dot ru
  Target Milestone: ---

When `non-stop` is `on` and you focus a thread different from 1, then `continue
-a`; pressing ^C always interrupts the `1st` thread.

Not only that makes no sense, this is problematic even because if the 1st
thread does some networking that you don't want to stop, you have no influence
over that.

IMO non-stop mode should not pause any thread whatsoever. The documentation
does not mention behavior regarding pressing ^C.

# Steps to reproduce *(in terms of terminal commands)*

As part of steps I use `firefox` as a popular multithreaded app, but the
problem is reproducible with any app that has 2 or more threads.

    $ gdb -q --nx -iex "set mi-async on" -iex "set non-stop on" -p $(pgrep
firefox)
    […]
    (gdb) i thr
      Id   Target Id                                             Frame
    * 1    Thread 0x7faf57499500 (LWP 238513) "firefox"         
0x00007faf5700ef6f in poll () from /usr/lib/libc.so.6
      2    Thread 0x7faf56cff6c0 (LWP 238516) "pool-spawner"    
0x00007faf5701a73d in syscall () from /usr/lib/libc.so.6
      3    Thread 0x7faf488ff6c0 (LWP 238517) "gmain"           
0x00007faf5700ef6f in poll () from /usr/lib/libc.so.6
      4    Thread 0x7faf480fe6c0 (LWP 238518) "gdbus"           
0x00007faf5700ef6f in poll () from /usr/lib/libc.so.6
    […]
    (gdb) thr 2
    [Switching to thread 2 (Thread 0x7faf56cff6c0 (LWP 238516))]
    #0  0x00007faf5701a73d in syscall () from /usr/lib/libc.so.6
    (gdb) c -a
    […]
    Quit                 # ^C is pressed
    (gdb) i thr
      Id   Target Id                                             Frame
      1    Thread 0x7faf57499500 (LWP 238513) "firefox"         
0x00007faf5700ef6f in poll () from /usr/lib/libc.so.6
    * 2    Thread 0x7faf56cff6c0 (LWP 238516) "pool-spawner"     (running)
      3    Thread 0x7faf488ff6c0 (LWP 238517) "gmain"            (running)
      4    Thread 0x7faf480fe6c0 (LWP 238518) "gdbus"            (running)

## Expected

`Thread 1` in the last output is not stopped (either because `Thread 2` is
stopped instead, or because no threads stopped whatsoever since we are in
non-stop mode).

## Actual

`Thread 1` is stopped at `poll()`.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-01 14:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-01 14:02 [Bug gdb/31107] New: In non-stop mode ^C pauses 1-st thread disregarding currently focused one hi-angel at yandex dot ru

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 read-only IMAP folder(s) and NNTP newsgroup(s).