From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,58e01463bf74882a X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-10-12 17:27:29 PST Path: gmd.de!xlink.net!howland.reston.ans.net!pipex!uknet!doc.ic.ac.uk!decwrl!pa.dec.com!sousa.ako.dec.com!sousa.ako.dec.com!not-for-mail From: paradis@sousa.ako.dec.com (Jim Paradis) Newsgroups: comp.sys.dec Subject: Re: More Alpha/AXP I cache flushing questions Date: 12 Oct 1993 19:39:21 -0400 Organization: Digital Equipment Corporation, Acton MA Message-ID: <29ff79$ej8@sousa.ako.dec.com> References: <1993Oct12.181743.10010@beaver.cs.washington.edu> NNTP-Posting-Host: sousa.ako.dec.com X-Newsreader: TIN [version 1.1 PL6] David Keppel (pardo@cs.washington.edu) wrote: : For my next Alpha question, I get SEGV's (I'm running OSF/1 1.3) when I : try to `malloc' a region and use it for writing and executing code. (examples deleted) The Alpha AXP virtual memory architecture provides for separate protection bits for read, write, and execute. On many earlier systems, read permission implied execute permission, but this is no longer the case for DEC OSF/1 AXP. Under DEC OSF, the program data, bss, and heap are protected read/write/noexecute. Thus, any newly malloc'ed region is available for read and write access, but NOT for execute access. The purpose of this is that 99% of the time, a branch into user data or heap space is an errouneous wild branch. It is also assumed that anyone who is generating code in data space knows what s/he's doing and can muck the protections accordingly 8-) The reason it doesn't *always* fail on you is that this protection is on an 8K page basis. If you malloc a small chunk (say, 2Kb), mprotect it to permit execution, then malloc *another* small chunk (say, another 2Kb)... then if the second piece is in the same 8K page as the first it will have execute access too. -- Jim Paradis (paradis@tallis.enet.dec.com) The purpose of time is to keep everything from happening at once. It's not working.