[xsd-users] Streaming and Xerces-C++ runtime initialization

Christian Sell christian at gsvitec.com
Thu Feb 12 10:36:03 EST 2015


Hello,
 
I have seen something similar recently when dealing with Xerces in a different
context:
 
when you call XMLPlatformUtilities::Terminate, Xerces's default MemoryManager
gets killed. However, any XMLString (and other) objects you or anyone may have
created locally only go out of scope after that call, and their destructors try
to talk to the default MemoryMamanger as well -> bang!
 
This is Xerces's strange memory mamangement architecture. In my standalone
program, I simply left out the Terminate call and all was well.
 
regards,
Christian

> Yury Zaytsev <yury.zaytsev at traveltainment.de> hat am 12. Februar 2015 um 15:44
> geschrieben:
>
>
> Hi,
>
> I'm trying to adopt the streaming example to my needs (that is re-use
> serializer.cxx/serializer.hxx directly in my project), so that I don't have to
> hold large collections of sub-elements in memory, but rather write them to
> disk as soon as they are processed. Unfortunately, I'm getting a segfault upon
> the finalization of the runtime. If you replace the original driver.cxx of the
> streaming example with the trivial code below, same sort of segfault happens.
> I'm using C++/Tree mapping with serialization functions only, and don't need
> parsing at all. Could you please hint me at where the problem might lie? I'm
> clearly missing something obvious. Many thanks!
>
> int
> main (int argc, char* argv[])
> {
>
> // We need to initialize the Xerces-C++ runtime because we are doing
> // the XML-to-DOM parsing ourselves.
> //
> xercesc::XMLPlatformUtils::Initialize ();
>
> serializer s;
>
> xercesc::XMLPlatformUtils::Terminate ();
>
> }
>
> Dr. Yury V. Zaytsev
> Senior Software Developer
> IT Data Production
>
> TravelTainment GmbH
> Carlo-Schmid-Straße 12
> 52146 Würselen/Aachen, Germany
> yury.zaytsev at traveltainment.de
>
> http://www.traveltainment.de
>
> Amtsgericht Aachen, HRB 15873
> Geschäftsführer: Bernhard Steffens (Vorsitzender)
> Dr. Oliver Rengelshausen
>
>
>
>                 
>
>
>


More information about the xsd-users mailing list