Bug#510873: gtk_widget_trigger_tooltip_query: Conditional jump or move depends on uninitialised value(s)

Johan Walles johan.walles at gmail.com
Mon Jan 5 14:57:20 UTC 2009


Package: libgtk2.0-0
Version: 2.12.11-4
Severity: normal


Calling gtk_widget_trigger_tooltip_query() makes tooltips not show up sporadically. Also, valgrind 
complains about Conditional jump or move depends on uninitialised value(s) in other code:

==3029== Conditional jump or move depends on uninitialised value(s)
==3029==    at 0x426A930: child_location_foreach (gtktooltip.c:515)
==3029==    by 0x40A1FFE: gtk_bin_forall (gtkbin.c:133)
==3029==    by 0x40E99E5: gtk_container_forall (gtkcontainer.c:1453)
==3029==    by 0x426A85A: find_widget_under_pointer (gtktooltip.c:640)
==3029==    by 0x426B858: gtk_tooltip_show_tooltip (gtktooltip.c:900)
==3029==    by 0x426B980: tooltip_popup_timeout (gtktooltip.c:1013)
==3029==    by 0x43D878A: gdk_threads_dispatch (gdk.c:470)
==3029==    by 0x45D88E5: g_timeout_dispatch (gmain.c:3446)
==3029==    by 0x45D81B7: g_main_context_dispatch (gmain.c:2012)
==3029==    by 0x45DB852: g_main_context_iterate (gmain.c:2645)
==3029==    by 0x45DBD71: g_main_loop_run (gmain.c:2853)
==3029==    by 0x4186BA8: gtk_main (gtkmain.c:1163)

Removing the call to gtk_widget_trigger_tooltip_query() makes the complaint go away and makes the 
tooltip visible again, but since I *want* to update the tooltip not calling that function doesn't 
really solve the problem.

Repro case with build and repro instructions:

"
/*
 * Repro for a problem with gtk_widget_trigger_tooltip_query().
 *
 * Build:
 * gcc -Wall -Wextra -Wno-unused $(pkg-config --cflags --libs gtk+-2.0) -g gtktip.c
 *
 * Run:
 * valgrind ./a.out
 *
 * Repro:
 * 1. Move your mouse into the window that pops up.
 * 2. A tooltip should appear.
 * 3. If a tooltip actually appears and valgrind doesn't print
 *   anything, move your mouse out of the window and try again.
 *
 * After less than 5 attempts I usually get this from valgrind:
 * ==3029== Conditional jump or move depends on uninitialised value(s)
 * ==3029==    at 0x426A930: child_location_foreach (gtktooltip.c:515)
 * ==3029==    by 0x40A1FFE: gtk_bin_forall (gtkbin.c:133)
 * ==3029==    by 0x40E99E5: gtk_container_forall (gtkcontainer.c:1453)
 * ==3029==    by 0x426A85A: find_widget_under_pointer (gtktooltip.c:640)
 * ==3029==    by 0x426B858: gtk_tooltip_show_tooltip (gtktooltip.c:900)
 * ==3029==    by 0x426B980: tooltip_popup_timeout (gtktooltip.c:1013)
 * ==3029==    by 0x43D878A: gdk_threads_dispatch (gdk.c:470)
 * ==3029==    by 0x45D88E5: g_timeout_dispatch (gmain.c:3446)
 * ==3029==    by 0x45D81B7: g_main_context_dispatch (gmain.c:2012)
 * ==3029==    by 0x45DB852: g_main_context_iterate (gmain.c:2645)
 * ==3029==    by 0x45DBD71: g_main_loop_run (gmain.c:2853)
 * ==3029==    by 0x4186BA8: gtk_main (gtkmain.c:1163)
 *
 * Commenting out the call to gtk_widget_trigger_tooltip_query() makes
 * valgrind happy (but me unhappy since I *want* to update the
 * tooltip).
 */
#include <gtk/gtk.h>

static void
on_destroy (GtkWidget * widget, gpointer data)
{
  gtk_main_quit();
}

static int
update_tooltip (gpointer pointer)
{
  static int i = 0;
  static char tip[200];
  GtkWidget *tipMe = pointer;

  sprintf(tip, "Tip #%d: Don't run with scissors", i++);
  gtk_widget_set_tooltip_text(tipMe, tip);
  gtk_widget_trigger_tooltip_query(tipMe);
  return TRUE;
}

int
main (int argc, char *argv[])
{
  GtkWidget *window;
  GtkWidget *label;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (window), "Hello World");
  gtk_window_set_default_size (GTK_WINDOW (window), 200, 50);
  g_signal_connect (G_OBJECT (window), "destroy",
		    G_CALLBACK (on_destroy), NULL);

  label = gtk_label_new ("Hover me and I'll give you a tip!");
  gtk_widget_set_tooltip_text(label, "Don't run with scissors");
  gtk_container_add(GTK_CONTAINER (window), label);

  gtk_widget_show_all(window);

  // Add a timeout that updates the tooltip once per second
  gtk_timeout_add(1000, update_tooltip, label);

  gtk_main ();

  return 0;
}
"

  Regards //Johan

-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libgtk2.0-0 depends on:
ii  libatk1.0-0           1.22.0-1           The ATK accessibility toolkit
ii  libc6                 2.7-16             GNU C Library: Shared libraries
ii  libcairo2             1.6.4-7            The Cairo 2D vector graphics libra
ii  libcomerr2            1.41.3-1           common error description library
ii  libcups2              1.3.8-1lenny4      Common UNIX Printing System(tm) - 
ii  libfontconfig1        2.6.0-3            generic font configuration library
ii  libglib2.0-0          2.16.6-1           The GLib library of C routines
ii  libgnutls26           2.4.2-4            the GNU TLS library - runtime libr
ii  libgtk2.0-common      2.12.11-4          Common files for the GTK+ graphica
ii  libjpeg62             6b-14              The Independent JPEG Group's JPEG 
ii  libkrb53              1.6.dfsg.4~beta1-4 MIT Kerberos runtime libraries
ii  libpango1.0-0         1.20.5-3           Layout and rendering of internatio
ii  libpng12-0            1.2.27-2           PNG library - runtime
ii  libtiff4              3.8.2-11           Tag Image File Format (TIFF) libra
ii  libx11-6              2:1.1.5-2          X11 client-side library
ii  libxcomposite1        1:0.4.0-3          X11 Composite extension library
ii  libxcursor1           1:1.1.9-1          X cursor management library
ii  libxdamage1           1:1.1.1-4          X11 damaged region extension libra
ii  libxext6              2:1.0.4-1          X11 miscellaneous extension librar
ii  libxfixes3            1:4.0.3-2          X11 miscellaneous 'fixes' extensio
ii  libxi6                2:1.1.4-1          X11 Input extension library
ii  libxinerama1          2:1.0.3-2          X11 Xinerama extension library
ii  libxrandr2            2:1.2.3-1          X11 RandR extension library
ii  libxrender1           1:0.9.4-2          X Rendering Extension client libra
ii  zlib1g                1:1.2.3.3.dfsg-12  compression library - runtime

Versions of packages libgtk2.0-0 recommends:
ii  hicolor-icon-theme            0.10-1     default fallback theme for FreeDes
ii  libgtk2.0-bin                 2.12.11-4  The programs for the GTK+ graphica

Versions of packages libgtk2.0-0 suggests:
ii  librsvg2-common           2.22.2-2lenny1 SAX-based renderer library for SVG

-- no debconf information






More information about the pkg-gnome-maintainers mailing list