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.