On 2/1/14, 11:36 AM, Mathieu Malaterre wrote: > As reported at: > > http://stackoverflow.com/questions/21500367/bash-for-loop-with-unsigned-integer > > I am getting a weird behavior in bash. Would it be possible for the > next release of bash to not get a SIGSEV ?
Well, you're attempting to use a ridiculous amount of memory, so no solution is really going to be perfect. Bash-4.3 has a couple of things to avoid calling abort(3) when allocation fails in this situation, but what happens after that depends on your malloc implementation. Even when bash calls free() on all the memory it allocates attempting the expansion, that memory will only go back to the kernel under a small set of circumstances, and some malloc implementations are much better at that than others. You might find that there is not enough memory left to do anything but exit. 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/