This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Ada] PR18847 Ada.Numerics.xx_Random.Value does not handlejunk strings


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]