This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA/RFC: Add stack recursion limit to libiberty's demangler [v3]
- From: "Ian Lance Taylor via gcc-patches" <gcc-patches at gcc dot gnu dot org>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>, matz at gcc dot gnu dot org, sgayou at redhat dot com, Pedro Alves <palves at redhat dot com>, Tom Tromey <tom at tromey dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Binutils <binutils at sourceware dot org>, Jason Merrill <jason at redhat dot com>
- Date: Mon, 3 Dec 2018 10:49:36 -0800
- Subject: Re: RFA/RFC: Add stack recursion limit to libiberty's demangler [v3]
- References: <87muprdko7.fsf@redhat.com> <20181130084211.GX12380@tucnak> <173817ca-0aa0-e1a2-6725-37e079ead545@redhat.com> <m3woousm8n.fsf@pepe.airs.com> <20181130140330.GA12380@tucnak> <fa1abe9c-7545-6a48-cbf0-97b993345523@redhat.com> <CAFiYyc1gTSXgSiJSFKEWaE0UTGbi45-mWHKJnUb4Wvjp86bbFQ@mail.gmail.com> <460cb971-0e21-1e3e-4920-8b3ee7290cf7@redhat.com>
- Reply-to: Ian Lance Taylor <iant at google dot com>
On Mon, Dec 3, 2018 at 6:45 AM, Nick Clifton <nickc@redhat.com> 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