From fc52df4a06dd8368c305b25b9af5eb6907db8702 Mon Sep 17 00:00:00 2001 From: Elena Ilina Date: Mon, 20 Jul 2026 20:22:05 +0200 Subject: [PATCH 1/3] [PBCKP-3451] fix gdb sigabrt --- pg_probackup2/gdb.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pg_probackup2/gdb.py b/pg_probackup2/gdb.py index b7ca549..8682767 100644 --- a/pg_probackup2/gdb.py +++ b/pg_probackup2/gdb.py @@ -175,6 +175,18 @@ def continue_execution_until_running(self): def signal(self, sig): if 'KILL' in sig: self.remove_all_breakpoints() + # Avoid GDB 15.x SIGABRT: kill inferior directly, not via `signal`. + try: + pids = subprocess.check_output( + ['pgrep', '-P', str(self.gdb_pid)], + text=True + ).strip().split() + for pid in pids: + os.kill(int(pid), 9) + except (subprocess.CalledProcessError, ValueError): + pass + self.kill() + return self._execute(f'signal {sig}') def continue_execution_until_exit(self): @@ -195,6 +207,8 @@ def continue_execution_until_exit(self): ) def continue_execution_until_error(self): + if self._did_quit: + return self.remove_all_breakpoints() result = self._execute('continue', False) @@ -253,6 +267,8 @@ def quit(self): # use for breakpoint, run, continue def _execute(self, cmd, running=True): + if self._did_quit: + return [] output = [] self.proc.stdin.flush() self.proc.stdin.write(cmd + '\n') From 72c1f51b5512f757bb24427b85d9da5b41b939e5 Mon Sep 17 00:00:00 2001 From: vshepard Date: Mon, 20 Jul 2026 20:23:34 +0200 Subject: [PATCH 2/3] [PBCKP-3451] add guard for did_quit in functions gdb.py --- pg_probackup2/gdb.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pg_probackup2/gdb.py b/pg_probackup2/gdb.py index 8682767..fc14433 100644 --- a/pg_probackup2/gdb.py +++ b/pg_probackup2/gdb.py @@ -134,6 +134,8 @@ def set_breakpoint(self, location): ) def remove_all_breakpoints(self): + if self._did_quit: + return if not self.has_breakpoint: return @@ -149,6 +151,8 @@ def remove_all_breakpoints(self): ) def run_until_break(self): + if self._did_quit: + return result = self._execute('run', False) for line in result: if line.startswith('*stopped,reason="breakpoint-hit"'): @@ -158,6 +162,8 @@ def run_until_break(self): ) def continue_execution_until_running(self): + if self._did_quit: + return result = self._execute('continue') for line in result: @@ -190,6 +196,8 @@ def signal(self, sig): self._execute(f'signal {sig}') def continue_execution_until_exit(self): + if self._did_quit: + return self.remove_all_breakpoints() result = self._execute('continue', False) @@ -225,6 +233,8 @@ def continue_execution_until_error(self): 'Failed to continue execution until error.\n') def continue_execution_until_break(self, ignore_count=0): + if self._did_quit: + return if ignore_count > 0: result = self._execute( 'continue ' + str(ignore_count), From 6a6cb055a90b42d5e9edad661ba49e40271b1bdb Mon Sep 17 00:00:00 2001 From: vshepard Date: Mon, 20 Jul 2026 20:25:17 +0200 Subject: [PATCH 3/3] [PBCKP-3451] add OSErrors to except --- pg_probackup2/gdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pg_probackup2/gdb.py b/pg_probackup2/gdb.py index fc14433..141e2f9 100644 --- a/pg_probackup2/gdb.py +++ b/pg_probackup2/gdb.py @@ -189,7 +189,7 @@ def signal(self, sig): ).strip().split() for pid in pids: os.kill(int(pid), 9) - except (subprocess.CalledProcessError, ValueError): + except (subprocess.CalledProcessError, ValueError, OSError): pass self.kill() return