This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Ada: fix handling of SEGV under Win32
- From: ja2morri at csclub dot uwaterloo dot ca (James A. Morrison)
- To: Arnaud Charlet <charlet at ACT-Europe dot FR>
- Cc: gcc-patches at gcc dot gnu dot org, Pascal Obry <obry at gnat dot com>
- Date: 21 Nov 2004 15:54:03 -0500
- Subject: Re: Ada: fix handling of SEGV under Win32
- References: <20041027095833.GK91230@province.act-europe.fr>
Arnaud Charlet <charlet@ACT-Europe.FR> writes:
> Tested on x86-windows
>
> Fix handling of SEGV under Win32 by avoiding the recursive
> implementation to detect a segmentation violation or a stack overflow.
This testcase also fails with a segfault using gnat 3.3 on powerpc-linux.
> Instead of trying to read the memory before the faulting page (and
> eventually getting a new signal) we properly test the process read
> access for this address using appropriate Win32 routine. This
> implementation is simpler and cleaner and fix a regression on Windows
> XP/SP2 where the second signal was just crashing the program without
> any exception propagation.
>
> Test case:
> with Ada.Exceptions; use Ada.Exceptions;
> with Ada.Text_IO;use Ada.Text_IO;
> with System;
>
> procedure Segv is
> A : Integer;
> for A'Address use System.Null_Address;
> begin
> A := 1;
> exception
> when E : others =>
> Put_Line ("OK exception");
> end;
> $ gnatmake segv
> $ ./segv
> OK exception
--
Thanks,
Jim
http://www.student.cs.uwaterloo.ca/~ja2morri/
http://phython.blogspot.com
http://open.nit.ca/wiki/?page=jim