On 9/24/17 9:25 AM, Shlomi Fish wrote:
> Hi all,
>
> With bash git master on Mageia v7 x86-64, bash on Debian Stable and other
> reported sytems:
>
> shlomif@telaviv1:~$ /home/shlomif/apps/bash/bin/bash -c 'run() { run; } ; run'
> Segmentation fault (core dumped)
> shlomif@telaviv1:~$
>
> note that this is not a fork bomb as no processes are spawned, and it is also
> not an out-of-memory problem. I expect bash to fail on this, but it ought not
> to segfault.
This has come up many times in the past.
You wrote a recursive function that eventually exceeds your shell's
stack space allocation, and the kernel sends it a SIGSEGV.
If you want to constrain function recursion, look at the FUNCNEST
shell variable.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/