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

Re: /bin/ls is impure!



On Wed, Sep 19, 2001 at 11:53:10AM -0400, Chris Danis wrote:
> Did you check the COLUMNS environment variable?

Ahh, I missed that because its not displayed by /usr/bin/env.

> brooks% echo $COLUMNS
> 49151

Yep, I get the same value.  Whats interesting is that this environment
variable is (somehow) preserved on the console between logins.  

However, even after I set it back to 80, via export COLUMNS=80, ls still
fails, and it is set back to 49151 after I logout and log back in.

I guess this is not a conventional environment variable that can be changed
in this way.

> IIRC the memory use of the algorithm ls uses to sort its output into
> varying-length columns increases greatly with wider terminals. Something 
> this absurdly large will cause the algorithm to start eating RAM, just as 
> reported. However, *why* COLUMNS gets set so big is another matter...

Interesting, though this seems like a bug.  Why should it use 200MB of RAM
to sort/display a handful of files?

> purity seems to be causing this. No idea why or how, but it seems to be 
> the culprit.

I will file bugs on both packages then.

Thanks,

Norbert

Attachment: pgpRwLhGYIUV3.pgp
Description: PGP signature


Reply to: