From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106869 invoked by alias); 3 Dec 2018 18:49:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 106728 invoked by uid 89); 3 Dec 2018 18:49:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.9 required=5.0 tests=BAYES_00,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.2 spammy=ages, HX-HELO:sk:mail-yb, H*i:sk:460cb97, H*f:sk:460cb97 X-HELO: mail-yb1-f181.google.com Received: from mail-yb1-f181.google.com (HELO mail-yb1-f181.google.com) (209.85.219.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Dec 2018 18:49:39 +0000 Received: by mail-yb1-f181.google.com with SMTP id w17-v6so5730423ybl.6 for ; Mon, 03 Dec 2018 10:49:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rjjQfPw28jkmPJ0faDm4tGCoUwF8es3b039BPaXk/RY=; b=fWVIv8QkTFZMoo9nyCIIQWvGpSE10wiQAmeNw+SxCPfV+npdVBDHwn0ngTjGi3WEe9 gMF95TlpEVk10A5ilMyTfh0g11jjbM5W1tV4maJOXnkpjXWuAU0JuAlfPnDhzaJzsZCs WdEH95aQLXiIK+4s93aqYqZsx9/xYV0yn4pGqjLtGf7vBU7bMqfFihTFhGY3DMvyuNfO N8BtFef5ycbqo8ES5p0PAeI9hK7lmYg02RNdvgPTBMULd9IAmsdgKlYlAf8f4Io0gd00 /t0U2q7w4loFWYjY0wQrcsc1ipIjRQeKmOQOsg5VSM/9rcbAXmBA/u7sJT+hJJv1nLVy tbng== MIME-Version: 1.0 Received: by 2002:a0d:eb4e:0:0:0:0:0 with HTTP; Mon, 3 Dec 2018 10:49:36 -0800 (PST) In-Reply-To: <460cb971-0e21-1e3e-4920-8b3ee7290cf7@redhat.com> References: <87muprdko7.fsf@redhat.com> <20181130084211.GX12380@tucnak> <173817ca-0aa0-e1a2-6725-37e079ead545@redhat.com> <20181130140330.GA12380@tucnak> <460cb971-0e21-1e3e-4920-8b3ee7290cf7@redhat.com> From: "Ian Lance Taylor via gcc-patches" Reply-To: Ian Lance Taylor Date: Mon, 03 Dec 2018 18:49:00 -0000 Message-ID: Subject: Re: RFA/RFC: Add stack recursion limit to libiberty's demangler [v3] To: Nick Clifton Cc: Richard Biener , Jakub Jelinek , matz@gcc.gnu.org, sgayou@redhat.com, Pedro Alves , Tom Tromey , GCC Patches , Binutils , Jason Merrill Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00112.txt.bz2 On Mon, Dec 3, 2018 at 6:45 AM, Nick Clifton wrote: > Hi Richard, > >>> * The description of the DMGL_RECURSE_LIMIT option in demangle.h has >>> been enhanced to add a note that if the option is not used, then >>> bug reports about stack overflows in the demangler will be rejected. >> >> Shouldn't we make it fool-proof by instead introducing a DMGL_NO_RECURSION_LIMIT >> flag and when not set default to limiting recursion? > > Well I wanted the patch to be backwards compatible. Just on the > general principle of not surprising users/programmers by changing > things without telling them first. > > I could change this of course, but I would rather have Ian's blessing > first. You don't need my blessing--I wrote that code ages ago--but I agree with Richard that in practice it's OK to limit recursion depth by default. Real symbols have very limited recursion requirements. Ian