Morning Simon. The reason we were adding one more inferior_ptid!= 0 , condition is the previous condition in the and logic i.e. pid != inferior_ptd.pid() will satisfy as -1 is not equal to 0. [inferior_ptid is set to null before coming into wait]. So, in the next iteration since the process has exited waitpid (), will lead to ERRCHILD error though the current iteration fetched the right pid using waitpid (). However, we get your point that inferior_ptid should not be used initially [for any condition check till we fetch the pid using waitpid ()] as it is being reset. Please find attached our modified patch where we do a check of the inferior being in the list. I hope this solution matches to what you suggested. [See 0001-Fix-gdb_assert-pid-0-assertion-failure-in-AIX.patch file attached to this email] Have a great day. Thanks and regards, Aditya.