Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Oct 2009 03:41:14 +0200 (CEST)
From:      Alexander Best <alexbestms@math.uni-muenster.de>
To:        <freebsd-hackers@FreeBSD.org>
Subject:   mmap(2) segaults with certain len values and MAP_ANON|MAP_FIXED
Message-ID:  <permail-2009102101411480e26a0b00003712-a_best01@message-id.uni-muenster.de>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
hi there,

just a little mmap(2) related question. running the following code causes a
segfault:

mmap( (void*)0x1000, 0x80047000, PROT_NONE, MAP_ANON|MAP_FIXED, -1, 0 );

while the following doesn't:

mmap( (void*)0x1000, 0xffffffff, PROT_NONE, MAP_ANON|MAP_FIXED, -1, 0 );

is this a known problem? seems reproducible on all branches.

cheers
alex

[-- Attachment #2 --]
#include <sys/mman.h>
#include <stdlib.h>
#include <stdio.h>

int main()
{
	printf("mmap: %p\n", mmap( (void*)0x1000, 0xffffffff, PROT_NONE, MAP_ANON|MAP_FIXED, -1, 0 ));
	printf("mmap: %p\n", mmap( (void*)0x1000, 0x80047000, PROT_NONE, MAP_ANON|MAP_FIXED, -1, 0 ));

	return 0;
}

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-2009102101411480e26a0b00003712-a_best01>