Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Chris Schoenberg Newsgroups: gnu.bash.bug Subject: Re: v4.4 segfault in 'decode_prompt_string' when processing special parameter Date: Sat, 21 Jul 2018 20:16:12 -0500 Lines: 28 Sender: chris@cr0ssbyte.com Approved: bug-bash@gnu.org Message-ID: References: <9b18593f-2068-a781-d869-23c725d1880a@case.edu> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: usenet.stanford.edu 1532222194 20527 208.118.235.17 (22 Jul 2018 01:16:34 GMT) X-Complaints-To: action@cs.stanford.edu Cc: Chris Schoenberg , bug-bash@gnu.org To: chet.ramey@case.edu Envelope-to: bug-bash@gnu.org DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=cr0ssbyte.com; q=dns/txt; s=smtp; t=1532222185; h=Content-Type: Cc: To: Subject: Message-ID: Date: From: In-Reply-To: References: MIME-Version: Sender; bh=RtE0m0ShmmdrRi6IpkS34YU3fIsPuCtXxsDMYRq60vw=; b=hqcrR0io1FxZ4TKNiwUlgwtnHjqRe0t8YKEqRhJqlSGfN4vO976hg6oUNnEQQcMZj0F82mN2 DgOSfu6AT9a1s5aozyoirusS5kvANhR7XmtM3eemZXbKNymVAGd52VPI/Fbgv/0z1FGR1INY dSqyViOvvVafh0Ibw4mDa9JnyHw= X-Mailgun-Sending-Ip: 184.173.153.201 X-Mailgun-Sid: WyI0MmQ4OCIsICJidWctYmFzaEBnbnUub3JnIiwgIjVjMzYyNSJd X-Gm-Message-State: AOUpUlH2cld1SDUKV/sujwWuwf8w+VO/x2948V86OapzFcN3o3p9RAhP VHjiOd4+qlvFe2LIOba02xNBT3VT4TvRT7m69bI= X-Google-Smtp-Source: AAOMgpfBLJuwMasbGlSNF71WsABWQ+nf+CNmDJJE5Ev8enIcUoUiwtEMLLRFZLU2DoRts7nfbMBaD+zUx7/yvfau3tE= X-Received: by 2002:a2e:83cf:: with SMTP id s15-v6mr5543384ljh.101.1532222183171; Sat, 21 Jul 2018 18:16:23 -0700 (PDT) In-Reply-To: <9b18593f-2068-a781-d869-23c725d1880a@case.edu> X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 184.173.153.201 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14384 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 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/ >