comp.lang.ada
 help / color / mirror / Atom feed
* Stack overflow using Xml/Ada
@ 2004-07-20 21:25 Jano
  2004-07-21  7:37 ` Emmanuel Briot
  0 siblings, 1 reply; 4+ messages in thread
From: Jano @ 2004-07-20 21:25 UTC (permalink / raw)


Hi,

I'm using the excellent Xml/Ada library to parse a file (incidentally, 
created too with Xml/Ada). The problem is when I try to parse it back 
into memory, since I get a stack overflow when calling the

Input_Sources.File.Open

procedure.

I've tracked it a bit and the problem seems to be this declaration in 
input_sources-file.adb/Fast_Read

type Fixed_String is new String (Buf'Range);
package Dir_Fast is new Ada.Direct_IO (Fixed_String);

Where Buf'Range is the file size.

Further inspecting the Direct_IO gnat implementation, it seems that 
inside the instance a buffer it's declared in the stack, of 
Fixed_String'Size:

Zeroes : System.Storage_Elements.Storage_Array := 
   (1 .. System.Storage_Elements.Storage_Offset (Bytes) => 0);
-- Buffer used to fill out partial records.

Since my file is some 3MB in size, and the stack I've allocated is 2MB, 
it fails.

I find too restrictive that the file to parse has to be below stack 
size, so I'm not considering the possibility of increasing stack size as 
a solution (furthermore I've never succeed to get over 2MB stack size in 
linux).

Has anyone faced this problem? If so, how did you solved it?

Thanks in advance,

Alex.

P.s: BTW, is there some mailing list related to this library?



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

end of thread, other threads:[~2004-07-21  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-20 21:25 Stack overflow using Xml/Ada Jano
2004-07-21  7:37 ` Emmanuel Briot
2004-07-21  8:02   ` Jano
2004-07-21  9:44   ` Georg Bauhaus

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