i386/94827: mmap with given (void *addr) may lock memory-manager
Jan
jan at concept.de
Wed Mar 22 09:30:20 UTC 2006
>Number: 94827
>Category: i386
>Synopsis: mmap with given (void *addr) may lock memory-manager
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-i386
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Mar 22 09:30:10 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Jan
>Release: 5.3
>Organization:
Concept Engineering GmbH
>Environment:
FreeBSD star2 5.3-RELEASE FreeBSD 5.3-RELEASE #4: Thu Nov 17 12:33:20 CET 2005 jrr at star2:/usr/src/sys/i386/compile/STAR2 i386
>Description:
Hi!
Given the following code:
-- 8< --
#include <sys/mman.h>
#include <stdlib.h>
#include <stdio.h>
int main(){
printf("mmap: %p\n", mmap( (void*)0x1000, 0x8047004, PROT_NONE,
MAP_PRIVATE|MAP_ANON|MAP_NORESERVE, -1, 0 ));
printf("malloc: %p\n", malloc(4));
return 42;
}
-- 8< --
returns NULL for the malloc on my machine ( also happens on 3.4-RELEASE; does not fail on AIX/Solaris/Windows/Linux/HPUX )
It runs well if *addr is set to NULL or if the requestet memory is a bit smaller. The prot. flags does not affect the behaviour.
>How-To-Repeat:
If the code doesnt show anything wrong, try to increase the requested mmap mem. There seems to be a border at 0x8047000 on my machines. Anything below 0x8047000 works fine here.
>Fix:
In fact, i need a fix :)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-i386
mailing list