From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,81cf58888fdafa95,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-30 09:31:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!psiuk-p4!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: What causes: "raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION" Date: Fri, 30 Nov 2001 11:51:58 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9u8dff$40i$1@nh.pace.co.uk> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1007139119 4114 136.170.200.133 (30 Nov 2001 16:51:59 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 30 Nov 2001 16:51:59 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:17230 Date: 2001-11-30T16:51:59+00:00 List-Id: 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/