Bug#239813: libglib2.0-0: heap corruption problems with glib

Krisztian KOVACS Krisztian KOVACS <hidden@balabit.hu>, 239813@bugs.debian.org
Wed, 24 Mar 2004 13:49:26 +0100


This is a multi-part MIME message sent by reportbug.

--===============2083835391==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: libglib2.0-0
Version: 2.2.3-1
Severity: important
Tags: patch

GLib 2.2 (and possibly older versions) contains a bug which causes random
heap corruptions in multithreaded programs. It has been reported to the GLib
developers, and has been fixed in the GLib CVS. (GLib bug #127096) GLib 2.4
has this already fixed.

The GLib CVS diff is available at
http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvs/gnome&subdir=glib/glib&command=DIFF_FRAMESET&file=gmem.c&rev2=1.43&rev1=1.42

This problem renders the zorp package quite unstable under heavy load, and
possibly causes problems with other GLib-based multithreaded software.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.4
Locale: LANG=C, LC_CTYPE=hu_HU

Versions of packages libglib2.0-0 depends on:
ii  libc6                       2.3.2.ds1-11 GNU C Library: Shared libraries an

-- no debconf information

--===============2083835391==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="glib-memchunk-race.diff"

--- glib-2.0.1/glib/gmem.c.old	Sun Nov 16 12:04:45 2003
+++ glib-2.0.1/glib/gmem.c	Sun Nov 16 12:05:03 2003
@@ -719,12 +719,12 @@
       g_free (temp_area);
     }
   
+  g_mutex_lock (mem_chunks_lock);
   if (mem_chunk->next)
     mem_chunk->next->prev = mem_chunk->prev;
   if (mem_chunk->prev)
     mem_chunk->prev->next = mem_chunk->next;
   
-  g_mutex_lock (mem_chunks_lock);
   if (mem_chunk == mem_chunks)
     mem_chunks = mem_chunks->next;
   g_mutex_unlock (mem_chunks_lock);

--===============2083835391==--