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


Groups > gnu.bash.bug > #14383 > unrolled thread

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

Started byChet Ramey <chet.ramey@case.edu>
First post2018-07-21 19:57 -0400
Last post2018-07-21 19:57 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: v4.4 segfault in 'decode_prompt_string' when processing special parameter Chet Ramey <chet.ramey@case.edu> - 2018-07-21 19:57 -0400

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

FromChet Ramey <chet.ramey@case.edu>
Date2018-07-21 19:57 -0400
SubjectRe: v4.4 segfault in 'decode_prompt_string' when processing special parameter
Message-ID<mailman.4000.1532217489.1292.bug-bash@gnu.org>
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/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web