From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11577 invoked by alias); 13 Oct 2009 18:07:21 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 11557 invoked by uid 22791); 13 Oct 2009 18:07:19 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Date: Tue, 13 Oct 2009 18:07:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: Andrew Sutherland , archer@sourceware.org Subject: ping: Re: [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)] Message-ID: <20091013180706.GA14075@host0.dyn.jankratochvil.net> References: <20090917201005.GA18401@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090917201005.GA18401@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-08-17) X-SW-Source: 2009-q4/txt/msg00007.txt.bz2 Hi Tom, ping, this bug costs daily many watthours of testbox. :-) Thanks, Jan ------------------------------------------------------------------------------ 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 * 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)