General
cancel
Showing results for 
Search instead for 
Did you mean: 

find w/ grep in /proc crashes a linux filesystem?

SOLVED
Go to solution
Kelli Ward
Trusted Contributor

find w/ grep in /proc crashes a linux filesystem?

Hi all,
I'm not going to pretend to be a linux expert, but I know a teeny bit. I've come across something that doesn't make sense to me.

I executed find / -exec grep -l '' {} \; on a system running RedHat 9.
The system is a Proliant DL360 G3.

After a bit the Internal Health LED goes amber and when I crack the cover, both CPU LED's are amber, indicating both processors are failed. I can do this every time I run that find/grep combo, or a similar variation.

I won't bore anyone with the all the gorey details, but I was able to drill down a bit and the system fails like this consistently when it hits /proc/sys/net/core

If this is correct behavior, can someone explain it to me as I can't understand why this should take my entire system down.

If this isn't correct behavior, can anyone shed any light on what the problem might be so I can quit pulling my hair out!

In rummaging around the internet, I'm not finding anything that shows what I'm doing is a bad thing, so help? :)

Confused, but in the mood to give bunnies.

Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
5 REPLIES
Don_89
Trusted Contributor
Solution

Re: find w/ grep in /proc crashes a linux filesystem?

Interesting bug. I tried this on DL380 G3 with Red Hat Enterprise 2.1 and Fedora Core 2 with no crashes. Maybe it was reported in Bugzilla??


www.linuxtech.cc

Kelli Ward
Trusted Contributor

Re: find w/ grep in /proc crashes a linux filesystem?

Well,
One of my internet rummagings was to go to Bugzilla. If it is a known bug, I wasn't asking the search engine the right questions.
I have another DL360 G3 with a similar RH 9 load, but that system is now a file server and is too important to attempt to crash for sport.
Given your output, sounds like my system has some sort of issue.
I'm glad that wasn't an expected behavior, as it's a real head scratcher.
Thanks for your input Don.
I'll post your points after a few others have had a chance at their 2 cents or within a couple of days if no one wants to tackle.
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
Stuart Browne
Honored Contributor

Re: find w/ grep in /proc crashes a linux filesystem?

Funky. I'd expect it to hang, and be a little unreasonable, but not crash the system. But grep'n the contents of '/proc' has always been a bad idea (thus most people usually explicitly ignore it).

As the '/proc' filesystem is a fully dynamic virtual file system (it doesn't actually take any space on any disk), there's usually no need to search it for anything.

Make use of the '-mount' flag of 'find' or the "! -path './proc/*'" flags.
One long-haired git at your service...
Kelli Ward
Trusted Contributor

Re: find w/ grep in /proc crashes a linux filesystem?

Hi Stuart,
I wasn't specifically searching /proc for anything. (That is until my system started crashing and I was "root causing it".)
I was greping from / for a text string and didn't think twice that allowing it to go into the /proc would be a problem. Didn't think about it at all, truth be told.
Since it's a read-only virtual filesystem, I don't really see the problem.

Thanks for the input, I'll be sure and ignore the directory in my future searches.

Anyone feel free to chime in with their thoughts, I'll keep this open for another day or two.
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
Kelli Ward
Trusted Contributor

Re: find w/ grep in /proc crashes a linux filesystem?

No more submissions, closing.
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!