why does running rg
with sudo
on /
cause my Linux system to hang?
#2897
-
Please tick this box to confirm you have reviewed the above.
What version of ripgrep are you using?ripgrep 14.1.1 How did you install ripgrep?pacman What operating system are you using ripgrep on?Arch Linux Describe your bug.Without using sudo, searching in / will come up with errors such as:
However, there seems to be others, such as Input/output error, Invalid argument, etc. To avoid this I added sudo, which works on things like find. However with rg it completely hangs the system and gets stuck on something in /proc This is only recoverable by force restarting the computer What are the steps to reproduce the behavior?
What is the actual behavior?Note: the actual output is longer, the terminal only showed a certain amount of it. Also I killed rg after a few seconds, in case it crashed the system again What is the expected behavior?Either not shown the errors, or at least not crash the entire system I think rg should entirely ignore /proc unless an option is specified |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Error logs from journalctl
|
Beta Was this translation helpful? Give feedback.
-
This is generally expected behavior. Linux exposes special files in The suggestion to ignore |
Beta Was this translation helpful? Give feedback.
This is generally expected behavior. Linux exposes special files in
/proc
where even the mere act of reading them can cause side effects, including system hangs or reboots.The suggestion to ignore
/proc
by default is interesting, but I don't think it's viable to do that at this stage in ripgrep's life. ripgrep's smart filtering by default is already surprising in some respects, and adding more special cases isn't really something I'm willing to do. You can work around this by adding a/.rgignore
to your system excluding/proc
. You might also want to exclude/dev
and/sys
.