2.10.0 htmlCreatePushParserCtxt not working in threads
htmlCreatePushParserCtxt doesn't work in threads since 2.10 with NULL as the first parameter - htmlParseChunk doesn't return any errors but the document at the end is NULL
If I recompile with 'legacy mode' enabled, it works. If I manually invoke htmlDefaultSAXHandlerInit in all my threads, it works too
I notice that xmlInitParser
invokes htmlDefaultSAXHandlerInit()
to initialize htmlDefaultSAXHandler
, but xmlInitializeGlobalState
does this:
#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
#endif
and has no other htmlDefaultSAXHandler
initialization
So outside of legacy mode, htmlDefaultSAXHandler
doesn't get initialized for anything but the main thread. I think xmlInitializeGlobalState
should have invoked htmlDefaultSAXHandlerInit
too ?
There's a later #ifdef LEGACY
-ed call to initxmlDefaultSAXHandler in xmlInitializeGlobalState, I haven't checked yet whether that would be giving similar problems