comp.lang.ada
 help / color / mirror / Atom feed
* stack frame too large
@ 2000-11-10  0:00 wayne lydecker
  2000-11-11  0:00 ` David Starner
  2000-11-11  0:00 ` Marc A. Criley
  0 siblings, 2 replies; 6+ messages in thread
From: wayne lydecker @ 2000-11-10  0:00 UTC (permalink / raw)


We are experiencing a rather severe error using Alsys on HP.
Evidently we are overflowing a stack frame which is causing
a corrupted heap.  Because I am playing with GNAT, I decided
to see if I can get more information using that compiler while
using the -fstack-check switch.  GNAT does indeed complain:

    frame size too large for reliable stack checking
    try reducing the number of local variables

I have been able to distill the error down to a very fundamental
set of code.  If I call a procedure that calls a function to
return an array of 2000 integers, I get the error.  1000
integers works fine.  If anyone can shed light on this unusual
problem, I would be most grateful.  I compile it with:

gnatmake -g test -cargs -fstack-check 

Here's the exact warning from GNAT:

fifo_queue.adb: In function `fifo_queue__deque':
fifo_queue.adb:11: warning: frame size too large for reliable stack checking
fifo_queue.adb:11: warning: try reducing the number of local variables

Here's the code (suitable for gnatchop).

Thanks,

-- Wayne.

package Fifo_Queue is

  type Data_Type is array (1..2000) of Integer;

  procedure Deque (Data : out Data_Type);

end Fifo_Queue;

package body Fifo_Queue is
  My_Data : Data_Type := (others => 0);

  function Deque return Data_Type is
  begin 
    return My_Data;
  end Deque;

  procedure Deque (Data  : out Data_Type) is
  begin
    Data := Deque; -- Line 11 as reported in warning.
  end Deque;

end Fifo_Queue;

with fifo_queue;
procedure test is
begin
  null;
end;




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

end of thread, other threads:[~2000-11-12  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-10  0:00 stack frame too large wayne lydecker
2000-11-11  0:00 ` David Starner
2000-11-11  0:00 ` Marc A. Criley
2000-11-11  0:00   ` Wayne Lydecker
2000-11-11  0:00     ` Jeff Creem
2000-11-12  0:00     ` Marc A. Criley

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