comp.lang.ada
 help / color / mirror / Atom feed
* gnatbind get stack overflow, how do I investigate the cause?
@ 2017-03-30 13:00 Petter Fryklund
  2017-03-30 13:51 ` Anh Vo
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Petter Fryklund @ 2017-03-30 13:00 UTC (permalink / raw)


Hi all,

after a couple of years with C# I'm back! I am currently porting a large project from Ada-95 in ObjectAda to GNAT 17, first on Linux and later on W7. I've managed to compile the all files, but gnatbind hits a stack overflow. How do I get more information about the cause?

Regards,
Petter

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

* Re: gnatbind get stack overflow, how do I investigate the cause?
  2017-03-30 13:00 gnatbind get stack overflow, how do I investigate the cause? Petter Fryklund
@ 2017-03-30 13:51 ` Anh Vo
  2017-03-30 14:30 ` Dmitry A. Kazakov
  2017-03-30 16:22 ` Per Sandberg
  2 siblings, 0 replies; 7+ messages in thread
From: Anh Vo @ 2017-03-30 13:51 UTC (permalink / raw)


On Thursday, March 30, 2017 at 6:00:34 AM UTC-7, Petter Fryklund wrote:
> Hi all,
> 
> after a couple of years with C# I'm back! I am currently porting a large project from Ada-95 in ObjectAda to GNAT 17, first on Linux and later on W7. I've managed to compile the all files, but gnatbind hits a stack overflow. How do I get more information about the cause?
 
I have never had this kind of problem with GNAT. Since you are using GNAT 17, you must have support contract. I would create a ticket with AdaCore. In the mean time, could you post the exact gnatbind error message.

Anh Vo

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

* Re: gnatbind get stack overflow, how do I investigate the cause?
  2017-03-30 13:00 gnatbind get stack overflow, how do I investigate the cause? Petter Fryklund
  2017-03-30 13:51 ` Anh Vo
@ 2017-03-30 14:30 ` Dmitry A. Kazakov
  2017-03-30 16:22 ` Per Sandberg
  2 siblings, 0 replies; 7+ messages in thread
From: Dmitry A. Kazakov @ 2017-03-30 14:30 UTC (permalink / raw)


On 30/03/2017 15:00, Petter Fryklund wrote:

> after a couple of years with C# I'm back! I am currently porting a
> large project from Ada-95 in ObjectAda to GNAT 17, first on Linux and
> later on W7. I've managed to compile the all files, but gnatbind hits a
> stack overflow. How do I get more information about the cause?

Are you sure? Usually it is the compiler that runs out of memory. It 
happens very often if you have many generic instances.

The only solution I know is splitting compilation units. Important is 
the "distance". If you move X into packet Q that is "with"-ed in the 
packet P where compiler ran out of memory that is the distance 1. This 
is not enough. The distance must be at least 2. Therefore separate 
bodies do not help. Packing generic instances into a collection package 
does not help. etc.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


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

* Re: gnatbind get stack overflow, how do I investigate the cause?
  2017-03-30 13:00 gnatbind get stack overflow, how do I investigate the cause? Petter Fryklund
  2017-03-30 13:51 ` Anh Vo
  2017-03-30 14:30 ` Dmitry A. Kazakov
@ 2017-03-30 16:22 ` Per Sandberg
  2017-03-31  5:10   ` Petter Fryklund
  2 siblings, 1 reply; 7+ messages in thread
From: Per Sandberg @ 2017-03-30 16:22 UTC (permalink / raw)


Hi

I did the same journey a on our system many years ago, and it was 
"interesting" since we found a whole bunch of serious bugs just by 
follow up on warnings and later enable all validity checks.

You might increase the stacksize with:
   -dnn[k|m] Default primary stack size = nn [kilo|mega] bytes
   -Dnn[k|m] Default secondary stack size = nn [kilo|mega] bytes
from "gnatbind -h"

And expect a bunch of elaboration circles that needs to be broken out by 
factoring out generics and separates into child packages.

And as Anh mentions ask AdaCore, since they usually gives good answers.

/Per


Den 2017-03-30 kl. 15:00, skrev Petter Fryklund:
> Hi all,
>
> after a couple of years with C# I'm back! I am currently porting a large project from Ada-95 in ObjectAda to GNAT 17, first on Linux and later on W7. I've managed to compile the all files, but gnatbind hits a stack overflow. How do I get more information about the cause?
>
> Regards,
> Petter
>

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

* Re: gnatbind get stack overflow, how do I investigate the cause?
  2017-03-30 16:22 ` Per Sandberg
@ 2017-03-31  5:10   ` Petter Fryklund
  2017-03-31 18:13     ` Anh Vo
  0 siblings, 1 reply; 7+ messages in thread
