GNOME Bugzilla – Bug 635101
g_socket_client_async_connect_complete raises a "called from wrong context" warning
Last modified: 2010-12-05 16:18:12 UTC
I got this warning when trying to make an Empathy call using glib master. GLib-GIO-WARNING **: g_simple_async_result_complete() called from wrong context! aborting... Program received signal SIGTRAP, Trace/breakpoint trap. 0x00007fffefd50f98 in g_logv (log_domain=0x7ffff1e78866 "GLib-GIO", log_level=G_LOG_LEVEL_WARNING, format=0x7ffff1e788c0 "g_simple_async_result_complete() called from wrong context!", args1=0x7fffffffdfa0) at gmessages.c:553 553 G_BREAKPOINT (); (gdb) bt
+ Trace 224725
are you using multiple threads and/or multiple GMainContexts at all?
Yes, we are using multiple threads and GMainContext inside the GStreamer stuff. But no, we are not using anything GIO in there.
I'm not using GSocketClient directly. It seems that's in libgupnp (through libsoup). This app is very threaded (because of GStreamer). Is that a bug in libsoup instead?
I'm using Ubuntu Maverick btw (libsoup 2.31.92-0ubuntu1 and libgupnp 0.13.4-1build1)
I opened a gupnp bug, let's see how it goes: http://bugzilla.openedhand.com/show_bug.cgi?id=2205
Looking at the stack trace having only GIO things in it, I'm not sure how this bug could be anywhere but in GIO or libsoup ?
So, the context passed by gupnp to libsoup is right (that's simple->context ing_simple_async_result_complete()). But the current_context in this function is NULL which is wrong, so that's probably a gio bug after all.
it's probably libsoup actually; it has to do slightly funky things to switch from the context-passed-explicitly-in-the-API API of libsoup to the context-passed-implicitly-thread-local API of gio
Maybe it would be smarter for libsoup to expose a GIO-style API? (its gnome 3, time to break apis!)
Created attachment 175131 [details] [review] SoupSocket: tweak GMainContext handling I can't figure out how to get the bug to happen in a test program, but this probably should fix it.
Humm I updated my glib and can't reproduce the bug any more :\
*** Bug 635710 has been marked as a duplicate of this bug. ***
I can't reproduce abymore after the update to libsoup-2.32.2, thanks Nicola
oops, forgot to close this. fixed in 2.32.2