This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nscd/9750] New: nscd gc() segmentation fault by estimation failure of alloca()'s stack usage


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]