]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix AIX thr!= NULL assertion failure during fork.
authorAditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com>
Wed, 22 Nov 2023 16:13:35 +0000 (10:13 -0600)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 22 Nov 2023 18:29:21 +0000 (19:29 +0100)
commit10a0a5e239634fdabff35623efe2ca632047755e
tree986a67e0a1972ca1d1503409af86f146886ee498
parent03893ce67b5d1af649d59f7e63b3959ce0ac0709
Fix AIX thr!= NULL assertion failure during fork.

In AIX, while we followed the child process and detach on fork was on we hit thr!= NULL assertion failure.

The reason for the same was GDB core trying to switch to a child thread with tid not set that does not
exist, since child's ptid was changed to ptid_t (pid, 0, tid) in sync_threadlists() as it was threaded.

The way this happened was when a new child process is born, its object file will be loaded, calling the new_objfile ()
in aix-thread.c file from clone_program_space, which is
called from within follow_fork_inferior. Therefore it end ups syncing threadlists via pd_update ().

This patch is a fix for the same where pd_update () is called in the wait () or in update_thread_list() hook only.
gdb/aix-thread.c