bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sequence Brace Expansion Crash


From: Thomas Fischer
Subject: Sequence Brace Expansion Crash
Date: Sat, 2 Jun 2018 21:18:14 -0700

From: thomas
To: address@hidden
Subject: Sequence Brace Expansion Crash

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu'
-DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -D_FORTIFY_SOURCE=2
-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin'
-DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc'
-DSYS_BASH_LOGOUT='/etc/bash.bash_logout' -DNON_INTERACTIVE_LOGIN_SHELLS
-Wno-parentheses -Wno-format-security
uname output: Linux archlinux 4.16.13-1-ARCH #1 SMP PREEMPT Thu May 31
23:29:29 UTC 2018 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

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. Or computing the
permutations of the expansion and exiting before the calculation might work.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]