From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93970 invoked by alias); 26 Sep 2019 04:22:22 -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 93959 invoked by uid 89); 26 Sep 2019 04:22:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Sep 2019 04:22:21 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5AE5307D91F; Thu, 26 Sep 2019 04:22:19 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id A46A2600C8; Thu, 26 Sep 2019 04:22:19 +0000 (UTC) From: Sergio Durigan Junior To: Tom Tromey Cc: GDB Patches , Pedro Alves , Eli Zaretskii , Ruslan Kabatsayev Subject: Re: [PATCH v4] Improve ptrace-error detection on Linux targets References: <20190819032918.3536-1-sergiodj@redhat.com> <20190911011103.12774-1-sergiodj@redhat.com> <87h851mnqt.fsf@tromey.com> <87mueszcnk.fsf@redhat.com> <87pnjof2x9.fsf@tromey.com> Date: Thu, 26 Sep 2019 04:22:00 -0000 In-Reply-To: <87pnjof2x9.fsf@tromey.com> (Tom Tromey's message of "Wed, 25 Sep 2019 16:04:34 -0600") Message-ID: <87o8z7y9dw.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00505.txt.bz2 On Wednesday, September 25 2019, Tom Tromey wrote: >>> Unrestricted sprintf gives me pause. Do we know own_buf is large >>> enough? Or can/should we truncate the text instead? > > Sergio> I was also worried about this. I found other cases using sprintf, but > Sergio> their strings are not as big. I know own_buf comes from struct > Sergio> client_state, and its size of PBUFSIZ + 1. One option would be to use > Sergio> snprintf with this value. WDYT? > > I think that would be fine. > >>> I was wondering if each case should just return, or if checking each one >>> is the correct thing to do here. > > Sergio> I don't have a strong opinion here, but I think it's more useful for the > Sergio> user if we print everything wrong in the first pass. I'm thinking of > Sergio> cases when starting GDB may take a while, for example: if we tell the > Sergio> user a list of problems that need to be solved, then she won't need to > Sergio> keep retrying. > > Makes sense to me, thanks. Thanks; I've just sent v5 now. Cheers, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/