Bug 695703 - SIGILL received on s390x when mmap from 0x80000000
Summary: SIGILL received on s390x when mmap from 0x80000000
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.0
Hardware: s390x
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Hendrik Brueckner
QA Contact: Caspar Zhang
URL:
Whiteboard:
: 1270205 (view as bug list)
Depends On:
Blocks: 767187 846704
TreeView+ depends on / blocked
 
Reported: 2011-04-12 13:26 UTC by Caspar Zhang
Modified: 2015-10-09 17:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-28 15:59:45 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Caspar Zhang 2011-04-12 13:26:43 UTC
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;
}

Comment 2 RHEL Program Management 2012-05-03 04:53:46 UTC
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.

Comment 3 Hendrik Brueckner 2013-02-28 15:59:45 UTC
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

Comment 4 Carlos O'Donell 2015-10-09 17:22:37 UTC
*** Bug 1270205 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.