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 AIX thread NULL assertion failure during fork
Date: Wed, 22 Nov 2023 11:30:34 +0000	[thread overview]
Message-ID: <4eb94d0be784ca24961e36d988fadffcce6b6209.camel@de.ibm.com> (raw)
In-Reply-To: <CH2PR15MB35444EC543B7C8830A4CB0B1D6BAA@CH2PR15MB3544.namprd15.prod.outlook.com>

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

>So this was the issue. Thank you for suggesting this. I appreciate your knowledge
>to tell us this. Please see Program 1 and the GDB outputs pasted below this email
>for set detach-on-fork on/off and set follow-fork-mode=parent/child. This works
>in this test case and it looks like many other test cases as well are fixed from
>the GDB.base and GDB.threads test suite numbers mentioned below in a section.

Excellent, that's good to hear!

>Kindly let me know if this is okay.

I see one possible issue with the current patch - there is one
other existing caller to pd_activate in the ::wait routine:

      if (regcache_read_pc (regcache)
          - gdbarch_decr_pc_after_break (gdbarch) == data->pd_brk_addr)
        return pd_activate (ptid.pid ());
    }

  return pd_update (ptid.pid ());

This is the one place other than update_thread_list where you do
in fact need to call pd_update.  However, now that you've changed
pd_activate to no longer call pd_update, in the case where the
code above executes "return pd_activate", that call is now missing.

I think a straightforward fix might be to simply remove the "return"
and just fall through into the pd_update after pd_activate returned.

(Note that the return value of pd_activate should then no longer
be used anywhere and can be removed.)


Also, it looks like your're only updating the *current* inferior
in update_thread_list.  Other targets update the thread lists of
*all* inferiors.  E.g. have a look at the linux-thread-db.c
version of update_thread_list.


>Having said that we are missing some corner cases that I want to solve
>in a separate patch or the same depending on whatever you suggest.

Do the above change fix those corner cases?

Bye,
Ulrich


  reply	other threads:[~2023-11-22 11:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20  7:25 Aditya Kamath1
2023-11-20 11:27 ` Ulrich Weigand
2023-11-21  7:30   ` Aditya Kamath1
2023-11-21 12:17     ` Ulrich Weigand
2023-11-22 10:48       ` Aditya Kamath1
2023-11-22 11:30         ` Ulrich Weigand [this message]
2023-11-22 13:58           ` Aditya Kamath1
2023-11-22 14:14             ` Aditya Kamath1
2023-11-22 15:33               ` Ulrich Weigand
2023-11-22 16:22                 ` Aditya Kamath1
2023-11-22 18:30                   ` Ulrich Weigand
2023-11-23  6:06                     ` Aditya Kamath1

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=4eb94d0be784ca24961e36d988fadffcce6b6209.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).