[Bug remote/12228] New: thread.c:598: internal-error: is_thread_state: Assertion `tp' failed.

jon at beniston dot com sourceware-bugzilla@sourceware.org
Thu Nov 18 15:40:00 GMT 2010


           Summary: thread.c:598: internal-error: is_thread_state:
                    Assertion `tp' failed.
           Product: gdb
           Version: 7.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: remote
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jon@beniston.com

When debugging an extended-remote target that automatically restarts after
exiting, GDB will abort with:

thread.c:598: internal-error: is_thread_state: Assertion `tp' failed. 

when the thread exits. This appears to be due to the code in

The code is:

          /* Assume that the target has been restarted.  Set inferior_ptid
         so that bits of core GDB realizes there's something here, e.g.,
         so that the user can say "kill" again.     */
          inferior_ptid = magic_null_ptid;  

The problem is that this code sets a ptid, but thread_list is null (presumably
because the thread has been removed due to it exiting), so when
is_thread_state() is called at some later time, it looks for the
magic_null_ptid thread in thread_list, but it can't find it, which results in
the assertion failure.

One possiblity to fix this would be to create a thread, by adding the following
after the code above:

              inferior_ptid = remote_current_thread (inferior_ptid);            
              remote_add_inferior (ptid_get_pid (inferior_ptid), -1);
              add_thread_silent (inferior_ptid);

Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the Gdb-prs mailing list