Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aditya Kamath <Aditya.Kamath1@ibm.com>
To: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	Aditya Vidyadhar Kamath <akamath996@gmail.com>,
	"simon.marchi@polymtl.ca" <simon.marchi@polymtl.ca>,
	"tom@tromey.com" <tom@tromey.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	SANGAMESH MALLAYYA <sangamesh.swamy@in.ibm.com>
Subject: Re: [PATCH v5 1/4] Remove stale legacy code from rs6000-aix-nat.c file.
Date: Tue, 13 Oct 2026 12:55:48 +0000	[thread overview]
Message-ID: <DSWPR15MB319817D17B50D16301CEEACAEED69E2@DSWPR15MB319817.namprd15.prod.outlook.com> (raw)
In-Reply-To: <5f894d2f4275c6f5a26e81182dcacb817f90467e.camel@de.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 3726 bytes --]

Hi Ulrich and community members,

>>                              64-bit            32-bit
>>                          before  after     before  after
>>  expected passes          41792  41802      41687  41541
>>  unexpected failures       2346   2343       2302   2294
>>  unexpected successes         1      1          1      1
>>  expected failures           17     17         15     15
>>  known failures              30     30         30     30
>>  unresolved testcases        30     29         11     86

>I'm a bit concerned about the significant increase of
>unresolved testcases on 32-bit.  This might indicate that
>some of the assumptions about the behavior of ptrace64
>with 32-bit inferiors could be inaccurate.

>Can you look into the root cause of those unresolved cases?


I looked at the 32-bit results from the post-patch run (gdb.base-32.log). The increase in unresolved testcases doesn't look related to ptrace64 or 32-bit inferior handling.


Of the 86 unresolved testcases, 75 come from a single test file, gdb.base/shell.exp. The other 11 are one each from attach, bp-cmds-continue-ctrl-c, execl-update-breakpoints, gdb-sigterm, interrupt-daemon-attach, jit-bfd-name, jit-elf-fork, jit-elf, longjmp-until-in-main, longjmp and tls-nothreads.


That is the same count as the baseline run, and the same set that shows up in the 64-bit log, so the whole increase comes from shell.exp.

The first pipe test in that file, "|p 123| exit 0", failed with:

      ERROR: GDB process no longer exists

      GDB process exited with wait status ... CHILDKILLED SIGPIPE

      UNRESOLVED: gdb.base/shell.exp: |p 123| exit 0


Once GDB died, every later test in the file failed with "Couldn't send ... to GDB". That accounts the 75 unresolved results and most of the drop in expected passes.


The likely cause is in pipe_command in gdb/cli/cli-cmds.c. It uses popen (<args>, "w") and writes the command output to the child. In this test the child command is simply exit 0. If it exits before GDB writes, the write raises SIGPIPE and GDB itself exits. Unlike some other code paths (for example gdb/compile/compile.c), pipe_command doesn't use scoped_ignore_sigpipe.


Also, shell.exp runs without a program loaded, so it doesn't exercise any code changed by the aix-thread or rs6000-aix-nat patches.


 I was also able to reproduce the race manually by running the equivalent command in a loop, from the gdb build directory:

      for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20;

            do

                  printf 'pipe p 123 | exit 0\nquit\n' | ./gdb -q -nx >/dev/null 2>&1

                  echo "$?”

            done

One of the 20 runs exited with status 141 (128 + SIGPIPE), and the other 19 exited with 0.


Here is the output:

0 0 0 0 0 0 0 0 0 0 0 0 141 0 0 0 0 0 0 0

I also re-ran shell.exp alone six times, from gdb/testsuite:

 gmake check RUNTESTFLAGS="gdb.base/shell.exp"


Results were the same in all six runs:

 # of expected passes 112

 # of unexpected failures 4


There were no unresolved results in any of the six runs. The 4 unexpected failures were the "shell interrupt" and "pipe interrupt" exitcode/exitsignal tests, which use "kill -2 $$". I haven't investigated why they fail on AIX. They are not related to this series.


Therefore, this appears to be a pre-existing race in pipe_command rather than an effect of this patch series.

Let me know if you need more details.

Thanks and regards,

Aditya.

[-- Attachment #2: Type: text/html, Size: 18714 bytes --]

  reply	other threads:[~2026-10-13 12:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 11:19 Aditya Vidyadhar Kamath
2026-10-13 11:19 ` [PATCH v5 2/4] Remove obsolete getthrds and HAVE_PTRACE64 configure checks Aditya Vidyadhar Kamath
2026-10-13 11:19 ` [PATCH v5 3/4] Modernise aix-thread.c by combining ptrace wrappers Aditya Vidyadhar Kamath
2026-10-13 11:19 ` [PATCH v5 4/4] Fix 32-bit GPR and SPR register reads/writes in pthdb callbacks Aditya Vidyadhar Kamath
2026-10-13 12:00 ` [PATCH v5 1/4] Remove stale legacy code from rs6000-aix-nat.c file Ulrich Weigand
2026-10-13 12:55   ` Aditya Kamath [this message]
2026-10-13 13:31     ` Ulrich Weigand
2026-10-13 17:16       ` Simon Marchi
2026-10-14  9:15         ` Aditya Kamath
2026-10-14 10:44           ` Ulrich Weigand
2026-10-15 13:38             ` Aditya Kamath
2026-10-15 14:37               ` Ulrich Weigand

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=DSWPR15MB319817D17B50D16301CEEACAEED69E2@DSWPR15MB319817.namprd15.prod.outlook.com \
    --to=aditya.kamath1@ibm.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=akamath996@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sangamesh.swamy@in.ibm.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=tom@tromey.com \
    /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