From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22389 invoked by alias); 25 Sep 2019 22:04:39 -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 22381 invoked by uid 89); 25 Sep 2019 22:04:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway30.websitewelcome.com Received: from gateway30.websitewelcome.com (HELO gateway30.websitewelcome.com) (192.185.160.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Sep 2019 22:04:37 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 3C460D8A9 for ; Wed, 25 Sep 2019 17:04:36 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id DFOmiY8hvW4frDFOmiFooj; Wed, 25 Sep 2019 17:04:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xt43Z5UDAbv3TSytDaRXMpUroq8d8zcIrPYMczy0u7E=; b=E5bMB9qntoyplK7tHa6GtN3WOt S+2Y+9cL/gC9G3g7cXhOVo3x7CB2EI10AJ7gUY2BoiZK5vkq0S/5a3iYR54YCdQSG+hQFLo981UqE 5Sg7s83Nx1UvAy1h2op03z4ae; Received: from 71-218-73-27.hlrn.qwest.net ([71.218.73.27]:40944 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iDFOl-000a6G-Tp; Wed, 25 Sep 2019 17:04:36 -0500 From: Tom Tromey To: Sergio Durigan Junior Cc: Tom Tromey , 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> Date: Wed, 25 Sep 2019 22:04:00 -0000 In-Reply-To: <87mueszcnk.fsf@redhat.com> (Sergio Durigan Junior's message of "Wed, 25 Sep 2019 10:14:07 -0400") Message-ID: <87pnjof2x9.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-09/txt/msg00491.txt.bz2 >> 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. Tom