This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug malloc/16810] New: malloc modifies errno on success
- From: "mikulas at artax dot karlin.mff.cuni.cz" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 05 Apr 2014 00:58:47 +0000
- Subject: [Bug malloc/16810] New: malloc modifies errno on success
- Auto-submitted: auto-generated
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.