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 672178 - CRITICAL when disconnecting after setting a connection as IDLE
CRITICAL when disconnecting after setting a connection as IDLE
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-03-15 18:54 UTC by Sergio Villar
Modified: 2012-03-28 15:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
soup-connection.c: do not unref the socket twice while disconnecting (1.48 KB, patch)
2012-03-28 08:42 UTC, Sergio Villar
accepted-commit_now Details | Review

Description Sergio Villar 2012-03-15 18:54:19 UTC
The backtrace explains it better than any words

  • #0 soup_connection_disconnect
    at soup-connection.c line 845
  • #1 tunnel_message_completed
    at soup-session-async.c line 303
  • #2 soup_message_io_finished
    at soup-message-io.c line 162
  • #4 read_metadata
    at soup-message-io.c line 309
  • #5 io_read
    at soup-message-io.c line 879
  • #6 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #7 g_closure_invoke
    at gclosure.c line 774
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3302
  • #9 g_signal_emit_valist
    at gsignal.c line 3033
  • #10 g_signal_emit
    at gsignal.c line 3090
  • #11 soup_socket_disconnect
    at soup-socket.c line 1218
  • #12 soup_connection_disconnect
    at soup-connection.c line 847
  • #13 clear_current_item
    at soup-connection.c line 489
  • #14 soup_connection_set_state
    at soup-connection.c line 918
  • #15 soup_session_unqueue_item
    at soup-session.c line 1979
  • #16 process_queue_item
    at soup-session-async.c line 430
  • #17 cancel_message
    at soup-session-async.c line 576
  • #18 soup_session_cancel_message
    at soup-session.c line 2291

So the nested call to soup_connection_disconnect() will set priv->socket to NULL on line 849. Thus the first call to soup_connection_disconnect() will find that after coming back from soup_socket_disconnect() priv->socket is NULL. That's why we get the CRITICAL in the g_object_unref.
Comment 1 Sergio Villar 2012-03-28 08:42:58 UTC
Created attachment 210761 [details] [review]
soup-connection.c: do not unref the socket twice while disconnecting

Reentrant calls to soup_socket_disconnect() when disconnecting the socket
lead to double disconnections and double unref of the same SoupSocket.
Comment 2 Dan Winship 2012-03-28 14:50:50 UTC
Comment on attachment 210761 [details] [review]
soup-connection.c: do not unref the socket twice while disconnecting

assuming "make check" still passes, ok
Comment 3 Sergio Villar 2012-03-28 15:56:44 UTC
Committed 0c0619228a3488a4808cad2383073e00db22cd6d