comp.lang.ada
 help / color / mirror / Atom feed
From: James Alan Farrell <anonymous@anonymous.com>
Subject: Re: STORAGE_ERROR in adainit
Date: Thu, 12 Aug 2004 09:35:32 -0400
Date: 2004-08-12T09:35:32-04:00	[thread overview]
Message-ID: <d4rmh0toc3sumrp342nukim85j0rj5gedn@4ax.com> (raw)
In-Reply-To: 2nvktgF5530iU1@uni-berlin.de

Marc, 
Thanks for the reply

We've already tried the steps you suggest.  The program now is quite
small - simply the call to adainit and to one C library function.  The
complexity (at least at this time) is in building the libraries.  Thus
creating a "toy" program will be little better than creating the
program we have now.

We cannot call any other Ada procedures until Adainit completes
successfully.  A C main that simply calls Adainit works fine.  A C
main that calls Adainit then only functions in the Ada library works
fine.  We only have problems when we start pulling in the C libraries.

We have experimented with calling different C library functions and
found that some cause the problem and others do not, depending on what
C library the function is in.  We  found that none of the libraries
that do *not* call to other libraries show this problem.  Some of
those that do make such calls show the problem and others do not.  I
do not know if one C library calling another C library is relevant.

It is our understanding that when a call is made to a library, that
causes the object file in which the function resides to be linked in.
We traced one occurance of the problem to a call in C library to an
error function that uses fprintf and exit.  Looking at the included
object file (actually the C source), it is a set of error routines,
each of which calls fprintf then exit and nothing else.  So we pulled
the call to the error function out of the library and replaced it with
direct calls to fprintf and exit.  Adainit completed correctly.  So
pulling in the object file that makes calls to these functions and
only these functions causes the problem, but making direct calls to
these functions without pulling in that object file does not.

The file with the error routines are not in the same library as the
function calling them. 

This suggests to me that I need to create a small simple C lib with
one object file in it, then a second simple C lib that calls the
first.  Then a C main that calls Adainit then a function in the second
lib.  I'll report back later today on the results of that experiment.

Don't know if this will make things clearer to anyone else -- their
"as clear as mud" to me.

Thanks again to anyone who can shed further light on this problem.
James

On Wed, 11 Aug 2004 17:29:01 -0500, "Marc A. Criley"
<mcNOSPAM@mckae.com> wrote:

>"James Alan Farrell" <anonymous@anonymous.com> wrote:
>
>> I have a mixed language program with the main function written in C.
>> There are several libraries written C and one written in Ada.  The
>> first command in main is adainit, and that function is raising the
>> following error:
>>
>> raised STORAGE_ERROR : stack overflow (or erroneous memory access)
>
>Can you write a toy program with a C main that calls into Ada? Like building
>one of the example programs. Just to make sure there's no environmental
>issue that's causing interference.
>
>Then how about a C main that just calls adainit?
>
>Do you get a storage error on adainit when calling just one of the library
>functions? If not, which function triggers the problem and in what library
>does it reside?
>
>This is the kind of stuff I'd try to try to starting localizing the
>problem...
>
>> Is there anything special I have to do to create C libraries when
>> linking to Ada libraries?
>
>No, just plain old compilation of them should work fine.
>




  reply	other threads:[~2004-08-12 13:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-11 21:31 STORAGE_ERROR in adainit James Alan Farrell
2004-08-11 22:29 ` Marc A. Criley
2004-08-12 13:35   ` James Alan Farrell [this message]
2004-08-12 14:20     ` Frode Tenneboe
2004-08-12 15:55       ` James Alan Farrell
2004-08-12 21:17         ` Björn Persson
2004-08-12 19:28 ` James Alan Farrell
2004-08-12 19:42   ` Ludovic Brenta
2004-08-12 22:10     ` Stephen Leake
2004-08-12 21:15   ` Björn Persson
2004-08-13 13:36     ` James Alan Farrell
2004-08-17 21:37       ` Björn Persson
2004-08-18 14:00         ` James Alan Farrell
2004-08-18 15:57           ` Björn Persson
2004-08-18 19:44           ` Simon Wright
2004-08-18 21:13             ` James Alan Farrell
replies disabled

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