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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1580f5833894f157 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 26 Sep 2006 21:22:22 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: program error (exception access violation) in windows References: <1159312713.137314.324080@h48g2000cwc.googlegroups.com> X-Newsreader: Tom's custom newsreader Message-ID: Date: Tue, 26 Sep 2006 21:22:23 -0500 NNTP-Posting-Host: 67.164.83.70 X-Trace: sv3-821GN6X21BtE0KqrMID/Rk1HpHwKsRnoH26uoMksF7jDE9/E2ZljPSqAMV+NtJgdLpxxUPuC10N0kHQ!rephXPFomeo5meTMszmGJl/DO+IFQloof5zoRkqIkzIAEFHEXDxv8SPa4kOaqmHvLbpsYNKLQU2E!PvmPVzPLA7MOvg== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:6763 Date: 2006-09-26T21:22:23-05:00 List-Id: > raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION Memory allocation is clearly very compiler dependent. I guess you are using some variety of Gnat? What does a stack traceback show? Does the Linux version run with the same series of allocations and pass successfully through the point where the Windows version finds itself with a null pointer? Are you sure this exception is being raised by your Ada program's attempt to reference through a null pointer, or might it be something down inside the run-time system that could be different in Linux vs Windows Gnat? > We've tried numerous different ways of allocating the memory in ada, > and free'ing it in C. We even got a smiliar error when we tried > allocating it in Ada, and free'ing it in Ada through another C call to > the ada library. If you do all the allocation and deallocation within your Ada program, and none in the C program, do you still have problems? How about if you don't use any Ada "new" or Unchecked_Deallocation, but always make explicit calls to C routines.