Heads-Up: Beware of xmlCleanupParser() when your package links against libxml2

Ian Kent raven at themaw.net
Wed Jan 13 07:29:24 UTC 2010


On 01/13/2010 09:07 AM, Tom Lane wrote:
> Lennart Poettering <mzerqung at 0pointer.de> writes:
>> if you have code that links against libxml2 and calls
>> xmlCleanupParser() please verify that your project does that at the
>> appropriate place (i.e. immediately before exiting, and only once).
> 
> Why exactly is this a misuse, and not libxml2's bug to fix?  There's
> certainly nothing in their documentation suggesting that there's
> such a requirement.

libxml2 also doesn't use pthreads Thread Specific Keys correctly either
which can lead to segv if the library is unloaded prior to the threaded
application exiting.

Ian


More information about the devel mailing list