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 nis/10432] New: _nss_nis_setnetgrent assertion failure


With a specific NIS + netgroup configuration, I can reproduce the following
problem consistently:

# ksh -c "ls ~leonardo"
ksh: nss_nis/nis-netgrp.c:74: _nss_nis_setnetgrent: Assertion
`malloc_usable_size (netgrp->data) >= len + 1' failed.
Aborted

Further debugging proved that the problem only happens when netgrp->data is
allocated by libast's malloc() instead of the regular glibc's malloc().

It seems that libast's version doesn't fill some fields in the malloc chunk,
more specifically, this is the macro -- called from malloc_usable_size -- that
fails (from malloc/malloc.c):

/* extract p's inuse bit */
#define inuse(p)\
 ((((mchunkptr)(((char*)(p))+((p)->size & ~SIZE_BITS)))->size) & PREV_INUSE)

If I understand correctly, the memory chunk is not marked as "in use".

As this is the only use of malloc_usable_size() in current glibc (outside
malloc.c), and the assert seems pointless, I'd like to suggest its removal.

I'm marking this against version 2.4 but I believe it's reproducible with latest
2.10/11 too.

-- 
           Summary: _nss_nis_setnetgrent assertion failure
           Product: glibc
           Version: 2.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nis
        AssignedTo: kukuk at suse dot de
        ReportedBy: leonardo at ngdn dot org
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10432

------- 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]