tagoh/liblangtag — pull request #7 by stbergmann (2012-09-20 15:35:45+00:00)
Title: Do not call xmlCleanupParser from liblangtag

Despite its name, it is a cleanup function for libxml2 that must only be called
when the process as a whole no longer needs libxml2. Calling it from a library
like liblangtag is not appropriate (just like liblangtag does not call
xmlInitParser, either).

In LibreOffice, this caused confusion about pthread keys for thread-local
storage (xmlCleanupParser calls pthread_key_delete, but apparently if libxml2 is
later used by unrelated code in LibreOffice again, it still uses the stale key,
and if that key is now reused via an unrelated pthread_key_create, arbitrary
crashes happen during thread termination in pthread's __nptl_deallocate_tsd),
cf. "Do not call xmlCleanupParser from
liblangtag."