[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Segfault after many stackframes
From: |
Ole Tange |
Subject: |
Segfault after many stackframes |
Date: |
Fri, 12 Apr 2019 19:08:40 +0200 |
This recursive function causes bash to segfault:
$ re() { t=$((t+1)); if [[ $t -gt 8000000 ]]; then echo foo; return;
fi; re; }; re
Segmentation fault (core dumped)
Ideally Bash ought to run out of memory before this fails. But an
acceptable solution could also be to say 'stack overflow'.
$ bash --version
GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
/Ole
- Segfault after many stackframes,
Ole Tange <=