Subject: Is there a problem with mprotect?
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: John C. Hayward <johnh@david.wheaton.edu>
List: current-users
Date: 08/28/1994 18:16:45
Dear NetBSDers,
   I am attempting to report Modula-3 from NetBSD-09 to NetBSD-1.0_BETA.
I have picked up the binary tar files of NetBSD from ftp.iastate.edu dated 
Aug 1.
I then picked up the source tar files from ftp.iastate.edu dated Aug 21.
I have built a new vmunix along with most of the other programs.
   I have two problems:

1) ps seems not to work reporting:
     ps: proc size mismatch (18676 total, 640 chunks)
   
   Has anyone else seen this problem?  I tried remaking the libraries and 
   remaking ps but I still get this error message.

2) The runtime system of Modula-3 supports threads and for the stack for
   each thread it makes one page of the stack readonly with mprotect to 
   detect stack overflows.  The problem seems to be that the area of memory
   protected by mprotect is different than what was asked for.  It seems
   to protect after about byte 2400 and stop protecting after 4670.  This
   causes problems because the pagesize reported back is 4096.  Attempting
   to write to memory locations just above the asked for protected area
   results in signal causing the program to halt.

   The manual entry for mprotect indicates that not all implementations 
   guarentee protection on a page basis. 

   Does NetBSD-1.0_Beta for I386 support protection on a page basis?

   The manual entry for malloc indicates that if the size of the object
   asked for is pagesize or larger the memory will be paged aligned.
   The addresses I seem to get from malloc independent of size seem to
   be multiples of 8192.

   Does NetBSD-1.0_Beta for I386 have pagesize of 4096 (like reported from
   getpagesize) or 8192?

   I have written short C programs in which mprotect seems to be doing it's
   stuff correctly.  In the Modula-3 stuff I am porting I have gone down to
   the level to make sure the parameters were correct for calls to mprotect
   and the assignment.  I am not sure if there is a problem with mprotect
   or not.

   Is anyone else seeing any problems with mprotect?

   Any suggestions would be appreciated.

johnh...

   johnh@david.wheaton.edu


------------------------------------------------------------------------------