Bug#332182: libgtk2.0-0: valgrind reports errors inside gtk/gdk/glib

Jason Dorje Short jdorje at users.sf.net
Wed Oct 5 00:34:01 UTC 2005


Package: libgtk2.0-0
Version: 2.6.10-1
Severity: important


When running Freeciv 2.0 (currently in debian unstable, also downloadable
from http://freeciv.org/) under valgrind, I get a number of warnings and
errors inside the glib and gdk libraries.  Some of these are actual errors
that look like they could cause a crash under the right circumstances.

The natural tendancy is probably to blame the calling code for these
errors rather than the library, but I don't see how this could be the case
here.  In fact several of the major bugs (an invalid read inside
gtk_parse_args) can be reproduced using the program below.  Other bugs aren't
included here but the full output of the valgrind runs can be found at

  Valgrind run on bug.c:
    http://freeciv.org/~jdorje/gtk-bug.txt
  Valgrind run on Freeciv 2.0 (compiled from source):
    http://freeciv.org/~jdorje/output-2.0


/* Copy this code into a file bug.c.

   Compile as
      gcc -Wall -g `pkg-config --cflags --libs gtk+-2.0` bug.c -o bug
   Run as
      valgrind --num-callers=50 ./bug
 */

#include <gtk/gtk.h>

int main(int argc, char **argv)
{
  gtk_init(&argc, &argv);

  return 0;
}

==12814== Invalid read of size 4
==12814==    at 0x1B8F4FB7: (within /lib/ld-2.3.5.so)
==12814==    by 0x1B8E89C1: (within /lib/ld-2.3.5.so)
==12814==    by 0x1B8EA51A: (within /lib/ld-2.3.5.so)
==12814==    by 0x1BEC49F0: dl_open_worker (dl-open.c:259)
==12814==    by 0x1B8EF026: (within /lib/ld-2.3.5.so)
==12814==    by 0x1BEC52F4: _dl_open (dl-open.c:577)
==12814==    by 0x1BEC67D4: do_dlopen (dl-libc.c:80)
==12814==    by 0x1B8EF026: (within /lib/ld-2.3.5.so)
==12814==    by 0x1BEC6791: dlerror_run (dl-libc.c:42)
==12814==    by 0x1BEC6876: __libc_dlopen_mode (dl-libc.c:153)
==12814==    by 0x1BEA4E2E: __nss_lookup_function (nsswitch.c:344)
==12814==    by 0x1B911F39: init_nss_interface (compat-pwd.c:92)
==12814==    by 0x1B912B83: _nss_compat_getpwuid_r (compat-pwd.c:1076)
==12814==    by 0x1BE63888: getpwuid_r@@GLIBC_2.1.2 (getXXbyYY_r.c:207)
==12814==    by 0x1BDA4C74: (within /usr/lib/libglib-2.0.so.0.800.2)
==12814==    by 0x1BDA66AC: g_get_home_dir (in /usr/lib/libglib-2.0.so.0.800.2)
==12814==    by 0x1BA6096C: ??? (gtkrc.c:441)
==12814==    by 0x1BA653F9: _gtk_rc_init (gtkrc.c:670)
==12814==    by 0x1BA2ABAE: ??? (gtkmain.c:534)
==12814==    by 0x1BD8B0A9: g_option_context_parse (in /usr/lib/libglib-2.0.so.0.800.2)
==12814==    by 0x1BA2AE52: gtk_parse_args (gtkmain.c:714)
==12814==    by 0x1BA2AE8F: gtk_init_check (gtkmain.c:745)
==12814==    by 0x1BA2AEDF: gtk_init (gtkmain.c:783)
==12814==    by 0x8048543: main (bug.c:13)
==12814==  Address 0x1C145C14 is 28 bytes inside a block of size 31 alloc'd
==12814==    at 0x1B8FF8A6: malloc (vg_replace_malloc.c:149)
==12814==    by 0x1B8E9FE8: (within /lib/ld-2.3.5.so)
==12814==    by 0x1B8EA5E1: (within /lib/ld-2.3.5.so)
==12814==    by 0x1BEC49F0: dl_open_worker (dl-open.c:259)
==12814==    by 0x1B8EF026: (within /lib/ld-2.3.5.so)
==12814==    by 0x1BEC52F4: _dl_open (dl-open.c:577)
==12814==    by 0x1BEC67D4: do_dlopen (dl-libc.c:80)
==12814==    by 0x1B8EF026: (within /lib/ld-2.3.5.so)
==12814==    by 0x1BEC6791: dlerror_run (dl-libc.c:42)
==12814==    by 0x1BEC6876: __libc_dlopen_mode (dl-libc.c:153)
==12814==    by 0x1BEA4E2E: __nss_lookup_function (nsswitch.c:344)
==12814==    by 0x1B911F39: init_nss_interface (compat-pwd.c:92)
==12814==    by 0x1B912B83: _nss_compat_getpwuid_r (compat-pwd.c:1076)
==12814==    by 0x1BE63888: getpwuid_r@@GLIBC_2.1.2 (getXXbyYY_r.c:207)
==12814==    by 0x1BDA4C74: (within /usr/lib/libglib-2.0.so.0.800.2)
==12814==    by 0x1BDA66AC: g_get_home_dir (in /usr/lib/libglib-2.0.so.0.800.2)
==12814==    by 0x1BA6096C: ??? (gtkrc.c:441)
==12814==    by 0x1BA653F9: _gtk_rc_init (gtkrc.c:670)
==12814==    by 0x1BA2ABAE: ??? (gtkmain.c:534)
==12814==    by 0x1BD8B0A9: g_option_context_parse (in /usr/lib/libglib-2.0.so.0.800.2)
==12814==    by 0x1BA2AE52: gtk_parse_args (gtkmain.c:714)
==12814==    by 0x1BA2AE8F: gtk_init_check (gtkmain.c:745)
==12814==    by 0x1BA2AEDF: gtk_init (gtkmain.c:783)
==12814==    by 0x8048543: main (bug.c:13)

If this is useful in tracking down the bugs, I'm happy to provide further
test programs that will show the other errors I come across.

-jason


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages libgtk2.0-0 depends on:
ii  libatk1.0-0               1.10.3-1       The ATK accessibility toolkit
ii  libc6                     2.3.5-6        GNU C Library: Shared libraries an
ii  libfontconfig1            2.3.2-1        generic font configuration library
ii  libfreetype6              2.1.10-1       FreeType 2 font engine, shared lib
ii  libglib2.0-0              2.8.2-1        The GLib library of C routines
ii  libgtk2.0-bin             2.6.10-1       The programs for the GTK+ graphica
ii  libgtk2.0-common          2.6.10-1       Common files for the GTK+ graphica
ii  libjpeg62                 6b-10          The Independent JPEG Group's JPEG 
ii  libpango1.0-0             1.8.2-2        Layout and rendering of internatio
ii  libpng12-0                1.2.8rel-4     PNG library - runtime
ii  libtiff4                  3.7.3-1        Tag Image File Format (TIFF) libra
ii  libx11-6                  6.8.2.dfsg.1-7 X Window System protocol client li
ii  libxcursor1               1.1.3-1        X cursor management library
ii  libxext6                  6.8.2.dfsg.1-7 X Window System miscellaneous exte
ii  libxft2                   2.1.7-1        FreeType-based font drawing librar
ii  libxi6                    6.8.2.dfsg.1-7 X Window System Input extension li
ii  libxinerama1              6.8.2.dfsg.1-7 X Window System multi-head display
ii  libxrandr2                6.8.2.dfsg.1-7 X Window System Resize, Rotate and
ii  libxrender1               1:0.9.0-2      X Rendering Extension client libra
ii  xlibs                     6.8.2.dfsg.1-7 X Window System client libraries m
ii  zlib1g                    1:1.2.3-4      compression library - runtime

Versions of packages libgtk2.0-0 recommends:
ii  hicolor-icon-theme            0.8-3      default fallback theme for FreeDes

-- no debconf information





More information about the Pkg-gnome-maintainers mailing list