On 6/7/10 1:19 AM, Jan Schampera wrote: > Chet Ramey wrote: > >> How about a stack traceback? > > I'm so sorry, I thought this was clear and easy to reproduce/verify. > > I'm using this to generate the script. The number of commands varies > between shell versions (and likely other platform stuff), so you might > need to play around with the values a bit: > > { > printf "#!/bin/bash\n" > for ((x=0; x<50000; x++)); do printf ":;"; done > echo > } > length.sh > chmod +x length.sh > > Attached [bash41_hugeinput.bt.txt] is an excerpt of the backtrace from a > Bash 4.1. The missing middle is always > execute_command_internal()/execute_command(). > > The original finding was with a Bash 3.2, where the BT looks accordingly.
I bet this is the kernel killing bash when the stack size resource limit is exceeded, not anything bash is doing or can catch. As evidence I offer the fact that it aborts with a SEGV with my default stack size limit, but runs to completion when I increase the stack limit to unlimited (without changing any others, so the malloc arena size doesn't increase, for instance). Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/