Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Nov 2009 18:52:01 +0000 (GMT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Sharad Chandra <sharadc@in.niksun.com>
Cc:        freebsd-hackers@freebsd.org, Manprit Singh <manprits@in.niksun.com>
Subject:   Re: mprotect(2) clears the flag for whole page which causes program crash.
Message-ID:  <alpine.BSF.2.00.0911181849460.12162@fledge.watson.org>
In-Reply-To: <200911171529.20098.sharadc@in.niksun.com>
References:  <200911171529.20098.sharadc@in.niksun.com>

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

On Tue, 17 Nov 2009, Sharad Chandra wrote:

> Is it known bug or is there any workaround? How will a userland process make 
> sure that process will not crash as malloc(3) can allocate where ever it get 
> the memory free to use.

mprotect(2) operates on pages, so you'll want to use mmap(2) and munmap(2) to 
allocate and free pages directly rather than mallac(3), which manages byte 
ranges from pages managed using those same interfaces.

Robert N M Watson
Computer Laboratory
University of Cambridge



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