On 2005/04/24, at 13:55, Mark D. Baushke wrote:

Attached is a patch against 1.12.12 that fixes the MMAP_ANON
detection problem in mmap-anon.m4 that would lead to unexpected
"memory exhausted" error on several platforms.

Examples of such platforms would be nice to include for the ChangeLog...

Well, I just experienced it on MacOS X, but virtually the same error should occur on any platforms that refuse /dev/zero to be mmap'ed. That's why I wrote "several platforms".

To confirm which are actually the ones, I ran this code on the following
systems: Linux, Solaris, *BSD and MacOS X. The results are shown in the
below table.

#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>

    void *buf;
    int fd = open("/dev/zero", O_RDONLY, 0666);
    buf = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
    printf("%#08x %s\n", buf, strerror(errno));

Platform              mmap(/dev/zero)
Linux (Debian Sarge)  allowed
Solaris 9             allowed
FreeBSD (4.8)         allowed
NetBSD (1.6.1)        allowed
OpenBSD  (3.4)        allowed
MacOSX (10.1 Server)  not allowed
MacOSX (10.2 Server)  not allowed
MacOSX (10.3 Client)  not allowed
Cygwin                allowed

So, despite my assumption, the platform known to be affected is MacOS X
only, for now :)

A patch to m4/mmap-anon.m4 would need to be made to the GNULIB master
sources. I am CC'ing bug-gnulib@gnu.org on this message.


The patch to look for at using a #include <pam/pam_appl.h> for MacOS X
seems reasonable. I'll try to dig up a MacOS X box to as a test before I
commit it. For the ChangeLog entry, do you happen to know for which
MacOS X releases this support (10.0, 10.1, 10.2, 10.3, ...) applies?

AFAIK, it's been available since 10.2.


Bug-cvs mailing list

Reply via email to