This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[python] [patch] Fix crash on remote targets [Re: [python]python-inferior add_inferior_object tries to access thread infobefore it exists with remote target (VMware remote stub)]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: archer at sourceware dot org
- Cc: Andrew Sutherland <sombrero at alum dot mit dot edu>
- Date: Thu, 17 Sep 2009 22:10:05 +0200
- Subject: [python] [patch] Fix crash on remote targets [Re: [python]python-inferior add_inferior_object tries to access thread infobefore it exists with remote target (VMware remote stub)]
- References: <h877o1$56n$1@ger.gmane.org>
Hi,
tried first to get working get_current_arch at the add_inferior_object time
but found it is probably right it does not work at that time.
gdb.server/server-run.exp currently crashes with:
thread.c:581: internal-error: is_thread_state: Assertion `tp' failed.
No regressions on {x86_64,x86_64-m32,i686}-fedora11-linux-gnu.
Thanks,
Jan
2009-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* python/py-inferior.c (add_inferior_object): Call ensure_python_env
just with target_gdbarch, new comment.
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -104,7 +104,10 @@ add_inferior_object (int pid)
return;
}
- cleanup = ensure_python_env (get_current_arch (), current_language);
+ /* While creating new inferior no inferior thread is available. Therefore
+ get_current_arch has no valid current frame (and it would crash). */
+
+ cleanup = ensure_python_env (target_gdbarch, current_language);
inf_obj = PyObject_New (inferior_object, &inferior_object_type);
if (!inf_obj)