This is the mail archive of the
mailing list for the binutils project.
Re: RFA/RFC: Add stack recursion limit to libiberty's demangler [v3]
- From: "Ian Lance Taylor via binutils" <binutils at sourceware 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: <email@example.com> <20181130084211.GX12380@tucnak> <firstname.lastname@example.org> <email@example.com> <20181130140330.GA12380@tucnak> <firstname.lastname@example.org> <CAFiYyc1gTSXgSiJSFKEWaE0UTGbi45-mWHKJnUb4Wvjp86bbFQ@mail.gmail.com> <email@example.com>
- Reply-to: Ian Lance Taylor <iant at google dot com>
On Mon, Dec 3, 2018 at 6:45 AM, Nick Clifton <firstname.lastname@example.org> 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
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.