Bug 29185 - GDB claims it was killed by a KeyboardInterrupt if it was killed by SIGTERM
Summary: GDB claims it was killed by a KeyboardInterrupt if it was killed by SIGTERM
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: cli (show other bugs)
Version: 12.1
: P2 enhancement
Target Milestone: 14.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-25 22:21 UTC by Volker Weißmann
Modified: 2024-02-18 17:23 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Weißmann 2022-05-25 22:21:22 UTC
# How to reproduce:

Start gdb, then run 
> pkill --signal SIGTERM gdb
in another terminal.

# Observed outcome

[volker@battle ~]$ gdb
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Exception ignored in: <gdb._GdbOutputFile object at 0x7fc1bed57160>
Traceback (most recent call last):
  File "/usr/share/gdb/python/gdb/__init__.py", line 47, in flush
    def flush(self):
KeyboardInterrupt: 
[volker@battle ~]$ 

# Expected Outcome:
Something like:

...

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) Received SIGTERM
[volker@battle ~]$
Comment 1 Frances Wingerter 2024-02-04 20:13:19 UTC
I can confirm this behavior in gdb 12.1 but it seems fixed as of gdb 14.1.
Comment 2 Volker Weißmann 2024-02-18 14:07:54 UTC
I tested version 14.1 and it seems to be fixed:

[volker@battle ~]$ gdb
GNU gdb (GDB) 14.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
[volker@battle ~]$
Comment 3 Tom de Vries 2024-02-18 17:23:42 UTC
Fixed by:
...
commit 3b431a3c9071d3e654e66a461e152c6bf8386096
Author: Kevin Buettner <kevinb@redhat.com>
Date:   Fri Mar 10 15:27:43 2023 -0700

    PR gdb/30219: Clear sync_quit_force_run in quit_force
...