Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	"akamath996@gmail.com" <akamath996@gmail.com>,
	"tom@tromey.com" <tom@tromey.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	SANGAMESH MALLAYYA <sangamesh.swamy@in.ibm.com>,
	Aditya Kamath <Aditya.Kamath1@ibm.com>
Subject: Re: [PATCH v2] Fix asertion failure while analysing core files in AIX with terminated threads.
Date: Wed, 25 Mar 2026 11:17:40 -0400	[thread overview]
Message-ID: <42610d74-54cb-4fda-a0b9-57e79e2ba733@polymtl.ca> (raw)
In-Reply-To: <9de3ac99112872c11db88d6c0e8f77364f1284c4.camel@de.ibm.com>



On 2026-03-25 07:56, Ulrich Weigand wrote:
> Simon Marchi <simon.marchi@polymtl.ca> wrote:
>> On 3/24/26 10:15 AM, Aditya Vidyadhar Kamath wrote:
>>> From: Aditya Vidyadhar Kamath <aditya.kamath1@ibm.com>
>>>
>>> If we analyse core files today in AIX ( few of them ) we get,
>>>   regcache.c:432: internal-error: get_thread_regcache:
>>>   Assertion `thread->state != THREAD_EXITED' failed.
>>
>>> The reason being the aix-thread.c file where root cause is the
>>> sync_threadlists()
>>> function. When reading an AIX core file, threads are reported by
>>> libpthread library as being in PST_TERM (terminated) state, which
>>> is correct since process crashed. However, sync_threadlists() was
>>> calling delete_thread() for these terminated threads, marking them
>>> as THREAD_EXITED in GDBs internal state.
>>
>> Looking at how it works on Linux, the threads are in state
>> THREAD_STOPPED when looking at a core dump.  I think that
>> THREAD_STOPPED
>> makes sense, because when looking at a core, you are looking at a
>> snapshot of the process state when it was still alive, with all
>> threads stopped.
> 
> Isn't this actually what happens with Aditya's latest patch?
> Given that sync_threadlists is no longer called, all threads
> should remain in the state common code set up for them initially,
> which I think would be THREAD_STOPPED?
> 
> Bye,
> Ulrich

Ah ok, I didn't catch that, but now that I re-read the commit message it
indeed sounds like it, thanks.

Simon

  reply	other threads:[~2026-03-25 15:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 14:15 Aditya Vidyadhar Kamath
2026-03-24 16:12 ` Simon Marchi
2026-03-25 11:56   ` Ulrich Weigand
2026-03-25 15:17     ` Simon Marchi [this message]
2026-03-25 16:06 ` Ulrich Weigand
2026-03-26 10:10   ` 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=42610d74-54cb-4fda-a0b9-57e79e2ba733@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=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=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