After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 635101 - g_socket_client_async_connect_complete raises a "called from wrong context" warning
g_socket_client_async_connect_complete raises a "called from wrong context" w...
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
unspecified
Other Linux
: Normal major
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
: 635710 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-11-17 19:16 UTC by Guillaume Desmottes
Modified: 2010-12-05 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
SoupSocket: tweak GMainContext handling (1.64 KB, patch)
2010-11-23 20:53 UTC, Dan Winship
none Details | Review

Description Guillaume Desmottes 2010-11-17 19:16:23 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
  • #0 g_logv
  • #1 g_log
  • #2 g_simple_async_result_complete
    at gsimpleasyncresult.c line 743
  • #3 g_socket_client_async_connect_complete
    at gsocketclient.c line 952
  • #4 g_socket_client_socket_connected
    at gsocketclient.c line 1083
  • #5 g_socket_client_socket_callback
    at gsocketclient.c line 1121
  • #6 socket_source_dispatch
    at gsocket.c line 2470
  • #7 g_main_dispatch
    at gmain.c line 2267
  • #8 g_main_context_dispatch
    at gmain.c line 2824
  • #9 g_main_context_iterate
    at gmain.c line 2902
  • #10 g_main_loop_run
    at gmain.c line 3110
  • #11 gtk_main
    at gtkmain.c line 1321
  • #12 gtk_application_run_mainloop
    at gtkapplication.c line 83
  • #13 g_application_run
    at gapplication.c line 1216
  • #14 main
    at empathy-av.c line 161

Comment 1 Dan Winship 2010-11-17 19:49:04 UTC
are you using multiple threads and/or multiple GMainContexts at all?
Comment 2 Olivier Crête 2010-11-17 20:43:43 UTC
Yes, we are using multiple threads and GMainContext inside the GStreamer stuff. But no, we are not using anything GIO in there.
Comment 3 Guillaume Desmottes 2010-11-17 20:57:14 UTC
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?
Comment 4 Guillaume Desmottes 2010-11-17 21:09:40 UTC
I'm using Ubuntu Maverick btw (libsoup 2.31.92-0ubuntu1 and libgupnp 0.13.4-1build1)
Comment 5 Guillaume Desmottes 2010-11-22 15:54:30 UTC
I opened a gupnp bug, let's see how it goes: http://bugzilla.openedhand.com/show_bug.cgi?id=2205
Comment 6 Olivier Crête 2010-11-22 16:25:56 UTC
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 ?
Comment 7 Guillaume Desmottes 2010-11-22 16:27:04 UTC
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.
Comment 8 Dan Winship 2010-11-22 17:16:27 UTC
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
Comment 9 Olivier Crête 2010-11-22 17:32:45 UTC
Maybe it would be smarter for libsoup to expose a GIO-style API? (its gnome 3, time to break apis!)
Comment 10 Dan Winship 2010-11-23 20:53:42 UTC
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.
Comment 11 Guillaume Desmottes 2010-11-24 16:09:34 UTC
Humm I updated my glib and can't reproduce the bug any more :\
Comment 12 Dan Winship 2010-11-29 16:09:41 UTC
*** Bug 635710 has been marked as a duplicate of this bug. ***
Comment 13 Nicola 2010-11-30 07:29:29 UTC
I can't reproduce abymore after the update to libsoup-2.32.2,

thanks
Nicola
Comment 14 Dan Winship 2010-12-05 16:18:12 UTC
oops, forgot to close this. fixed in 2.32.2