This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/6958] New: calloc() may return non-cleared memory for applications using mlockall()
- From: "torger at ludd dot ltu dot se" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 13 Oct 2008 18:55:01 -0000
- Subject: [Bug libc/6958] New: calloc() may return non-cleared memory for applications using mlockall()
- Reply-to: sourceware-bugzilla at sourceware dot org
in arena.c there the trick to use madvise(MADV_DONTNEED) to free up / clear
mmap()'d anonymous memory. The return value of madvise() is not checked.
If the user application has called 'mlockall(MCL_CURRENT | MCL_FUTURE);' at
startup, which is common for soft-realtime applications (audio software for
example), madvise(MADV_DONTNEED) in arena.c will return -1 EINVAL since it is
not allowed to release locked pages.
The result is that an application which has locked the memory will in some
(fairly rare) situations get non-cleared memory from calloc(), leading to all
sorts of heisenbugs.
The only other reference I have found to this problem, is this old bug report
(no action):
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=473812
--
Summary: calloc() may return non-cleared memory for applications
using mlockall()
Product: glibc
Version: 2.8
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: torger at ludd dot ltu dot se
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=6958
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.