• Mike Hommey's avatar
    Fix a potential segfault due to weak symbols on pthreads · e6f05099
    Mike Hommey authored
    In xmlInitParser, both __xmlGlobalInitMutexLock and xmlInitGlobals are
    called before xmlInitThreads, and both use pthread symbols.
    __xmlGlobalInitMutexLock does so directly, without checking if the symbol
    exists, and xmlInitGlobals calls xmlNewMutex, which correctly depends on
    libxml_is_threaded... except libxml_is_threaded is still -1 by then...
    And again, when releasing the global mutex in __xmlGlobalInitMutexUnlock,
    the pthread function is called directly.
    The patch changes the initialization order and make sure the functions
    are available before calling them
threads.c 26.3 KB