From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3208 invoked by alias); 23 Jun 2009 17:22:59 -0000 Received: (qmail 3199 invoked by uid 22791); 23 Jun 2009 17:22:58 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 23 Jun 2009 17:22:52 +0000 Received: (qmail 927 invoked from network); 23 Jun 2009 17:22:50 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Jun 2009 17:22:50 -0000 From: Pedro Alves To: Doug Evans Subject: Re: [RFA] Fix gdbserver crash if using kill in remote connection to windows gdbserver Date: Tue, 23 Jun 2009 17:22:00 -0000 User-Agent: KMail/1.9.10 Cc: Pierre Muller , gdb-patches@sourceware.org References: <003001c9f41e$3a294830$ae7bd890$@u-strasbg.fr> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200906231823.43982.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00620.txt.bz2 On Tuesday 23 June 2009 18:11:21, Doug Evans wrote: > On Tue, Jun 23, 2009 at 9:18 AM, Pierre Muller w= rote: > > =A0GDB uses an internal fake pid (42000) for > > remote targets not supporting multi-processes, > > but send this fake pid to gdbserver when > > kill command is used with remote target. > > > > =A0This made win32-low look for a inferior of > > pid 42000, which does not exist and created a crash > > in remove_process that was called with a NULL argument. >=20 > I thought gdb used 42000 for targets that don't have pids (e.g. > embedded targets). > It's kinda odd that gdb is using the magic 42000 on a target with pids. > Is that, perchance, the bug that needs fixing here? If the target doesn't support multi-process extensions, then there's no way for GDB to know the remote PID. I haven't looked at the patch yet, but, if the target isn't reporting multi-process support (win32 gdbserver isn't now), then GDB should be using the 'k' packet, and that doesn't carry the fake 42000. In fact, the magic 42000 should not appear in *any* packet, IIRC. If GDB is sending the vKill packet when multi-process is off, that is the bug. --=20 Pedro Alves