GNOME Bugzilla – Bug 341573
valgrind detects "syscall param write(buf) points to uninitialised byte(s)" in sample minimal gtk+ application
Last modified: 2006-07-31 04:43:08 UTC
Please describe the problem: When running sample base.c program from http://www.gtk.org/tutorial/c58.html #include <gtk/gtk.h> int main( int argc, char *argv[] ) { GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_show (window); gtk_main (); return 0; } under valgrind-3.1.0 with gtk-2.8.17 (Fedora Core 5 + updates) there are errors detected. Steps to reproduce: 1. gcc `pkg-config --cflags --libs gtk+-2.0` -g base.c 2. valgrind ./a.out Actual results: Valgrind detects the following error (two times): ==4256== Syscall param write(buf) points to uninitialised byte(s) ==4256== at 0x1BA2D3: __write_nocancel (in /lib/libc-2.4.so) ==4256== by 0x27D3EE: _X11TransWrite (in /usr/lib/libX11.so.6.2.0) ==4256== by 0x283326: (within /usr/lib/libX11.so.6.2.0) ==4256== by 0x28342A: _XReply (in /usr/lib/libX11.so.6.2.0) ==4256== by 0x269281: XInternAtom (in /usr/lib/libX11.so.6.2.0) ==4256== by 0x27CECB: XSetWMProperties (in /usr/lib/libX11.so.6.2.0) ==4256== by 0x3944347: (within /usr/lib/libgdk-x11-2.0.so.0.800.17) ==4256== by 0x3946AA5: gdk_window_new (in /usr/lib/libgdk-x11-2.0.so.0.800.17) ==4256== by 0x392402C: gdk_display_open (in /usr/lib/libgdk-x11-2.0.so.0.800.17) ==4256== by 0x3902AEE: gdk_display_open_default_libgtk_only (in /usr/lib/libgdk-x11-2.0.so.0.800.17) ==4256== by 0x3AF8B9E: gtk_init_check (in /usr/lib/libgtk-x11-2.0.so.0.800.17) ==4256== by 0x3AF8BD3: gtk_init (in /usr/lib/libgtk-x11-2.0.so.0.800.17) ==4256== Address 0x406AA08 is 128 bytes inside a block of size 16,384 alloc'd ==4256== at 0x40045EB: calloc (vg_replace_malloc.c:279) ==4256== by 0x26E0D6: XOpenDisplay (in /usr/lib/libX11.so.6.2.0) ==4256== by 0x3923EF1: gdk_display_open (in /usr/lib/libgdk-x11-2.0.so.0.800.17) ==4256== by 0x3902AEE: gdk_display_open_default_libgtk_only (in /usr/lib/libgdk-x11-2.0.so.0.800.17) ==4256== by 0x3AF8B9E: gtk_init_check (in /usr/lib/libgtk-x11-2.0.so.0.800.17) ==4256== by 0x3AF8BD3: gtk_init (in /usr/lib/libgtk-x11-2.0.so.0.800.17) ==4256== by 0x80485B3: main (base.c:8) Expected results: No errors detected by valgrind. Does this happen every time? Yes. Other information:
this happens in the X libraries, and is not a problem.
I filed https://bugs.freedesktop.org/show_bug.cgi?id=7703 on the bug in the X libraries. (And I claim it is a real problem both because of the extensibility of these structs and because it causes valgrind noise that could easily cover real problems, especially when not running with --sync.)