public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	Aditya Kamath1 <Aditya.Kamath1@ibm.com>
Cc: Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>
Subject: Re: [Patch] Fix Assertion pid 0 failure in AIX while running gdb.threads/foll-fork-other-thread
Date: Tue, 2 May 2023 12:53:37 +0000	[thread overview]
Message-ID: <540716db6567b15aa2b3c61b5e85ecbb51511f2a.camel@de.ibm.com> (raw)
In-Reply-To: <CH2PR15MB3544035B06D680B6CFC4DDDCD66F9@CH2PR15MB3544.namprd15.prod.outlook.com>

Aditya Kamath1 <Aditya.Kamath1@ibm.com> wrote:

>Yes it does cause leaks. Currently there are two places from where
>pd_disable () is called. One from aix_thread_tarhet::detach () where
>we have the inferior. Unfortunately this is not getting called at all
>and hence we are never actually detaching. We can take the case of the
>program pasted in this mail below. But even in complex programs
>detach has never been called. This makes me worried that I am missing
>something major. Am I??

::detach() is called when you detach from an inferior that GDB
attached to (i.e. when using the "detach" command).  It is not
called for an inferior that was actually started under GDB;
::mourn_inferior() is used in those cases.

>And when pd_disable () is called it is from the mourn inferior ().
>Here we do not have the inferior_ptid.pid nor the inf to catch hold
>of the exited thread/process..

Ah, right. There's indeed no inf argument (unfortunately), but you can
just use "current_inferior ()" instead.  This is guaranteed to be
set correctly at this point.

>Also I begin to see these warnings… 
>
>Starting program: /home/aditya/latest_gdb/binutils-gdb/gdb/foll-fork-other-thread
>[New Thread 258]
>[New inferior 2 (process 30278140)]
>warning: "/usr/lib/libpthreads.a": member "shr_comm.o" missing.
>warning: "/usr/lib/libpthread.a": member "shr_xpg5.o" missing.
>warning: "/usr/lib/libc.a": member "shr.o" missing.
>warning: Could not load shared library symbols for 3 libraries, e.g. /usr/lib/libpthreads.a(shr_comm.o).
>Use the "info sharedlibrary" command to see the complete listing.
[snip]
>Did this API change in the last few days?? Until Thursday all was fine
>and I was not seeing these warnings. I updated my GDB to the latest
>development branch today. 

I'm not aware of anything.  But if you noticed this when updating the
GDB sources recently, you might be able to find the specific commit
that introduced the breakage via bisect (binary search).

Bye,
Ulrich


  reply	other threads:[~2023-05-02 12:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27  9:45 Aditya Kamath1
2023-04-27 12:20 ` Ulrich Weigand
2023-05-02 11:49   ` Aditya Kamath1
2023-05-02 12:53     ` Ulrich Weigand [this message]
2023-05-02 13:55       ` Aditya Kamath1
2023-05-02 14:06         ` Ulrich Weigand
2023-05-02 14:40           ` Aditya Kamath1
2023-05-02 14:52             ` Ulrich Weigand
2023-05-02 15:22               ` Aditya Kamath1
2023-05-02 15:33                 ` 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=540716db6567b15aa2b3c61b5e85ecbb51511f2a.camel@de.ibm.com \
    --to=ulrich.weigand@de.ibm.com \
    --cc=Aditya.Kamath1@ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sangamesh.swamy@in.ibm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).