public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
* [python] python-inferior add_inferior_object tries to access thread info before it exists with remote target (VMware remote stub)
@ 2009-09-09  3:35 Andrew Sutherland
  2009-09-09  8:27 ` Jan Kratochvil
  2009-09-17 20:10 ` [python] [patch] Fix crash on remote targets [Re: [python] python-inferior add_inferior_object tries to access thread info before it exists with remote target (VMware remote stub)] Jan Kratochvil
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Sutherland @ 2009-09-09  3:35 UTC (permalink / raw)
  To: archer

Using the python branch tip, attempting to connect to a VMware 
(Workstation 6.5.x) replay remote stub, I get a "thread.c:581: 
internal-error: is_thread_state: Assertion `tp' failed." assertion.

I presume this is a unique problem because the stub refuses the "Hc-1" 
command with "E00" which means there are no magic_null_ptid protections 
in place.  So gdb asks what the current thread is, and gets an answer. 
In the process of creating the inferior via remote_add_inferior (and 
before it gets to call add_thread_silent), things go off the rails when 
the python add_inferior_object notification calls get_current_arch in:
   cleanup = ensure_python_env (get_current_arch (), current_language);

The communication leading up to this is:
+$qC#b4
+$QC1#c5
+$qAttached#8f
+$#00
+

The death stack trace is:
#5  0x080991d6 in internal_error (file=0x830c8a8 "thread.c", line=581, 
string=0x82cfcd2 "%s: Assertion `%s' failed.") at utils.c:1003
#6  0x08171f75 in is_thread_state (ptid=..., state=THREAD_EXITED) at 
thread.c:581
#7  0x08171fbb in is_exited (ptid=...) at thread.c:594
#8  0x0809f12f in has_stack_frames () at frame.c:1113
#9  0x0818758b in get_current_arch () at arch-utils.c:748
#10 0x08107c9b in add_inferior_object (pid=42000) at 
.././gdb/python/python-inferior.c:107
#11 0x080931af in generic_observer_notify (subject=<value optimized 
out>, args=0xbfeff6d4) at observer.c:166
#12 0x080935a8 in observer_notify_new_inferior (pid=42000) at 
observer.inc:833
#13 0x080a4f1d in add_inferior_silent (pid=42000) at inferior.c:88
#14 0x080a4f47 in add_inferior (pid=42000) at inferior.c:96
#15 0x080d33bd in remote_add_inferior (pid=42000, attached=0) at 
remote.c:1181
#16 0x080db0c0 in remote_start_remote (uiout=0x84a4470, 
opaque=0xbfeff874) at remote.c:2707
#17 0x08174b4a in catch_exception (uiout=0x84a4470, func=0x80dad00 
<remote_start_remote>, func_args=0xbfeff874, mask=6) at exceptions.c:462
#18 0x080d6574 in remote_open_1 (name=<value optimized out>, from_tty=1, 
target=0x83b2a40, extended_p=0) at remote.c:3333


My local fix is to cause has_stack_frames to treat a null thread_info 
the same as not having an inferior:

index 67e0607..8698563 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1106,7 +1106,8 @@ has_stack_frames (void)
      return 0;

    /* No current inferior, no frame.  */
-  if (ptid_equal (inferior_ptid, null_ptid))
+  if (ptid_equal (inferior_ptid, null_ptid) ||
+      !find_thread_ptid(inferior_ptid))
      return 0;

    /* Don't try to read from a dead thread.  */


Please let me know what the next step, if any, I should perform in order 
to get some form of fix in the tree.

Thanks,
Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-13 20:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-09  3:35 [python] python-inferior add_inferior_object tries to access thread info before it exists with remote target (VMware remote stub) Andrew Sutherland
2009-09-09  8:27 ` Jan Kratochvil
2009-09-17 20:10 ` [python] [patch] Fix crash on remote targets [Re: [python] python-inferior add_inferior_object tries to access thread info before it exists with remote target (VMware remote stub)] Jan Kratochvil
2009-10-13 18:07   ` ping: " Jan Kratochvil
2009-10-13 20:40     ` Tom Tromey
2009-10-13 20:58       ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).