[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a recursion bug
From: |
Bob Proulx |
Subject: |
Re: a recursion bug |
Date: |
Wed, 3 Oct 2012 14:55:45 -0600 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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
- Re: a recursion bug, (continued)
- Re: a recursion bug, Linda Walsh, 2012/10/02
- Re: a recursion bug, Bob Proulx, 2012/10/02
- Re: a recursion bug, Steven W. Orr, 2012/10/02
- Re: a recursion bug, Linda A. Walsh, 2012/10/03
- Re: a recursion bug, Bob Proulx, 2012/10/03
- Re: a recursion bug, Greg Wooledge, 2012/10/03
- Re: a recursion bug, Chet Ramey, 2012/10/03
- Re: a recursion bug, Bob Proulx, 2012/10/03
- Re: a recursion bug, Chet Ramey, 2012/10/04
- Re: a recursion bug, Dan Douglas, 2012/10/04
- Re: a recursion bug,
Bob Proulx <=
- Re: a recursion bug, Eric Blake, 2012/10/03
RE: a recursion bug, Yuxiang Cao, 2012/10/03
Re: a recursion bug, Bob Proulx, 2012/10/02
Re: a recursion bug, Greg Wooledge, 2012/10/03