Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14384

Re: v4.4 segfault in 'decode_prompt_string' when processing special parameter

From Chris Schoenberg <chris@cr0ssbyte.com>
Newsgroups gnu.bash.bug
Subject Re: v4.4 segfault in 'decode_prompt_string' when processing special parameter
Date 2018-07-21 20:16 -0500
Message-ID <mailman.4001.1532222193.1292.bug-bash@gnu.org> (permalink)
References <CAAnqJ08xXw8Ezq4mn_FGojcx6vi26d001foWFncUJt809XiS_w@mail.gmail.com> <9b18593f-2068-a781-d869-23c725d1880a@case.edu>

Show all headers | View raw


Fair enough. Even though the behavior is different, the end is the same as
udf so makes sense of you want to leave it. Weird how it popped up in 4.4
though.

On Sat, Jul 21, 2018, 6:58 PM Chet Ramey <chet.ramey@case.edu> wrote:

> On 7/21/18 2:47 PM, Chris Schoenberg wrote:
> > This only works in 4.4; earlier versions throw a 'bad substitution'
> error. It
> > causes an infinite loop of calls between 'expand_prompt_string' and
> > 'decode_prompt_string',
> > where calls to 'xmalloc' exhaust the heap:
> >
> > $\{_@P};${_@P}
> >
> > I decided to report this because it is not a user-defined recursive
> > function and it exhausts the heap rather than the stack.
>
> It's user-defined recursive parameter expansion. A string that undergoes
> prompt expansion performs parameter expansion, as documented. If that
> parameter expansion passes the same string to prompt expansion, which
> performs parameter expansion, you've got user-defined recursion.
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
>

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: v4.4 segfault in 'decode_prompt_string' when processing special parameter Chris Schoenberg <chris@cr0ssbyte.com> - 2018-07-21 20:16 -0500

csiph-web