X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Gerrit van Niekerk" Organization: GPvNO To: tim DOT nicholson AT skyforcekent DOT com Date: Fri, 23 Mar 2007 21:32:26 +0200 MIME-Version: 1.0 Subject: Re: protecting program memory CC: djgpp AT delorie DOT com Message-ID: <4604476A.28947.324D069D@gerritvn.gpvno.co.za> In-reply-to: <1174648609.965097.60210@b75g2000hsg.googlegroups.com> References: <1174648609 DOT 965097 DOT 60210 AT b75g2000hsg DOT googlegroups DOT com> X-mailer: Pegasus Mail for Windows (4.41) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 23 Mar 2007 at 4:16, tim DOT nicholson AT skyforcekent DOT co wrote: > Is there an easy way to protect the memory used to store the program > op codes from a rogue memory write from within the application? I have > a large (100,000+ line) DJGPP application which sometimes crashes with > SIGILL - It would seem the program is cannibalizing itself! In order > to find how this is happening, I would like to protect the entire > block of memory that contains the application code so that an > exception occurs at the point the corruption occurs rather than the > point that the corrupted code is executed. I certainly thought code would be protected, but it is not - I have just tested it. What is the reason for that?