[xsd-users] Seg Fault

Boris Kolpackov boris at codesynthesis.com
Mon Feb 4 13:12:33 EST 2008


Hi Ryan,

Prather, Ryan C SSgt USAF AFSPC SYAG/SED <Ryan.Prather at peterson.af.mil> writes:

> I am getting a segmentation fault when trying parse a particular
> document.  The last executable line is in the following Xerces
> functions:
>
> inline SAX2XMLReader * XMLReaderFactory::createXMLReader( MemoryManager
> *const manager, XMLGrammerPool *const gramPool)
> {
> 	return (SAW2XMLReader *)(new (manager)
> SAX2XMLReaderImpl(manager, gramPool));
> }

One fairly common cause of errors that involve memory allocation in
Xerces-C++ is the uninitialized runtime. If you are initializing
it yourself, then can check that it is not terminated before you
call your last parser?

Also, if your application is multi-threaded and you don't initialize
the Xerces-C++ runtime, then you most likely should in order to avoid
race conditions (which could also cause the above error). If you make
this change, also make sure you pass the dont_initialize flag to the
document's parse() functions:

http://codesynthesis.com/projects/xsd/documentation/cxx/parser/guide/#7.1

Boris




More information about the xsd-users mailing list