From: Aditya Kamath <Aditya.Kamath1@ibm.com>
To: Simon Marchi <simon.marchi@efficios.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@polymtl.ca>,
Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
SANGAMESH MALLAYYA <sangamesh.swamy@in.ibm.com>
Subject: Re: [PATCH 1/2] gdb: don't let SIGPIPE kill GDB in the pipe command
Date: Wed, 14 Oct 2026 09:32:42 +0000 [thread overview]
Message-ID: <DSWPR15MB3198171C47C0C67CCE6C00D769D69D2@DSWPR15MB319817.namprd15.prod.outlook.com> (raw)
In-Reply-To: <20261013171340.1748775-1-simon.marchi@efficios.com>
[-- Attachment #1: Type: text/plain, Size: 2424 bytes --]
Hi Simon,
Thanks for the quick fix.
I tested both patches on AIX 7.3 with a 64-bit GDB configured without
Python, running gdb.base/shell.exp with
"gmake check RUNTESTFLAGS=gdb.base/shell.exp". I ran it with the test
programs built with both -maix64 and -maix32.
expected unexpected unresolved
passes failures
original GDB + new test 112 4 9
patches 1 + 2, -maix64 121 4 0
patches 1 + 2, -maix32 121 4 0
Without the fix, the new test reproduces the problem every time. The log
shows:
(gdb) pipe lots | exit 0
ERROR: GDB process no longer exists
GDB process exited with wait status ... CHILDKILLED SIGPIPE {write on pipe with no readers}
After that GDB is gone, so the 9 checks in test_pipe_reader_exits_early
are all reported as UNRESOLVED. This is the same failure that gave me
75 unresolved results in a full 32-bit run of gdb.base. There it
happened on the first pipe test, so the rest of shell.exp was lost. With
the patches applied the test passes and there are no unresolved results.
The 4 remaining failures in shell.exp are not caused by your patches:
1: shell interrupt exitcode
2: shell interrupt exitsignal
3: pipe interrupt exitcode
4: pipe interrupt exitsignal
They fail the same way without the patches. The tests run "kill -2 $$"
under the shell and expect $_shell_exitsignal = 2. On AIX, /bin/sh and
/usr/bin/ksh are ksh88, which catches SIGINT and calls exit (130)
(128 + 2) instead of dying from the signal. GDB then sees a normal exit,
sets $_shell_exitcode = 130 and leaves $_shell_exitsignal void. I
checked the raw wait status of each shell:
/usr/bin/ksh exited, code 130
/usr/bin/ksh93 killed by signal 2
/usr/bin/bash killed by signal 2
So GDB reports what happened correctly, and the test assumes a shell
that dies from the signal. "shell" and "!" use $SHELL, and running with
SHELL=/usr/bin/bash makes those two [1 and 2] tests pass.
Do you think it would make sense to handle the ksh88 behaviour in a separate test-suite patch, by accepting $_shell_exitcode = 130 and $_shell_exitsignal = void on AIX??
Otherwise, patches 1 and 2 works on AIX.
Thanks,
Aditya
[-- Attachment #2: Type: text/html, Size: 10488 bytes --]
next prev parent reply other threads:[~2026-10-14 9:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 17:13 Simon Marchi
2026-10-13 17:13 ` [PATCH 2/2] gdb: preserve shell command exit status in pipe command on EPIPE Simon Marchi
2026-10-14 12:46 ` Tom Tromey
2026-10-14 9:32 ` Aditya Kamath [this message]
2026-10-14 12:42 ` [PATCH 1/2] gdb: don't let SIGPIPE kill GDB in the pipe command Tom Tromey
2026-10-14 12:56 ` Simon Marchi
2026-10-14 12:46 ` Tom Tromey
2026-10-14 12:57 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DSWPR15MB3198171C47C0C67CCE6C00D769D69D2@DSWPR15MB319817.namprd15.prod.outlook.com \
--to=aditya.kamath1@ibm.com \
--cc=Ulrich.Weigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=sangamesh.swamy@in.ibm.com \
--cc=simon.marchi@efficios.com \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox