From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24769 invoked by alias); 5 Feb 2015 14:04:50 -0000 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 Received: (qmail 24753 invoked by uid 89); 5 Feb 2015 14:04:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Feb 2015 14:04:49 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1YJN30-0001UC-0F from Luis_Gustavo@mentor.com ; Thu, 05 Feb 2015 06:04:46 -0800 Received: from [172.30.10.12] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.224.2; Thu, 5 Feb 2015 06:04:45 -0800 Message-ID: <54D3787A.60605@codesourcery.com> Date: Thu, 05 Feb 2015 14:04:00 -0000 From: Luis Machado Reply-To: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Antoine Tremblay , Subject: Re: [PATCH] gdbserver: Fix crash when QTinit is handled with no inferior process attached References: <1422387337-32334-1-git-send-email-antoine.tremblay@ericsson.com> <54D37065.4020303@ericsson.com> <54D37228.2000309@codesourcery.com> <54D373C3.5040201@codesourcery.com> <54D375DD.5090704@ericsson.com> In-Reply-To: <54D375DD.5090704@ericsson.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00124.txt.bz2 On 02/05/2015 11:53 AM, Antoine Tremblay wrote: > Hi, > I'm quite new to gdb, but in general I would argue that it's better > to make a program resilient to wrong input then to sanitize the input, > let's say someday something else then gdb would use gdbserver....? It is certainly a valid concern. > > But I sure would like to take a look at your patch if you have it > handy ? I just need to extract it from the tree and do a bit of an update. We could probably merge both to robustify the tracepoint mechanism. > On 02/05/2015 08:44 AM, Luis Machado wrote: >> On 02/05/2015 11:37 AM, Luis Machado wrote: >>> On 02/05/2015 11:30 AM, Antoine Tremblay wrote: >>>> ping >>>> >>>> On 01/27/2015 02:35 PM, Antoine Tremblay wrote: >>>>> When gdbserver is called with --multi and attach has not been >>>>> called yet >>>>> and tstart is called on the gdb client, gdbserver would crash. >>>>> This patch fixes gdbserver so that it returns E01 to the gdb client. >>> >>> Wouldn't it make more sense to prevent GDB from sending any tracepoint >>> packets that require a running inferior if there is none? >>> >>> I remember fixing this in a local tree but on GDB's side. I think it is >>> remote.c:remote_trace_init and other related functions. >>> >>> What do you think? >> >> I've looked around and found the patch in a local tree of mine. It >> fixes more cases of tracepoint commands that require a running inferior. >> >> I could revive and submit it if it makes things easier. >> >