FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bizzare Segfaults (a little help please)

 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
teqdruid



Joined: 11 May 2004
Posts: 390
Location: UMD

PostPosted: Thu Nov 02, 2006 3:25 pm    Post subject: Bizzare Segfaults (a little help please) Reply with quote

I've been going through my (still beta) Mango code testing it, and I'm running into a really weird issue with my SAX XML parser. For small and medium files (I tested a 4mb file) it works great. When I throw a really big file at it, it SEGVs. The really weird part is that when I throw the same file at the same program multiple times, it segvs in different places, according to GDB.

Does anybody have any idea why this might happen? I'd appreciate if some people could try this out and let me know if they can replicate the issue, and help track it down.

Here are two programs I've been using. This first one generates a large XML file:
Code:
module mango.test.genBigXml;

private import   mango.io.Buffer,
      mango.io.FileConduit,
      mango.io.Stdout;

private import   mango.text.model.UniString,
      mango.text.String;

private import   mango.convert.Unicode;

private import mango.xml.sax.DefaultSAXHandler,
  mango.xml.sax.model.ISAXParser,
  mango.xml.sax.model.ISAXHandler,
  mango.xml.sax.parser.teqXML;


void main(char[][] args)
{
   if (args.length != 2)
   {
      Stdout("Usage: "c)(args[0])(" <filename.xml>"c)(CR);
      return;
   }

   TeqXMLWriter w = new TeqXMLWriter();
   auto TextFileConduit fc = new TextFileConduit(args[1], FileStyle.ReadWriteCreate);
   w.startDocument(new Buffer(fc), Unicode.UTF_8);
   String me = new String("mainElement");
   String e = new String("sampleElement");
   String d = new String("short amount of cdata");
   String k = new String("key");
   String v = new String("value");

   w.startElement(me);

   for (int j=0; j<10000; j++)
   {
      for (int i=0; i<50; i++)
      {
         w.startElement(e);
         w.characterData(d, CDataStatus.All);
      }
      for (int i=0; i<50; i++)
      {
         w.endElement(e);
      }
   }

   for (int i=0; i<500000; i++)
   {
      w.startElement(e);
      w.characterData(d, CDataStatus.All);
      w.endElement(e);
   }
   w.endElement(me);
   w.endDocument();
}


This next one is the test program I've been running:
Code:
module mango.test.timedXmlRead;

private import   mango.io.Buffer,
      mango.io.FileConduit,
      mango.io.Stdout;

private import   mango.text.model.UniString,
      mango.text.String;

private import   mango.convert.Type;

private import   mango.xml.sax.DefaultSAXHandler,
      mango.xml.sax.model.ISAXParser,
      mango.xml.sax.model.ISAXHandler,
      mango.xml.sax.parser.teqXML;

private import mango.sys.System;


void main(char[][] args)
{
   if (args.length != 2)
   {
      Stdout("Usage: "c)(args[0])(" <filename.xml>"c)(CR);
      return;
   }

   ISAXReader!() reader = new TeqXMLReader!()();
   TextFileConduit file = new TextFileConduit(args[1], FileStyle.ReadExisting);
   DefaultSAXHandler!() handler = new DefaultSAXHandler!()();

   ulong ms = System.getMillisecs();
   reader.parse(file, handler);
   ulong ms2 = System.getMillisecs();
   Stdout("Total time: "c)(ms2-ms)(CR);
}


Any help would be appreciated.

~John
Back to top
View user's profile Send private message Send e-mail AIM Address
davidl



Joined: 17 Aug 2006
Posts: 27

PostPosted: Mon Nov 06, 2006 6:22 am    Post subject: Reply with quote

i think should be something related to GC.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group