Subject: Re: mprotect(2) strange behaviour under compat linux
To: Christos Zoulas <>
From: Nicolas Joly <>
List: current-users
Date: 12/18/2007 11:40:27
On Tue, Dec 18, 2007 at 03:32:37AM +0000, Christos Zoulas wrote:
> In article <>,
> Nicolas Joly  <> wrote:
> >
> >While working on compat linux i encountered some strange mprotect(2)
> >behaviour.
> >
> >The attached piece of code work on NetBSD i386/amd64, Linux
> >i386/x86_64, but not under compat linux/i386 or linux32/amd64.
> Can you add a segv handler in the program so that ktrace prints more
> info as it passes it to the signal handler? I am interested if it is
> a protection error or an access error. If it is an access error, please
> try to instrument line 771 in uvm_fault.c to see what's causing it.

Thank for the tip.

This is an access error:

   619      1 mprotect PSIG  SIGSEGV caught handler=0x8048518 mask=(8,11,12,13,14,15,19,20,22,25,27,28,30,33,38,39,45,47,48,49,50,51,52,53,54,55,57,58,59,60,61,62,63): code=SEGV_ACCERR, addr=0xbbaba000, trap=14)

Intrumenting uvm_fault.c show that protections are correct (check_prot
= 0x2), but something (memset ?) is trying to access this area for
reading (access_type = 0x1) ...

Could this be a bug in memset from suse 10.0 glibc (from
pkgsrc/emulators/suse100_base) ?

Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.