[xmlsec] About xmlParseInNodeContext() in libxml2.

Aleksey Sanin aleksey at aleksey.com
Tue Sep 14 22:57:28 PDT 2004


Do you do "unlink" node before freeing it? If you do then
it sounds like a libxml2 bug but it's hard to say something
definite without a reproducible test case. Can you provide
a *small* example that demonstrates the problem?

Aleksey

StackWD(hotmail) wrote:
> Hi!
> 
> Let me tell you more details. I parse from a buffer, such as "<xsi:getsumReturn xsi:type="xsd:int">9</xsi:getsumReturn>". 
> If the content of this node is a single character or a single digital or a serials of blank, then use xmlFreeNode() to free the node that via function xmlParseInNodeContext() , the result will be Segmentation fault. I debug into xmlFreeNode() and trace to DICT_FREE(cur->content), the cur->content is 9 and execute xmlFree((char *)(str)) result in the error of Segmentation fault. If the content of this node is NOT a single character or a single digital or a serials of blank, there will be right all.
> I think whether I omit something or other? I need your help. Thx for lot.
> 
> 
> 
>>Try to run the program under gdb or valgrind and find out
>>what causes the crash. BTW, did you call xmlSetTreeDoc?
>>
>>Aleksey
>>
>>
>>
>>StackWD(hotmail) wrote:
>>
>>
>>>Hi!
>>>
>>>    I have a question about function xmlParseInNodeContext() in libxml2.6.13. After I finished call it and get a parsed XML chain and add it to the doc, then there is an error Segmentation fault when I use xmlFreeDoc() to free the doc. I compiled in Red Hat 9 and need some advice from you. Thx!
>>>_______________________________________________
>>>xmlsec mailing list
>>>xmlsec at aleksey.com
>>>http://www.aleksey.com/mailman/listinfo/xmlsec
> 
> 
> 
>         StackWD(hotmail)
>         StackWD at hotmail.com
>           2004-09-15
> 
> _______________________________________________
> xmlsec mailing list
> xmlsec at aleksey.com
> http://www.aleksey.com/mailman/listinfo/xmlsec



More information about the xmlsec mailing list