Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2006 09:24:47 GMT
From:      Jan <jan@concept.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   i386/94827: mmap with given (void *addr) may lock memory-manager
Message-ID:  <200603220924.k2M9Olul073778@www.freebsd.org>
Resent-Message-ID: <200603220930.k2M9UBle082057@freefall.freebsd.org>

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

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603220924.k2M9Olul073778>