Bug#694340: libgconf2-4: libgconf built with the dbus backend requires dbus-glib to be initialized with threading
Le lundi 26 novembre 2012 à 07:49 +0800, Chow Loong Jin a écrit : Maybe we should just port GConf to GDBus instead, which doesn’t have this issue, but this is not a small change. That was mentioned in https://bugzilla.gnome.org/show_bug.cgi?id=683830, but given that it isn't a small change, it's probably not going to happen for Wheezy. Can we slap a downstream patch in the meantime? This bug causes Banshee to crash pretty reliably. But we can’t fix the bug by introducing another bug. After reading the upstream discussion, I am convinced your patch is a bad idea, since it will fix banshee but might trigger crashes in other applications. Only a port to GDBus would do the trick, unfortunately. Cheers, -- .''`. Josselin Mouette : :' : `. `' `- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#694340: libgconf2-4: libgconf built with the dbus backend requires dbus-glib to be initialized with threading
On 26/11/2012 17:28, Josselin Mouette wrote: Le lundi 26 novembre 2012 à 07:49 +0800, Chow Loong Jin a écrit : Maybe we should just port GConf to GDBus instead, which doesn’t have this issue, but this is not a small change. That was mentioned in https://bugzilla.gnome.org/show_bug.cgi?id=683830, but given that it isn't a small change, it's probably not going to happen for Wheezy. Can we slap a downstream patch in the meantime? This bug causes Banshee to crash pretty reliably. But we can’t fix the bug by introducing another bug. After reading the upstream discussion, I am convinced your patch is a bad idea, since it will fix banshee but might trigger crashes in other applications. Only a port to GDBus would do the trick, unfortunately. I guess we'll have to hack in a patch further downstream then. Perhaps gconf-sharp. I think I might have tried sometime back, but I don't recall why that didn't work. -- Kind regards, Loong Jin signature.asc Description: OpenPGP digital signature
Bug#694340: libgconf2-4: libgconf built with the dbus backend requires dbus-glib to be initialized with threading
Package: libgconf2-4 Version: 3.2.5-0ubuntu4 Severity: critical Tags: patch Justification: breaks unrelated software Dear Maintainer, Originally from https://bugs.launchpad.net/ubuntu/+source/banshee/+bug/1048341, Banshee, which uses libgconf through the gconf# bindings, and does not touch libdbus-glib directly (dbus# is a reimplementation of libdbus, and does not actually use libdbus(-glib)), is crashing in libgconf with the following stack trace: #0 0x7f609b5cc18d in read () at ../sysdeps/unix/syscall-template.S:82 #1 0x0049853b in read (__nbytes=1024, __buf=0x7f607a4e4730, __fd=optimized out) at /usr/include/x86_64-linux-gnu/bits/unistd.h:45 #2 mono_handle_native_sigsegv (signal=signal@entry=11, ctx=ctx@entry=0x7f607a4e4c40) at mini-exceptions.c:2208 #3 0x004e8daf in mono_arch_handle_altstack_exception (sigctx=sigctx@entry=0x7f607a4e4c40, fault_addr=optimized out, stack_ovf=stack_ovf@entry=0) at exceptions-amd64.c:953 #4 0x0041fe87 in mono_sigsegv_signal_handler (_dummy=11, info=0x7f607a4e4d70, context=0x7f607a4e4c40) at mini.c:5909 #5 signal handler called #6 0x7f608c9b7a57 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3 #7 0x7f608c9bc011 in dbus_message_get_reply_serial () from /lib/x86_64-linux-gnu/libdbus-1.so.3 #8 0x7f608c9b037e in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3 #9 0x7f608c9c7e5b in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3 #10 0x7f608c9c8864 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3 #11 0x7f608c9c8ec6 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3 #12 0x7f608c9c7bfd in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3 #13 0x7f608c9b2904 in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3 #14 0x7f608c9b3cad in ?? () from /lib/x86_64-linux-gnu/libdbus-1.so.3 [1 Debug 17:34:10.781]#15 0x7f608c9b30ac in dbus_connection_send_with_reply_and_block () from /lib/x86_64-linux-gnu/libdbus-1.so.3 #16 0x7f608ce3028a in gconf_engine_get_fuller () from /usr/lib/x86_64-linux-gnu/libgconf-2.so.4 #17 0x7f608ce305be in gconf_engine_get_entry () from /usr/lib/x86_64-linux-gnu/libgconf-2.so.4 #18 0x7f608ce2a86e in ?? () from /usr/lib/x86_64-linux-gnu/libgconf-2.so.4 #19 0x7f608ce2cf8d in ?? () from /usr/lib/x86_64-linux-gnu/libgconf-2.so.4 I would like to propose the patch that I have applied onto the the Ubuntu gconf package (attached here) in order to fix this issue. It ensures that libgconf initializes DBus-Glib with threads when it is initialized. -- System Information: Debian Release: wheezy/sid APT prefers quantal-updates APT policy: (500, 'quantal-updates'), (500, 'quantal-security'), (500, 'quantal'), (400, 'quantal-proposed'), (100, 'quantal-backports') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.6.6-hyper1 (SMP w/4 CPU cores; PREEMPT) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages libgconf2-4 depends on: ii gconf-service 3.2.5-0ubuntu4 ii libgconf-2-4 3.2.5-0ubuntu4 libgconf2-4 recommends no packages. libgconf2-4 suggests no packages. -- no debconf information Author: Chow Loong Jin hyper...@debian.org Description: Call dbus_g_thread_init before calling any dbus functions Bug-Ubuntu: https://bugs.launchpad.net/bugs/1048341 Index: gconf/gconf/gconf-dbus.c === --- gconf.orig/gconf/gconf-dbus.c 2012-09-11 09:54:10.056848441 +0800 +++ gconf/gconf/gconf-dbus.c 2012-09-11 10:07:03.967826677 +0800 @@ -396,6 +396,13 @@ return FALSE; } + /* Initialize DBus Glib for multithreading -- this fixes race conditions when + multi-threaded applications use gconf. Additionally, although the API + documentation says that dbus_g_thread_init() may only be called once, it is + actually really a wrapper for dbus_threads_init_default() which can be + called as many times as necessary. */ + dbus_g_thread_init (); + dbus_error_init (error); global_conn = dbus_bus_get_private (DBUS_BUS_SESSION, error);
Bug#694340: libgconf2-4: libgconf built with the dbus backend requires dbus-glib to be initialized with threading
severity 694340 serious thanks Hi, Le lundi 26 novembre 2012 à 01:36 +0800, Chow Loong Jin a écrit : + /* Initialize DBus Glib for multithreading -- this fixes race conditions when + multi-threaded applications use gconf. Additionally, although the API + documentation says that dbus_g_thread_init() may only be called once, it is + actually really a wrapper for dbus_threads_init_default() which can be + called as many times as necessary. */ Thanks for the patch, but I’m not fond of violating the API just because it works for the moment. This is precisely the kind of code that can trigger later the kind of bug you are trying to fix. OTOH the risk is low, since dbus-glib is a dying library. Maybe we should just port GConf to GDBus instead, which doesn’t have this issue, but this is not a small change. Cheers, -- .''`. Josselin Mouette : :' : `. `' `- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#694340: libgconf2-4: libgconf built with the dbus backend requires dbus-glib to be initialized with threading
On 26/11/2012 05:50, Josselin Mouette wrote: severity 694340 serious thanks Hi, Le lundi 26 novembre 2012 à 01:36 +0800, Chow Loong Jin a écrit : + /* Initialize DBus Glib for multithreading -- this fixes race conditions when + multi-threaded applications use gconf. Additionally, although the API + documentation says that dbus_g_thread_init() may only be called once, it is + actually really a wrapper for dbus_threads_init_default() which can be + called as many times as necessary. */ Thanks for the patch, but I’m not fond of violating the API just because it works for the moment. This is precisely the kind of code that can trigger later the kind of bug you are trying to fix. OTOH the risk is low, since dbus-glib is a dying library. Maybe we should just port GConf to GDBus instead, which doesn’t have this issue, but this is not a small change. That was mentioned in https://bugzilla.gnome.org/show_bug.cgi?id=683830, but given that it isn't a small change, it's probably not going to happen for Wheezy. Can we slap a downstream patch in the meantime? This bug causes Banshee to crash pretty reliably. I recall some other C# applications being affected as well, and forcing all of them to add a dependency on dbus-glib to call dbus_g_thread_init seems wrong, especially when dbus usage is supposed to be an implementation detail in libgconf, and C# programs in general use DBus# which is a complete reimplementation of libdbus. -- Kind regards, Loong Jin signature.asc Description: OpenPGP digital signature