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 malloc/16810] New: malloc modifies errno on success


https://sourceware.org/bugzilla/show_bug.cgi?id=16810

            Bug ID: 16810
           Summary: malloc modifies errno on success
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: malloc
          Assignee: unassigned at sourceware dot org
          Reporter: mikulas at artax dot karlin.mff.cuni.cz
              Host: arm-linux-gnueabihf
            Target: arm-linux-gnueabihf
             Build: arm-linux-gnueabihf

Created attachment 7532
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7532&action=edit
a simple program that demonstrates that malloc call succeeds and modifies errno

When the brk syscall fails to extend the heap, glibc tries to allocate a new
memory pool using mmap. If mmap succeeds, the block is successfuly allocated
and
returned to the caller - however, in this case, errno is set to ENOMEM.

The attached program demonstrates the problem.

The bug was reproduced on glibc-2.19 on Ununtu Trusy Tahr, glibc-2.13 on Debian
Wheezy and glibc-2.11.3 on Debian Squeeze.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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