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 618641 - Unsetting proxy while message is in the queue leads to posterior criticals
Unsetting proxy while message is in the queue leads to posterior criticals
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2010-05-14 15:05 UTC by Claudio Saavedra
Modified: 2010-05-16 19:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (1.08 KB, text/x-csrc)
2010-05-14 15:06 UTC, Claudio Saavedra
Details

Description Claudio Saavedra 2010-05-14 15:05:38 UTC
The attached test case does this:

- Enqueue a message.
- Before it's callback is called, unset the proxy of the session, resulting in abortion of the message.
- Send a new message. This message is never delivered and a critical warning is issued.

The critical is

 libsoup-CRITICAL **: soup_socket_connect_async: assertion `SOUP_IS_SOCKET (sock)' failed

Stacktrace:

 #0  0xb7fe2832 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
  • #1 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #2 *__GI_abort
    at abort.c line 88
  • #3 IA__g_logv
    at /build/buildd-glib2.0_2.24.1-1-i386-84Pp4V/glib2.0-2.24.1/glib/gmessages.c line 549
  • #4 IA__g_log
    at /build/buildd-glib2.0_2.24.1-1-i386-84Pp4V/glib2.0-2.24.1/glib/gmessages.c line 569
  • #5 IA__g_return_if_fail_warning
  • #6 soup_socket_connect_async
    at soup-socket.c line 774
  • #7 got_address
    at soup-socket.c line 694
  • #8 complete_resolve_async
    at soup-address.c line 610
  • #9 lookup_resolved
    at soup-address.c line 649
  • #10 IA__g_simple_async_result_complete
    at /build/buildd-glib2.0_2.24.1-1-i386-84Pp4V/glib2.0-2.24.1/gio/gsimpleasyncresult.c line 588
  • #11 complete_in_idle_cb
    at /build/buildd-glib2.0_2.24.1-1-i386-84Pp4V/glib2.0-2.24.1/gio/gsimpleasyncresult.c line 598
  • #12 g_idle_dispatch
    at /build/buildd-glib2.0_2.24.1-1-i386-84Pp4V/glib2.0-2.24.1/glib/gmain.c line 4065
  • #13 g_main_dispatch
    at /build/buildd-glib2.0_2.24.1-1-i386-84Pp4V/glib2.0-2.24.1/glib/gmain.c line 1960
  • #14 IA__g_main_context_dispatch
    at /build/buildd-glib2.0_2.24.1-1-i386-84Pp4V/glib2.0-2.24.1/glib/gmain.c line 2513
  • #15 g_main_context_iterate
    at /build/buildd-glib2.0_2.24.1-1-i386-84Pp4V/glib2.0-2.24.1/glib/gmain.c line 2591
  • #16 IA__g_main_loop_run
    at /build/buildd-glib2.0_2.24.1-1-i386-84Pp4V/glib2.0-2.24.1/glib/gmain.c line 2799
  • #17 main
    at soup.c line 44

Comment 1 Claudio Saavedra 2010-05-14 15:06:09 UTC
Created attachment 161066 [details]
test case
Comment 2 Claudio Saavedra 2010-05-16 08:34:08 UTC
Further analysis narrow this down to soup_session_abort() being what actually break things.

As I understood it, this is what causes the critical warning:

- When the message is enqueued, soup_address_resolve_async() is called at some point by a SoupSocket. This calls g_resolver_lookup_by_name_async() with a callback lookup_resolved().

- When the abortion happens, there is cancellation moving down the stack, but this doesn't reach the GResolver call. The socket is unrefed in soup_connection_disconnect() and therefore finalized. At this point, it doesn't exist anymore.

- When the GResolver is done, it cals the callback lookup_resolved(). This is hooked up to call the callback got_address() in soup-socket.c. But, guess what, the socket doesn't exist anymore and boom!

By now I start to have my doubts whether this critical is really the cause of the issues with further messages sent.
Comment 3 Dan Winship 2010-05-16 19:30:46 UTC
fixed in master. assuming no problems show up in the next month, i'll
pull it into 2.30.2
Comment 4 Claudio Saavedra 2010-05-16 19:44:45 UTC
Works great now, thanks a lot.