GNOME Bugzilla – Bug 120870
crash in xmlMutexUnlock
Last modified: 2009-08-15 18:40:50 UTC
When trying out the SyncML plugin of multisync (see http://multisync.sf.net) I got repeatable crashes. After some debugging it turned out to be that xmlMutexUnlock somewho was passed a NULL pointer, and crashed. I'm somewhat suspicious that there is a bug somewhere else, as xmlMutexUnlock should probably not be able to get a NULL pointer under the cirumstances when it crashes, but is is probably a good idea to "guard" the xmlMutexUnlock against NULL pointers anyway. Patch at the end of mail! For a backtrace check the Debian bugreport of the issue: http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=207014 /torkel --- libxml2-2.5.10/threads.c 2003-08-08 15:18:52.000000000 +0200 +++ libxml2-2.5.10.mod/threads.c 2003-08-27 09:25:28.000000000 +0200 @@ -172,6 +172,8 @@ void xmlMutexUnlock(xmlMutexPtr tok ATTRIBUTE_UNUSED) { + if (tok == NULL) + return; #ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&tok->lock); #elif defined HAVE_WIN32_THREADS
Okay, applied that doesn't sound bad, but the real problem is that someone forgot to call the initialization of the library before using it for threaded operations ! Make sure that xmlInitParser() has been called. The patch cures the effect not the cause, the error is in the user level. Daniel
*** Bug 121576 has been marked as a duplicate of this bug. ***
This should be closed by the release of libxml2-2.5.11, thanks! Daniel