From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F05483858C62; Fri, 1 Dec 2023 14:02:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F05483858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1701439353; bh=hlirgz82DjgMJlvP3yF6jKgDzv3TiZfFZELcdElJk8c=; h=From:To:Subject:Date:From; b=OMTFhEjsKUQrxjRizfy49akjrJA87EUO4GezznKqUf5j27ZhissnO2kjCVjvkZbDO DrXHhn8rokyMtl7e2ygyn5vnaKHw0kN9i6v8NxY2+CFf1gCBQtL/qX/8C7uZ1f9Cat 999/X1ayUG87IuMA6Fcj4EVuu0sRSMY67GF2tzLE= From: "hi-angel at yandex dot ru" To: gdb-prs@sourceware.org Subject: [Bug gdb/31107] New: In non-stop mode ^C pauses 1-st thread disregarding currently focused one Date: Fri, 01 Dec 2023 14:02:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 13.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hi-angel at yandex dot ru X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31107 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 `cont= inue -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 influe= nce 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) [=E2=80=A6] (gdb) i thr Id Target Id Frame * 1 Thread 0x7faf57499500 (LWP 238513) "firefox"=20=20=20=20=20=20= =20=20=20 0x00007faf5700ef6f in poll () from /usr/lib/libc.so.6 2 Thread 0x7faf56cff6c0 (LWP 238516) "pool-spawner"=20=20=20=20 0x00007faf5701a73d in syscall () from /usr/lib/libc.so.6 3 Thread 0x7faf488ff6c0 (LWP 238517) "gmain"=20=20=20=20=20=20=20= =20=20=20=20 0x00007faf5700ef6f in poll () from /usr/lib/libc.so.6 4 Thread 0x7faf480fe6c0 (LWP 238518) "gdbus"=20=20=20=20=20=20=20= =20=20=20=20 0x00007faf5700ef6f in poll () from /usr/lib/libc.so.6 [=E2=80=A6] (gdb) thr 2 [Switching to thread 2 (Thread 0x7faf56cff6c0 (LWP 238516))] #0 0x00007faf5701a73d in syscall () from /usr/lib/libc.so.6 (gdb) c -a [=E2=80=A6] Quit # ^C is pressed (gdb) i thr Id Target Id Frame 1 Thread 0x7faf57499500 (LWP 238513) "firefox"=20=20=20=20=20=20= =20=20=20 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()`. --=20 You are receiving this mail because: You are on the CC list for the bug.=