GNOME Bugzilla – Bug 670721
global variable for signal ID should be hidden
Last modified: 2012-02-24 13:05:16 UTC
Created attachment 208314 [details] [review] patch I got a mysterious bug for my app using gdbus on OpenBSD 5.0. After some debugging, it turned out a possible bug of gdbus. Try compiling the following simple program on OpenBSD: $ cat > test-gdbus.c #include <gio/gio.h> guint signals[2]; int main (void) { signals[0] = 123; signals[1] = 456; g_debug ("signals[0] = %d, signals[1] = %d", signals[0], signals[1]); g_type_init (); g_type_class_ref (G_TYPE_DBUS_PROXY); g_debug ("signals[0] = %d, signals[1] = %d", signals[0], signals[1]); return 0; } ^D $ gcc -o test-gdbus test-gdbus.c `pkg-config gio-2.0 --cflags --libs` $ ./test-gdbus ** (process:5256): DEBUG: signals[0] = 123, signals[1] = 456 ** (process:5256): DEBUG: signals[0] = 2, signals[1] = 3 Expected: The two output lines should be identical. Actual: The contents of signals are overwritten. Note: Though this does not occur on GNU/Linux and perhaps an issue of the OpenBSD dynamic linker, I'm attaching a patch.
Review of attachment 208314 [details] [review]: Oh ewwww! Patch looks correct.
Yeah, thanks for the patch, definitely worth fixing. I wonder how we got there, why didn't we get any compile-time warnings prior to the patch?