From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Description of problem: Problem: mmap() system call can return Nil The manual page states that a Nil return is not possible: ------------ Cut Here -------- Cut Here MMAP(2) Linux Programmer's Manual MMAP(2) NAME mmap, munmap - map or unmap files or devices into memory SYNOPSIS #include <sys/mman.h> void * mmap(void *start, size_t length, int prot , int flags, int fd, off_t offset); int munmap(void *start, size_t length); DESCRIPTION The mmap function asks to map length bytes starting at offset offset from the file (or other object) specified by the file descriptor fd into memory, preferably at address start. This latter address is a hint only, and is usually specified as 0. The actual place where the object is mapped is returned by mmap, and is never 0. ... ------------ Cut Here -------- Cut Here Note the last line: "... returned by mmap, and is never 0." Allowing mmap() to return Nil causes all sorts of problems. Not the least of which de-referencing Nil no longer causes a SEGV. Not a happy state of affairs. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Sample program is attached to reproduce the problem 2. 3. Expected Results: mmap should not return 0 because it never places a memory mapping at address 0. mmap returns -1 (the value of the MAP_FAILED macro) on failure. Additional info:
Created attachment 110038 [details] Sample program to illustrate the problem
Linking this bugzilla ID to Issue Tracker (ie. 63665) --gene
This has been deemed a kernel bug in the mmap() system call handling. A fix for this problem was committed to the RHEL3 U5 patch pool last week on 3-Feb-2005 (in kernel version 2.4.21-27.11.EL).
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2005-294.html
*** Bug 158879 has been marked as a duplicate of this bug. ***