Re: grep and memory problems with kernel 2.4.1

2001-02-19 Thread David B . Harris
To quote Thomas Braun [EMAIL PROTECTED],
# i do  cd /
# 
# grep -r hallo * 
# 
# und then cames a memory enhausted and the network is down.

Well, since you're specifying -r, it's going recursively through
subdirectories ... I don't know for sure, but maybe it's running into
some problems with some of the devices in /dev? :) Remember, most of
them are just like files, you can 'grep' them all you want, even if it's
not always a good idea ;)

I doubt this would be specific to 2.4.1, though. Have you tried it in
2.2.x? Do you get the same errors(or similar ones) there?

David Barclay Harris, Clan Barclay
Aut agere, aut mori. (Either action, or death.)



RE: grep and memory problems with kernel 2.4.1

2001-02-19 Thread Joris Lambrecht
the /dev directory indeed just lists a list of names wich are linked to
device driver files through the inode table

so in fact you're grep-in the output of the /dev, if this contains some
control chars it might hang your grep command, you should* be able to kill
this from another console

greetings,

joris

-Original Message-
From: David B. Harris [mailto:[EMAIL PROTECTED]
Sent: Monday, February 19, 2001 2:01 PM
To: debian-user@lists.debian.org
Subject: Re: grep and memory problems with kernel 2.4.1


To quote Thomas Braun [EMAIL PROTECTED],
# i do  cd /
# 
# grep -r hallo * 
# 
# und then cames a memory enhausted and the network is down.

Well, since you're specifying -r, it's going recursively through
subdirectories ... I don't know for sure, but maybe it's running into
some problems with some of the devices in /dev? :) Remember, most of
them are just like files, you can 'grep' them all you want, even if it's
not always a good idea ;)

I doubt this would be specific to 2.4.1, though. Have you tried it in
2.2.x? Do you get the same errors(or similar ones) there?

David Barclay Harris, Clan Barclay
Aut agere, aut mori. (Either action, or death.)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact
[EMAIL PROTECTED]



Re: grep and memory problems with kernel 2.4.1

2001-02-19 Thread Moritz Schulte
David B. Harris [EMAIL PROTECTED] writes:

 # i do  cd /
 # 
 # grep -r hallo * 
 # 
 # und then cames a memory enhausted and the network is down.
 
 Well, since you're specifying -r, it's going recursively through
 subdirectories ... I don't know for sure, but maybe it's running into
 some problems with some of the devices in /dev? :)

Yes, /dev/zero for example.

I guess your system is running out of memory, because you don't have
set up user limits? By specyfing limits you can decide how much memory
(, processes, number of open files, cpu time, etc...) a user is
allowed to use. You can specify these limits in
/etc/security/limits.conf; don't forget to active this feature in
/etc/pam.d/login (and /etc/pam.d/su?).
Btw: you can get information about your current limits via 'ulimit -a'.

hth,
moritz
-- 
Moritz Schulte [EMAIL PROTECTED] http://www.chaosdorf.de/moritz/
Debian/GNU supporter - http://www.debian.org/ http://www.gnu.org/
GPG fingerprint = 3A14 3923 15BE FD57 FC06  B501 0841 2D7B 6F98 4199



Re: grep and memory problems with kernel 2.4.1

2001-02-19 Thread David B . Harris
To quote Joris Lambrecht [EMAIL PROTECTED],
# the /dev directory indeed just lists a list of names wich are linked
to
# device driver files through the inode table
# 
# so in fact you're grep-in the output of the /dev, if this contains
some
# control chars it might hang your grep command, you should* be able to
kill
# this from another console
# 

Umm... More than that; since -r is passed to grey, and those devices
are, for the most part, regular files, they themseves are grepped.

For instance, 'grep -r hello /*', will eventually lead to grepping
/dev/hda. You'll be grepping your entire bloody harddrive. :)

David Barclay Harris, Clan Barclay
Aut agere, aut mori. (Either action, or death.)