This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


http://sourceware.org/bugzilla/show_bug.cgi?id=12228

           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
remote.c:extended_remote_mourn_1()

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]