Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 208093 - opendir / __alloc_dir may try to malloc too much memory
Summary: opendir / __alloc_dir may try to malloc too much memory
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-29 20:23 UTC by Garth
Modified: 2008-01-29 21:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Garth 2008-01-29 20:23:22 UTC
When a xfs partition is mounted using allocsize and largeio (but no swidth), 
the value of st_blksize is set to allocsize in bytes.
This can cause unreasonable amount of memory being allocated as allocsize can  
be up to 1Gib.

On a system with 1Gb of memory, with the xfs mount options: allocsize=512m,largeio , having 1 large file open, and trying to list a 
point on the filesystem results in ENOMEM error. 

For more details, please look at:
https://bugzilla.redhat.com/show_bug.cgi?id=430768
for more specifics (including strace). (the person who posted it helped me to debug it)

Memory allocation for opendir is done in glibc, file: sysdeps/unix/opendir.c

Some sort of upper boundary should be placed on the memory allocation, or a fallback in case ENOMEM occurs.


When looking around about this problem, I also came across:
http://sources.redhat.com/bugzilla/show_bug.cgi?id=4099
which is related by the way st_blksize is being used.