Bug 144593 - grep on /etc/udev/devices causes kernel oops/freeze/panic
Summary: grep on /etc/udev/devices causes kernel oops/freeze/panic
Alias: None
Product: Fedora
Classification: Fedora
Component: udev (Show other bugs)
(Show other bugs)
Version: 3
Hardware: i686 Linux
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact:
: 141294 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2005-01-09 01:14 UTC by Trevor Cordes
Modified: 2007-11-30 22:10 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-27 10:13:04 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Trevor Cordes 2005-01-09 01:14:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041107 Firefox/1.0

Description of problem:
Being an administrator, I often "grep -ri word /etc" to find things. 
That command now freezes my system with a kernel panic:

kernel panic - not syncing: arch/i386/kernel/semaphore.c: 64
spin_is_locked on uninitialized spinlock f9496c28

system is frozen with caps & scroll lock flashing

After looking at other bugzilla reports and toying with the grep
command to narrow the problem, I discovered the panic is triggered
when grep gets to /etc/udev/devices and the nvidia* modules within.

PLEASE, before marking this as a duplicate of the twenty million
nvidia bugs, let's think about the problem for a minute.  I have a
feeling that this problem could occur with any non-plain file that may
be put in that directory.  Normally you wouldn't want to read from
device files during a grep.

It seems to me the whole idea of putting device files in
/etc/udev/devices is flawed in this regard.  They should live in
another part of the filesystem, maybe even their own root dir, like
/udev.  I can't be the only one who greps entire root subdirs (/var,
/etc, etc).

It may not be RH's responsibility to make sure nvidia drivers don't
crash the system, but it should be RH's responsibility to ensure a
safe and logical operating environment for these third party drivers.

Strangely enough, grep's --devices=skip didn't solve the problem -- it
still crashed even with that option.  That also seems a little fishy
to me.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. have 3rd party device files in /etc/udev/devices (tested with nvidia)
2. grep -ri word /etc

Actual Results:  kernel panic / complete freeze

Expected Results:  grep completes as normal

Additional info:

nvidia driver version: NVIDIA-Linux-x86-1.0-6629-pkg1.run

Comment 1 Sitsofe Wheeler 2005-01-09 22:06:22 UTC
I have another question. Should it be safe to grep a device node regardless of
whether it is in use or not? If it should always be safe then this is a bug in
the nvidia drivers...

Comment 2 Harald Hoyer 2005-01-10 10:58:19 UTC
hmm, should not be safe... sometimes reading a register takes some
actions on various chipsets and if you trigger the wrong ones you are
But good point with your bugzilla. I will move it to another place.

Comment 3 Féliciano Matias 2005-01-10 18:17:06 UTC
I don't like "/udev" :-)

Some propositions :
- /etc/udev/static_dev.d/start_udev  <= the current list of devices in
- /etc/udev/static_dev.d/nvidia
- /etc/udev/static_dev.d/mga_vid
- /etc/udev/start_udev.d/default <= the current list of devices in

The content :
DEV = tty1 ppp ...

For exemple, the nvidia paquage will use :

Comment 4 Arjan van de Ven 2005-01-11 08:37:27 UTC
you caught a nice bug in the nvidia driver; please report that to
nvidia, at least as far as the kernel crash is concerned.

Comment 5 Michael A. Peters 2005-01-12 02:31:23 UTC
Could this be the same thing as
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=141294 ??

Comment 6 Harald Hoyer 2005-01-12 09:20:07 UTC
*** Bug 141294 has been marked as a duplicate of this bug. ***

Comment 7 Trevor Cordes 2005-01-12 09:50:00 UTC
Yes, it sounds like the same problem.  His output looks like what I
saw except I get a panic and he only got a segfault.  Perhaps it is
card and/or driver state dependent.

The root of the problem still exists however -- having device nodes in
/etc and/or device nodes that are not readable without panics.

I will try to notify nvidia of the bug.

Comment 8 Dale Stimson 2005-01-16 22:20:45 UTC
A workaround for grep users (such as the original poster):
    grep -D skip
    grep --devices=skip

will cause grep to skip device nodes, FIFOs, or sockets.

Comment 9 Dale Stimson 2005-01-16 22:24:43 UTC
My apologies (and sorry for again adding noise to the email of those
watching this bug).  When I posted my previous comment on this bug, I
didn't see the original poster's comment:

> Strangely enough, grep's --devices=skip didn't solve the problem -- it
> still crashed even with that option.  That also seems a little fishy
> to me

Comment 10 Trevor Cordes 2005-02-05 05:32:35 UTC
I've started a thread on the nvnews NVIDIA support forums.  We'll see
if anyone (at NV hopefully) has anything to say.


PS: I'm 99% positive I tested the grep --devices=skip option *twice*,
once with the option manually on the cmd line and a second time with
the option in a site-wide csh alias, and both times it panicked.  I'm
too scared of data corruption and rebooting my system (a production
workstation/server!!) to try again unless absolutely necessary.

It would be nice if one other person could grep their nv* device files
to confirm that it's not specific to my particular card, driver
version, kernel version, etc.

Comment 11 tshanks 2005-03-13 17:48:03 UTC
Does the same thing for me and several people I know.  My machine panics daily because 
updatedb hits this device file.  updatedb skips all of /dev, but some undeniably bright 
person decided to make the default location for all of udev /etc/udev.  Did someone make 
a typo in the scripts for the package?  This can't be intentional.

Comment 12 Harald Hoyer 2005-04-27 10:13:04 UTC
/etc/udev/devices was meant as a "last resort" and should not be used as a
standard place. rawhide has a better mechanism, which I will document soon.

Note You need to log in before you can comment on or make changes to this bug.