Greg Wooledge wrote:
> imadev:~$ bash-4.2.28 -c 'a() { echo "$1"; a $(($1+1)); }; a 1' 2>&1 | tail
> Pid 4466 received a SIGSEGV for stack growth failure.
> Possible causes: insufficient memory or swap space,
> or stack size exceeded maxssiz.
> 6534
> 6535
> 6536
> 6537
> 6538
> 6539
> 6540
> 6541
> 6542
> 6543
> imadev:~$ ls -l core
> -rw-------   1 wooledg    pgmr       19908052 Oct  3 08:38 core
> imadev:~$ file core
> core:           core file from 'bash-4.2.28' - received SIGSEGV
>
> That was executed on HP-UX 10.20.  I agree that bash should try not
> to dump core in this case, if it's reasonable to prevent it.

HP-UX is a traditional Unix system and traditionally the system always
enabled core dumps.  How useful those were to people is another
question.

So by the above you are suggesting that bash should be re-written to
use and maintain a userspace stack?  That would convert stack memory
use into heap memory use.

Or are you suggesting that bash should add code to trap SIGSEGV,
determine if it was due to insufficient stack memory and if so then
exit with a nicer message?

Or are you suggesting that bash should specify its own stack area so
as to avoid the system stack size limitation?

I could see either of those first two solutions being reasonable.

Bob

Reply via email to