bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Seq Segment Fault.


From: Philip Rowlands
Subject: Re: Seq Segment Fault.
Date: Fri, 18 Sep 2009 14:26:01 +0100 (BST)
User-agent: Alpine 1.10 (DEB 962 2008-03-14)

On Fri, 18 Sep 2009, Eric Blake wrote:

However, it seems to me that your problem is that bash tries to slurp all
of $() into memory, and seq generated so much data that bash ran out of
memory (or overflowed its stack).

It's certainly possible for bash to run out of stack and crash with SIGSEGV.

$ bash -c 'recurse() { recurse; }; recurse'
Segmentation fault

for i in $(seq -w $NUM1 $NUM2); do wget "$URL${i}$EXT"; done

This could be rewritten as

seq -w $NUM1 $NUM2 | while read i ; do wget "$URL${i}$EXT"; done

to prevent all of seq's output having to be buffered at once.


Cheers,
Phil






reply via email to

[Prev in Thread] Current Thread [Next in Thread]