Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aditya Kamath <Aditya.Kamath1@ibm.com>
To: Tom Tromey <tom@tromey.com>,
	Aditya Vidyadhar Kamath <akamath996@gmail.com>
Cc: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	"simon.marchi@polymtl.ca" <simon.marchi@polymtl.ca>,
	"tom@tromey.com" <tom@tromey.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	SANGAMESH MALLAYYA <sangamesh.swamy@in.ibm.com>,
	PRAJWAL B MEHENDARKAR <PRAJWAL.B.MEHENDARKAR@ibm.com>
Subject: RE: [PATCH v5] Fix crash in AIX when current working directory is NULL
Date: Mon, 27 Jul 2026 06:48:57 +0000	[thread overview]
Message-ID: <LV8PR15MB6488C918DB3732AB272DF2C5D6CC2@LV8PR15MB6488.namprd15.prod.outlook.com> (raw)
In-Reply-To: <87cxwcr03m.fsf@tromey.com>

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

Hi Tom, Ulrich and community members,


>execing gdb seems problematic, for instance with a cross build gdb won't
>be the same host architecture as this test program.

>Is it not possible to start gdb, change its directory, and then remove
>the working directory from the .exp file?

The reason I could not do it in a simple .exp file is AIX is protecting the current working
directory when I try to delete.  It says the requested resource is busy.

So, I had to write a C code the fork () and child will delete the current working directory to mimic another terminal deleting the current working directory.

Then from the parent exec gdb with a binary having dwarf symbols to reproduce the crash.

For example:

bash-5.3# mkdir gdb_test
bash-5.3# cd gdb_test
bash-5.3# pwd
/tmp/gdb_test
bash-5.3#
bash-5.3# rm -rf ../*
rm: cannot remove '../gdb_test': The requested resource is busy.

bash-5.3#

This is the issue. We need to find a way to mimic someone deleting the cwd from another terminal in one test case. In the .exp file from what I know we cannot find a way to delete the current working directory and still start GDB from the deleted directory. Let me know if I am wrong here.

Thanks and regards,
Aditya.

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

  reply	other threads:[~2026-07-27  6:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  7:21 Aditya Vidyadhar Kamath
2026-07-24 13:25 ` Tom Tromey
2026-07-27  6:48   ` Aditya Kamath [this message]
2026-07-27 12:02     ` Ulrich Weigand
2026-07-28  7:00       ` Aditya Kamath
2026-07-28 10:09         ` Ulrich Weigand
2026-07-28 12:35           ` Aditya Kamath

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=LV8PR15MB6488C918DB3732AB272DF2C5D6CC2@LV8PR15MB6488.namprd15.prod.outlook.com \
    --to=aditya.kamath1@ibm.com \
    --cc=PRAJWAL.B.MEHENDARKAR@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