[xml] memory corruption on copying XML!?

I got a problem when using the xmlCopyNode() function recursively. It 
does leak memory (according to Purify) or does crash with an Access 
Violation somewhere in xmlStaticCopyNode() when trying to do a 
xmlStrdup on the members of a xmlNode of the type XML_TEXT_NODE, 
which represents the content of a XML_ATTRIBUTE_NODE.

I ran into this problem in a simple application (with Purify memory 
leak reports, unfortunately I didn't get a simple text case together) 
and in a program, that gives a xmlNodePtr to an DLL, that adds more 
nodes to it (there happened the exceptions...sometimes).

The problem is, that it does save fine and when I dump the node with 
xmlNodeDump, save it and look at it, it's a proper XML without any 
error in it. And saving it to a string and reloading it and then 
trying to copy it is also fine.

Is there a way I could do a "memory dump" of an xmlNodePtr and reload 
it properly into a xmlNodePtr again and see, if I can reproduce it 
with that mirrored version of the problematic node? So, somebody else 
could also try and maybe look into the problem. I am quite clueless.

I tried it with libxml2-2.6.7 and libxml2-2.6.11.
My enviorment is Windows 2000 SP2 with MSVC6 SP5.

Thanks in advance for any help.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]