From: Petter Fryklund @ 2017-03-31  5:10 UTC (permalink / raw)


Den torsdag 30 mars 2017 kl. 18:22:09 UTC+2 skrev Per Sandberg:
> Hi
> 
> I did the same journey a on our system many years ago, and it was 
> "interesting" since we found a whole bunch of serious bugs just by 
> follow up on warnings and later enable all validity checks.
> 
> You might increase the stacksize with:
>    -dnn[k|m] Default primary stack size = nn [kilo|mega] bytes
>    -Dnn[k|m] Default secondary stack size = nn [kilo|mega] bytes
> from "gnatbind -h"
> 
> And expect a bunch of elaboration circles that needs to be broken out by 
> factoring out generics and separates into child packages.
> 
> And as Anh mentions ask AdaCore, since they usually gives good answers.
> 
> /Per
> 
> 
> Den 2017-03-30 kl. 15:00, skrev Petter Fryklund:
> > Hi all,
> >
> > after a couple of years with C# I'm back! I am currently porting a large project from Ada-95 in ObjectAda to GNAT 17, first on Linux and later on W7. I've managed to compile the all files, but gnatbind hits a stack overflow. How do I get more information about the cause?
> >
> > Regards,
> > Petter
> >

Hi again,
Isn't -d for the produced output? it is the gnatbind itself that suffers from Storage_Error hinting at stack overflow.

The output from gnatbind is:
[gprbind]     <main>.bexch
[Ada]         <main>.ali

raised STORAGE_ERROR : stack overflow or erroneous memory access
gprbind: invocation of gnatbind failed
gprbuild: unable to bind <main>.adb

Anh Vo: yes we have support, I or the person responsible for tools will create a ticket ASAP. In the meanwhile I'd like to gather information.

Regards,
Petter 

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

* Re: gnatbind get stack overflow, how do I investigate the cause?
  2017-03-31  5:10   ` Petter Fryklund
@ 2017-03-31 18:13     ` Anh Vo
  2017-04-03  5:26       ` Petter Fryklund
  0 siblings, 1 reply; 7+ messages in thread
From: Anh Vo @ 2017-03-31 18:13 UTC (permalink / raw)


On Thursday, March 30, 2017 at 10:11:00 PM UTC-7, Petter Fryklund wrote:
> Hi again,
> Isn't -d for the produced output? it is the gnatbind itself that suffers from Storage_Error hinting at stack overflow.
> 
> The output from gnatbind is:
> [gprbind]     <main>.bexch
> [Ada]         <main>.ali
> 
> raised STORAGE_ERROR : stack overflow or erroneous memory access
> gprbind: invocation of gnatbind failed
> gprbuild: unable to bind <main>.adb
 
Did the problem occur under Linux or W7 or both? I assume that your are porting host to host, not host to cross target, right?

Anh Vo

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

* Re: gnatbind get stack overflow, how do I investigate the cause?
  2017-03-31 18:13     ` Anh Vo
@ 2017-04-03  5:26       ` Petter Fryklund
  0 siblings, 0 replies; 7+ messages in thread
From: Petter Fryklund @ 2017-04-03  5:26 UTC (permalink / raw)


Den fredag 31 mars 2017 kl. 20:13:13 UTC+2 skrev Anh Vo:
> On Thursday, March 30, 2017 at 10:11:00 PM UTC-7, Petter Fryklund wrote:
> > Hi again,
> > Isn't -d for the produced output? it is the gnatbind itself that suffers from Storage_Error hinting at stack overflow.
> > 
> > The output from gnatbind is:
> > [gprbind]     <main>.bexch
> > [Ada]         <main>.ali
> > 
> > raised STORAGE_ERROR : stack overflow or erroneous memory access
> > gprbind: invocation of gnatbind failed
> > gprbuild: unable to bind <main>.adb
>  
> Did the problem occur under Linux or W7 or both? I assume that your are porting host to host, not host to cross target, right?
> 
> Anh Vo

Hi again,

the error occurred on Linux. I've yet to try on W7. We are porting host to host and also some cross to host, since ObjectAda where used as cross to VxWorks as well. I now have a ticket at AdaCore:  [Q331-004] #1935.

Regards,
Petter

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

end of thread, other threads:[~2017-04-03  5:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30 13:00 gnatbind get stack overflow, how do I investigate the cause? Petter Fryklund
2017-03-30 13:51 ` Anh Vo
2017-03-30 14:30 ` Dmitry A. Kazakov
2017-03-30 16:22 ` Per Sandberg
2017-03-31  5:10   ` Petter Fryklund
2017-03-31 18:13     ` Anh Vo
2017-04-03  5:26       ` Petter Fryklund

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