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


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

Re: Sequence Brace Expansion Crash

Started byChet Ramey <chet.ramey@case.edu>
First post2018-06-03 14:48 -0400
Last post2018-06-03 14:48 -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: Sequence Brace Expansion Crash Chet Ramey <chet.ramey@case.edu> - 2018-06-03 14:48 -0400

#14213 — Re: Sequence Brace Expansion Crash

FromChet Ramey <chet.ramey@case.edu>
Date2018-06-03 14:48 -0400
SubjectRe: Sequence Brace Expansion Crash
Message-ID<mailman.1072.1528051706.1292.bug-bash@gnu.org>
On 6/3/18 12:18 AM, Thomas Fischer wrote:

> Bash Version: 4.4
> Patch Level: 19
> Release Status: release
> 
> Description:
> I was testing brace expansion, and found that if bash uses too much memory
> during the expansion, it will simply be killed.
> 
> Repeat-By:
> echo {a..z}{a..z}{a..z}{a..z}{a..z}{a..z}
> 
> Amusingly, this is the only command I've used that has actually caused a
> swap.
> 
> 
> Fix:
> There should probably be a check somewhere, so that when too much memory is
> used, an error is thrown rather than crashing. 

Once you've allocated as much memory as your data size resource limit says
you can, there's not much use in continuing.


> Or computing the
> permutations of the expansion and exiting before the calculation might work.

It's not very useful or efficient to do this for every brace expansion
because someone might run one that's nonsensical.

-- 
``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