GNOME Bugzilla – Bug 326473
xmlOutputBufferClose() crashes
Last modified: 2006-01-10 16:17:56 UTC
Sometimes (less than one in thousand) call to xmlOutputBufferClose() crashes. We use it like this: m_enHandler = xmlGetCharEncodingHandler(XML_CHAR_ENCODING_8859_1); m_xml_buffer = xmlOutputBufferCreateIO(Callback, CloseCallback, 0, m_enHandler); m_xml_buffer->context = (void*)&sPrintableEncodedAsciiText; // ... m_xmlString = xmlParseDoc() // ... m_result = xsltApplyStylesheet(xxx, m_xmlString, 0); // ... xsltSaveResultTo(m_xml_buffer, m_result, ...); // ... xsltCleanupGlobals(); // ... xmlCleanupParser(); xmlOutputBufferClose(m_xml_buffer); Backtrace: (gdb) bt full
+ Trace 65101
1/ check with the latest release 2/ no idea what is at line 2092 in your version of encoding.c 3/ the free() can come from a number of places 4/ you may hit reentrancy problems in threaded apps 5/ your code may also so something stupid somewhere else generating this There is no obvious error in libxml2 code. There is no way for me to reproduce your problem Minimize and reproduce and then I will fix it if it's libxml2 fault ! Daniel
Oh yeah You are doing something stupid !!! xmlCleanupParser(); would you mind checking the documentation for this function ??? Why are you calling this while you are not done with libxml2 usage ? Especially when doing this thousands of time. NOTABUG ! Daniel