This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nscd/9750] New: nscd gc() segmentation fault by estimation failure of alloca()'s stack usage
- From: "j-nomura at ce dot jp dot nec dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 16 Jan 2009 11:42:34 -0000
- Subject: [Bug nscd/9750] New: nscd gc() segmentation fault by estimation failure of alloca()'s stack usage
- Reply-to: sourceware-bugzilla at sourceware dot org
The garbage collection function, gc(), estimates the stack usage
to switch the allocation method.
For the allocation of 'struct moveinfo', it adds the size given to alloca().
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/nscd/mem.c.diff?r1=1.3.2.8&r2=1.3.2.9&cvsroot=glibc
In fucntion gc():
new_move = alloca (sizeof (*new_move));
stack_used += sizeof (*new_move);
However, alloca() seems to allocate additional +16 bytes for each allocation
in my case (Fedora 9, x86_64).
As a result, the estimation gets wrong and gc() ends up to segmentation fault.
Simply summing up the extra 16 bytes to the estimation would solve the problem.
Or if there is a better method to determine the current stack usage,
it might be better to switch the whole estimation stuff to use that.
--
Summary: nscd gc() segmentation fault by estimation failure of
alloca()'s stack usage
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: nscd
AssignedTo: drepper at redhat dot com
ReportedBy: j-nomura at ce dot jp dot nec dot com
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=9750
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.