HaXml, emeory usage and segmentation fault
Dmitry Astapov
adept@umc.com.ua
26 Oct 2001 18:06:01 +0300
I have Hugs version February 2001, HaXml version 1.02 and this program:
> module Main where
> import XmlLib
>
> main = processXmlWith (invoices `o` tag "invoice")
>
> invoices =
> html
> [ hhead
> [ htitle [ ("Invoices"!)] ],
> hbody
> [ customers `o` children `with` tag "customer" ]
> ]
>
> customers =
> cat
> [ h2 [ ("Customer"!) ],
> contracts `o` children `with` tag "contract"
> ]
>
> contracts =
> cat
> [ h3 [ ("Id:"!), ("id"?)],
> hpara [ ("Access:"!), keep /> txt ] `o` children `with` tag "access",
> hpara [ ("Intl:"!), keep /> txt] `o` children `with` tag "inter"
> ]
This program can process following file:
<?xml version='1.0'?>
<invoice>
<customer>
<contract id='1'>
<access>1</access>
<inter>1</inter>
</contract>
<contract id='2'>
<access>2</access>
<inter>2</inter>
</contract>
</customer>
</invoice>
(I use "runhugs translate.hs invoice.xml invoice.html")
Now increase amount of <customer>s to 10, and amount of <contract>s within
each customer to 999. After that, "runhugs -h6000000 translate.hs
invoice.xml invoice.html" dumps core :(
What's the reason: bug in hugs, bug in HaXml, or my own bad programming
techniques?
--
Dmitry Astapov //ADEpt E-mail: adept@umc.com.ua
GPG KeyID/fprint: F5D7639D/CA36 E6C4 815D 434D 0498 2B08 7867 4860 F5D7 639D