public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nis/10432] New: _nss_nis_setnetgrent assertion failure
@ 2009-07-22 19:36 leonardo at ngdn dot org
  2009-07-22 19:38 ` [Bug nis/10432] " leonardo at ngdn dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: leonardo at ngdn dot org @ 2009-07-22 19:36 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <bug-10432-131@http.sourceware.org/bugzilla/>]

end of thread, other threads:[~2015-10-29 16:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-22 19:36 [Bug nis/10432] New: _nss_nis_setnetgrent assertion failure leonardo at ngdn dot org
2009-07-22 19:38 ` [Bug nis/10432] " leonardo at ngdn dot org
2009-07-23  8:53 ` pasky at suse dot cz
2009-10-30  5:45 ` drepper at redhat dot com
     [not found] <bug-10432-131@http.sourceware.org/bugzilla/>
2014-07-01  7:43 ` fweimer at redhat dot com
2014-07-01  7:43 ` fweimer at redhat dot com
2014-07-01  9:12 ` fweimer at redhat dot com
2014-07-01  9:14 ` fweimer at redhat dot com
2015-10-06 12:07 ` cvs-commit at gcc dot gnu.org
2015-10-06 12:08 ` fweimer at redhat dot com
2015-10-29 16:27 ` jsm28 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).