Re: Strange Runtime Problem

Reid Spencer <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
See below ...

Anmol Bhasin wrote:
> Hello all,
> 
> I have been using the EXPAT for a while, however this time around I am 
> facing a stange error.
> I am using the expat library in the dynamic link mode, with my code just 
> including expat.h.
> 
> This is a small C++ Program with once class which is essentially using 
> expat as the parser for some XML documents.  Here is a snippet of my ant 
> file :
> 
>  <target name="CorpusReader" depends="init">
>            <echo>Building Object for CorpusReader ...</echo>
>           <exec executable="g++">
>               <arg line="-g -I${include} -I${expat_inc} -L${lib_expat} 
> -lexpat -o build/CorpusReader"/>
>             <arg file="${src}/CorpusReader.cpp"/>
>           </exec>
> </target>
> 
> 
> where lib_expat is <expat_dir>/lib
> and expat_inc is <expat_dir>/include
> 
> The compile goes fine, however during the running of the Program I get a 
> SEG FAULT at the point where the first chunk of my data is sent across 
> XML_Parse. The GDB reads
> 
> Parsing 
> File../trec/software/ConceptGraphBuilder/transitions/data/temp/layers.xml
> 
> Program received signal SIGSEGV, Segmentation fault.

This means you de-referenced a null, or otherwise invalid pointer.

> 0x4001a798 in XML_GetBuffer (parser=0x0, len=1024) at lib/xmlparse.c:1465

Lo and behold, you'ved called XML_GetBuffer and passed in a null pointer as the 
parser structure.  Review your code and pass in the correct parser address. Did 
you create one?

> 1465    lib/xmlparse.c: No such file or directory.
>         in lib/xmlparse.c
> Current language:  auto; currently c
> 
> I can't figure out for nuts the problem. Any help would be appreciated.
> 
> regards,
> Anmol
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.