On Sat, Oct 30, 2004 at 09:20:46PM -0400, [EMAIL PROTECTED] wrote: > > I'm seeing a crash when an IGXMLScanner held statically is destroyed. > > I'm using Xerces 2.3.0 on linux compiled with gcc 3.2. > > Can you elaborate on what you mean by "held statically?" You shouldn't > have any static instance of Xerces-C classes, as they cannot be created > before the library is initialized with PlatformUtils::Initialize().
Hi, The Xerces objects are held by pointer (basically a singleton), and are only constructed after XMLPlatformUtils::Initialize() has been called, so I don't think this is the problem. > > I don't know if this is the cause of the crash, but it seems that the > > wrong type of delete is called on the memory in fRawAttrList. It's > > allocated using placement new with fMemoryManager (in buildAttList), > > but it's deleted with the normal delete operator (in ~RefVectorOf), > > which doesn't seem correct. I'm not customising the memory management > > in any way. > > All classes that derive from XMemory use "placement" new with a > MemoryManager instance, and the normal delete expression. The call stack > you posted looks fine. But is this the correct behaviour? I think the destructor for the object should be called, then the operator delete from the MemoryManager interface called explicitly. > Have you tried using a newer version of Xerces-C > to see if the problem persists? Not yet, as it involves rebuilding many dependencies, but I will give it a try at some point. > One possibility is you've already shut down the library, through > PlatformUtils::Terminate(), before you've freed this IGXMLScanner > instance, although I would expect a different stack trace, if that were > the case. We never call XMLPlatformUtils::Terminate, because we can't guarantee it's going to be called in the right order as you say. Thanks for the suggestions, Graham. -- Graham Bennett --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]