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>,
	"akamath996@gmail.com" <akamath996@gmail.com>,
	"tom@tromey.com" <tom@tromey.com>,
	"simon.marchi@polymtl.ca" <simon.marchi@polymtl.ca>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	SANGAMESH MALLAYYA <sangamesh.swamy@in.ibm.com>
Subject: Re: [PATCH 1/2] Fix asertion failure while analysing core files in AIX with terminated threads.
Date: Tue, 24 Mar 2026 12:43:20 +0000	[thread overview]
Message-ID: <LV8PR15MB6488F00E7AA08466C1802A1ED648A@LV8PR15MB6488.namprd15.prod.outlook.com> (raw)
In-Reply-To: <7591a18ffa2b5f73c75d6081fabe46776fcd9c64.camel@de.ibm.com>

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


Hi Ulrich and community members,

>I guess the more fundamental question would be, do we even need
>sync_threadlists() at all when debugging a core file?  Here,
>the list of threads can never change, so what is the point of
>attempting to sync it?  Does it work if you just never call
>sync_threadlists() for core files (or have it return early)?

Yes Ulrich, you are right.  We need not call sync_threadlists ().

# git diff
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index c2e6b6d2bd6..50065c0d8a7 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -884,7 +884,11 @@ pd_update (pid_t pid)
   if (status != PTHDB_SUCCESS)
     return ptid_t (pid);

-  sync_threadlists (pid);
+  /* Attempt to sync_threadlists () only when debugging process files,
+     not core files since list of threads never change for core files.
+  */
+  if (target_has_execution ())
+    sync_threadlists (pid);

   /* Define "current thread" as one that just received a trap signal.  */

With this patch right now,

I am able to see my core contents like below. That is the root cause of this issue. Let me know if you are okay and I will send a v2 of this patch.

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0900000000e2b25c in .PyThreadState_DeleteCurrent ()
   from /opt/freeware/lib/libpython3.9.a(libpython3.9.so)
(gdb) bt
#0  0x0900000000e2b25c in .PyThreadState_DeleteCurrent ()
   from /opt/freeware/lib/libpython3.9.a(libpython3.9.so)
#1  0x090000000de52dd0 in _Py_M__importlib_bootstrap ()
   from /opt/freeware/lib64/libpython3.9.a(libpython3.9.so)
#2  0x0900000000e2cb84 in ._PyObject_CheckCrossInterpreterData ()
   from /opt/freeware/lib/libpython3.9.a(libpython3.9.so)
#3  0x09001000a0b6d968 in ?? () from /opt/freeware/lib/libpython3.9.a(libpython3.9.so)
#4  0x09000000031dcc10 in ?? ()
#5  0x090000000dda8b50 in ._PyImport_LoadDynamicModuleWithSpec ()
   from /opt/freeware/lib64/libpython3.9.a(libpython3.9.so)
#6  0x090000000dbebf84 in ._PyImport_FindExtensionObject ()
   from /opt/freeware/lib64/libpython3.9.a(libpython3.9.so)

Thanks and regards,
Aditya.


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

  reply	other threads:[~2026-03-24 12:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  9:52 Aditya Vidyadhar Kamath
2026-03-24 12:00 ` Ulrich Weigand
2026-03-24 12:43   ` Aditya Kamath [this message]
2026-03-24 13:42     ` 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=LV8PR15MB6488F00E7AA08466C1802A1ED648A@LV8PR15MB6488.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