Do not call xmlCleanupParser from liblangtag #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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. <http://cgit.freedesktop.org/libreoffice/core/commit/
?id=5e6c595e9d698caf23ae68d38b9cab30ff9c9b94> "Do not call xmlCleanupParser from
liblangtag."