On a RHEL 6.5 Desktop, if I use:
sudo grep -r foo /*
my desktop reboots.
Q: Why?? How to debug this? It's the third time my Desktop reboots because of this :D
There are things you're not supposed to blindly read from.
/dev/kmem come to mind, but
/dev/port sounds even more dangeous to read - it maps to I/O ports directly. Reading blindly from that sounds like a recipe for disaster (hard-locked my machine a few minutes ago... for science I guess). I don't think reading from that file will result in the same symptoms for all machines, but a reboot doesn't sound unreasonable.
At the very least, you should exclude
/dev entirely from that, and
/proc shouldn't be included either - it makes no sense to search those filesystems even if it was entirely safe.
Consider the performance as well. Do you really want to grep all of
/dev/sda, then all of
/dev/sda1, then whatever filesystem contents it has (assuming it's mounted)?
strace helped, the bad device was the /dev/cdrom