comp.lang.ada
 help / color / mirror / Atom feed
From: Jano <nono@celes.unizar.es>
Subject: Stack overflow using Xml/Ada
Date: Tue, 20 Jul 2004 23:25:26 +0200
Date: 2004-07-20T23:25:26+02:00	[thread overview]
Message-ID: <MPG.1b67ac2ed32252929897d5@news.individual.net> (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?



             reply	other threads:[~2004-07-20 21:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-20 21:25 Jano [this message]
2004-07-21  7:37 ` Stack overflow using Xml/Ada Emmanuel Briot
2004-07-21  8:02   ` Jano
2004-07-21  9:44   ` Georg Bauhaus
replies disabled

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