# 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 ~]$
I can confirm this behavior in gdb 12.1 but it seems fixed as of gdb 14.1.
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 ~]$
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 ...