This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [Ada] PR18847 Ada.Numerics.xx_Random.Value does not handlejunk strings
- From: Laurent GUERBY <laurent at guerby dot net>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 09 Apr 2005 20:48:53 +0200
- Subject: Re: [Ada] PR18847 Ada.Numerics.xx_Random.Value does not handlejunk strings
- References: <10504091722.AA27787@vlsi1.ultra.nyu.edu>
On Sat, 2005-04-09 at 13:22 -0400, Richard Kenner wrote:
> Ok the bug is trivial once I peek into the core dump:
>
> No, you're missing it, I think. When you're in GDB, what it does is
> raises an explicit constraint error due to Int'Value, which is what's
> expected. However, for some reason when not under GDB, the handling
> of the exception causes some SIGSEGV.
The line shown in GDB is before the Int'Value. But you're partially
right in the case of Discrete_Random since it is generic, checks
are on, and an exception should happen on the first loop when Stop
reaches Coded_State'Last+1 (a-nudira.adb:237) and may be mishandled but
I'm unable to find trace of that with gdb on the core (I don't much
about GDB possibilities on a core file).
For Float_Random, it's not generic and so compiled with checks off in
the RTS, and the code has a latent buffer overflow bug.
Laurent