Hide Forgot
Description of problem: when executing hugemmap02 testcase from LTP, it failed on s390x. After investigating, seems mmap from 0x80000000 always causes SIGILL so that the test fails. It happens on both RHEL5.6 and RHEL6GA and also latest RHEL6.1. The SIGILL is not documented in man mmap(2). Here is a simple reproducer: #include <errno.h> #include <unistd.h> #include <fcntl.h> #include <signal.h> #include <sys/mman.h> int main() { int nfildes; unsigned long *addr; nfildes = open("/dev/zero", O_RDONLY, 0666); addr = mmap((void *)0x80000000, getpagesize(), PROT_READ, MAP_SHARED | MAP_FIXED, nfildes, 0); if (addr == MAP_FAILED) return 1; return 0; }
Since RHEL 6.3 External Beta has begun, and this bug remains unresolved, it has been rejected as it is not proposed as exception or blocker. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
Hi, your test program will not work because the program text segment will be loaded at address 0x80000000. The mmap() with MAP_FIXED flag enforces the mapping of /dev/zero in the specified address and, thus, overriding the program's text segment with zeros. I suggest that you change your test case and use a different address or remove the MAP_FIXED flag to let mmap() assign you an address. Thanks and kind regars, Hendrik
*** Bug 1270205 has been marked as a duplicate of this bug. ***