Bug 171931 - Having more than 400 files in a directory causes a segmentation fault during mmap
Having more than 400 files in a directory causes a segmentation fault during ...
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
x86_64 Linux
medium Severity high
: ---
: ---
Assigned To: Peter Staubach
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2005-10-27 17:30 EDT by Joseph Salisbury
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-11-08 12:56:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
strace during segmentation fault (4.03 KB, text/plain)
2005-10-27 17:30 EDT, Joseph Salisbury
no flags Details
strace with 400 files - does not cause seg fault. (9.60 KB, text/plain)
2005-10-27 17:32 EDT, Joseph Salisbury
no flags Details

  None (edit)
Description Joseph Salisbury 2005-10-27 17:30:33 EDT
Description of problem:
We are working on the certification of Oracle 10g on GFS 6.0/RHEL3.  The oracle
tests create directories with around 1100 files.  However, a segmentation fault
occurs when more than 400 files exist in an EXT3 or GFS filesystem directory. 
The problem happens exactly when the file count reaches 401.  It does not happen
if the file count is 400 or less.  

The EXT3 file system is using the cciss driver.  The GFS filesystem is using pool.  

The system is a DL585 with AMD processors and 16G of memory.  
Version-Release number of selected component (if applicable):
The kernel version is: 2.4.21-34.ELsmp

The output from uname -a is:
Linux spa65 2.4.21-34.ELsmp #1 SMP Thu Jul 28 23:28:35 EDT 2005 x86_64 x86_64
x86_64 GNU/Linux

How reproducible:
Create a directory with more than 400 files on an EXT3 or GFS filesystem using
the x86_64 version of RHEL3.

Actual results:
An ls on a directory with 401 or greater files causes a segmentation fault when
ls is performed.  The seg fault happens during mmap().

Expected results:
ls should return file names.

Additional info:
I collected an strace when the seg fault happens with 401 files and when it
dosen't happen with 400 files.  See attachments for strace data.
Comment 1 Joseph Salisbury 2005-10-27 17:30:34 EDT
Created attachment 120489 [details]
strace during segmentation fault
Comment 2 Joseph Salisbury 2005-10-27 17:32:05 EDT
Created attachment 120490 [details]
strace with 400 files - does not cause seg fault.
Comment 3 Ernie Petrides 2005-10-27 18:32:38 EDT
If an "ls" command segfaults, it is not likely to be a kernel problem.

But I'll assign this to PeterS for investigation first (in case the
kernel is providing bogus data with the getdents64() syscall), and he
can bounce it to the appropriate component if he finds that it's indeed
a bug somewhere else.
Comment 4 Peter Staubach 2005-11-01 15:36:08 EST
I tried creating directories of 676 files, with varying file names from 2 bytes
up to 202 bytes.  I don't see a failure.  Is there a reproducer for this
Comment 5 Joseph Salisbury 2005-11-01 15:54:30 EST
We ran an up2date on the system, which fixed the problem on EXT3.  We will also
test GFS to see if the problem went away there as well.
Comment 6 Peter Staubach 2005-11-08 12:56:39 EST
I am going to close this, but if it occurs again or more information
becomes available, please reopen this report and I will look at it then.

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