On Mon, Apr 09, 2012 at 07:37:11PM -0700, Sushanth Rai wrote:
> Hello,
> 
> I have a simple program that links with the math library. The only thing that 
> program does is to call mlockall(MCL_CURRENT | MCL_FUTURE). This call to 
> mlockall fails with EAGAIN. I figured out that kernel vm_fault() is returning 
> KERN_PROTECTION_FAILURE when it tries to fault-in the mmap'ed math library 
> address. But I can't figure why.
> 
> The /proc/<mypid>/map returns the following for the process:
> 
> 0x800634000 0x80064c000 24 0 0xffffff0025571510 r-x 104 52 0x1000 COW NC 
> vnode /lib/libm.so.5
> 0x80064c000 0x80064d000 1 0 0xffffff016f11c5e8 r-x 1 0 0x3100 COW NNC vnode 
> /lib/libm.so.5
> 0x80064d000 0x80074c000 4 0 0xffffff0025571510 r-x 104 52 0x1000 COW NC vnode 
> /lib/libm.so.5
> 
> Since ntpd calls mlockall with same option and links with math library too, I 
> look at map o/p of ntpd, which looks slightly different "resident" column 
> (3rd column) on 3rd line:
> 0x800682000 0x80069a000 8 0 0xffffff0025571510 r-x 100 50 0x1000 COW NC vnode 
> /lib/libm.so.5
> 0x80069a000 0x80069b000 1 0 0xffffff0103b85870 r-x 1 0 0x3100 COW NNC vnode 
> /lib/libm.so.5
> 0x80069b000 0x80079a000 0 0 0xffffff0025571510 r-x 100 50 0x1000 COW NC vnode 
> /lib/libm.so.5
> 
> I don't know if that has anything to do with failure. The snippet of code 
> that returns failure in vm_fault() is the following:
> 
> if (fs.pindex >= fs.object->size) {
>       unlock_and_deallocate(&fs);
>       return (KERN_PROTECTION_FAILURE);
> }
> 
> Any help would be appreciated.

This might be a bug fixed in r191810, but I am not sure.

Attachment: pgpHtdR6p6D09.pgp
Description: PGP signature

Reply via email to