From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31331 invoked by alias); 3 Jan 2007 15:02:30 -0000 Received: (qmail 31322 invoked by uid 22791); 3 Jan 2007 15:02:29 -0000 X-Spam-Check-By: sourceware.org Received: from vir-del-01.spheriq.net (HELO vir-del-01.spheriq.net) (194.50.41.40) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 03 Jan 2007 15:02:15 +0000 Received: from vir-out-02.spheriq.net ([194.50.41.31]) by vir-del-01.spheriq.net with ESMTP id l03F2Dah027976 for ; Wed, 3 Jan 2007 15:02:13 GMT Received: from vir-cus-01.spheriq.net (vir-cus-01.spheriq.net [194.50.41.85]) by vir-out-02.spheriq.net with ESMTP id l03F2BVH017744 for ; Wed, 3 Jan 2007 15:02:12 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by vir-cus-01.spheriq.net with ESMTP id l03F28LH027531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Jan 2007 15:02:10 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DE19CDA48; Wed, 3 Jan 2007 15:02:07 +0000 (GMT) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 885C7475FE; Wed, 3 Jan 2007 15:02:07 +0000 (GMT) Received: from [164.129.44.95] (crx595.cro.st.com [164.129.44.95]) by mail1.cro.st.com (MOS 3.5.8-GR) with ESMTP id CJI34428 (AUTH "denis pilat"); Wed, 3 Jan 2007 16:02:06 +0100 (CET) Message-ID: <459BC56E.6010506@st.com> Date: Wed, 03 Jan 2007 15:02:00 -0000 From: Denis PILAT User-Agent: Thunderbird 1.5.0.9 (X11/20061206) MIME-Version: 1.0 To: gdb-patches , drow@false.org Cc: Denis PILAT Subject: Re: [RFA] gdbserver with reversed arguments seg. fault References: <459B778D.4000500@st.com> <20070103144423.GB12452@nevyn.them.org> In-Reply-To: <20070103144423.GB12452@nevyn.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2007-01/txt/msg00064.txt.bz2 Daniel Jacobowitz wrote: > On Wed, Jan 03, 2007 at 10:29:49AM +0100, Denis PILAT wrote: > >> Hi, >> >> Following our discussion in the thread >> http://sources.redhat.com/ml/gdb-patches/2007-01/msg00059.html >> I'm proposing the attached patch to fix a segmentation fault that occurs >> into gdbserver when you revert the binary filename with the "host:port" >> argument. >> In inferiors.c the inferior_target_data() function is called with a NULL >> pointer argument. At the beginning I though of testing arguments but >> none of them are tested in this whole file so I concluded it's up to the >> caller to do so. >> > > What exactly did you do to get this crash? What's the backtrace look > like? It didn't happen for me. > > Here is the output : > ./gdbserver ~/tmp/hello/hello.out :2222 Cannot exec :2222: No such file or directory. Process :2222 created; pid = 25945 Child exited with retcode = 7f Could not open remote device: Invalid argument. Killing inferior Segmentation fault (core dumped) Here is the backtrace: Program received signal SIGSEGV, Segmentation fault. inferior_target_data (inferior=0x0) at /project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/gdb/gdb/gdbserver/inferiors.c:227 227 { (gdb) bt #0 inferior_target_data (inferior=0x0) at /project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/gdb/gdb/gdbserver/inferiors.c:227 #1 0x0804e2a9 in main (argc=3, argv=0xbfff9414) at /project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/gdb/gdb/gdbserver/server.c:620