After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 120870 - crash in xmlMutexUnlock
crash in xmlMutexUnlock
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
2.5.8
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
: 121576 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-08-27 20:27 UTC by Björn Torkelsson
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Björn Torkelsson 2003-08-27 20:27:58 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
Comment 1 Daniel Veillard 2003-08-28 07:54:18 UTC
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
Comment 2 Daniel Veillard 2003-09-06 10:49:20 UTC
*** Bug 121576 has been marked as a duplicate of this bug. ***
Comment 3 Daniel Veillard 2003-09-13 20:47:04 UTC
  This should be closed by the release of libxml2-2.5.11,

    thanks!
                                                                     
          
Daniel