comp.lang.ada
 help / color / mirror / Atom feed
* What causes: "raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION"
@ 2001-11-30 16:51 Marin David Condic
  2001-12-01  2:20 ` Robert Dewar
  0 siblings, 1 reply; 2+ messages in thread
From: Marin David Condic @ 2001-11-30 16:51 UTC (permalink / raw)


I'm compiling a program with Gnat 3.13p on a PC with WinNT. The program is
messing around with pointers to a class and is doing type conversions on the
pointer.all parts to coerce them into being of a particular subclass. (I
define the "+" operator for the subclass, so I need to convert the object to
that subclass.) The code is a bit too involved to post here & I don't think
there is anything wrong with it. Here's the wierd part:

The subroutine in question works on the first call with a given data set. It
raises the exception:

raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION

on the second call with the identical data set. I started putting in
Put_Line statements to see where it stopped. A Put_Line that referenced one
of the pointers in the loop just prior to the computation causes everything
to work fine. (I really *hate* it when the debug code makes the bug go
away!)

I'd rather not get into posting the code because in order to really see all
of the pieces involved, I'd have to provide the whole chain of classes. I
think I may have a compiler bug here since, as I say, it works on the first
pass through the data and not through the second pass and the debug code
causes the error to go away. What I'm wondering is if anybody knows what
might cause this specific exception to get raised? Is there a known defect
in Gnat 3.13 that might generate this exception?

If I can't find a work-around (maybe reference the pointers in a different
order?) I may try to reproduce the error in a test case or (*gasp!) resort
to using the debugger, but if anyone knows anything about this I'd
appreciate whatever info you may have.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/






^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: What causes: "raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION"
  2001-11-30 16:51 What causes: "raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION" Marin David Condic
@ 2001-12-01  2:20 ` Robert Dewar
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Dewar @ 2001-12-01  2:20 UTC (permalink / raw)


"Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org> wrote in message news:<9u8dff$40i$1@nh.pace.co.uk>...
or (*gasp!) resort
> to using the debugger, but if anyone knows anything about this I'd
> appreciate whatever info you may have.
> 
> MDC



Why on earth would you not use the debugger to at least
get a traceback. It is trivial to do this and otherwise
you seem to be wasting lots of your time.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-12-01  2:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-30 16:51 What causes: "raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION" Marin David Condic
2001-12-01  2:20 ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox