Server blocks when using tls with a connection and trying to exit
@icq
Submitted by Ignacio Casal Quinteiro Assigned to libsoup-maint@gnome.bugs
Link to original bug (#784330)
Description
Created attachment 354678 test
Not sure whether this bug is in libsoup or glib-networking. Attached you can find a test case that reproduces the problem. To reproduce just launch the test application: ./test
From another terminal connect with netcat "nc localhost 8443". Go back to the terminal where you have the test running and exit it by pressing control+c. You will see that it blocks. If you grab a backtrace you will see something similar to this:
#0 0x00007f42af04c70d in poll () at ../sysdeps/unix/syscall-template.S:84
#1 0x00007f42af5a3242 in g_poll (fds=0x7ffed5abb690, nfds=1, timeout=-1) at /home/local/ANT/qignacio/gnome/src/glib/glib/gpoll.c:124
#2 0x00007f42aa38cc2e in claim_op (gnutls=0x195d170, op=G_TLS_CONNECTION_GNUTLS_OP_CLOSE_BOTH, blocking=1, cancellable=0x0, error=0x0)
at /home/local/ANT/qignacio/gnome/src/glib-networking/tls/gnutls/gtlsconnection-gnutls.c:655
#3 0x00007f42aa38f444 in g_tls_connection_gnutls_close_internal (stream=0x195d170, direction=(G_TLS_DIRECTION_READ | G_TLS_DIRECTION_WRITE), cancellable=0x0, error=0x0)
at /home/local/ANT/qignacio/gnome/src/glib-networking/tls/gnutls/gtlsconnection-gnutls.c:1646
#4 0x00007f42aa38f6a6 in g_tls_connection_gnutls_close (stream=0x195d170, cancellable=0x0, error=0x0) at /home/local/ANT/qignacio/gnome/src/glib-networking/tls/gnutls/gtlsconnection-gnutls.c:1698
#5 0x00007f42afb43d4d in g_io_stream_close (stream=0x195d170, cancellable=0x0, error=0x0) at /home/local/ANT/qignacio/gnome/src/glib/gio/giostream.c:422
#6 0x00007f42aff562d0 in disconnect_internal (sock=0x1952aa0, close=1) at /home/local/ANT/qignacio/gnome/src/libsoup/libsoup/soup-socket.c:190
#7 0x00007f42aff59c94 in soup_socket_disconnect (sock=0x1952aa0) at /home/local/ANT/qignacio/gnome/src/libsoup/libsoup/soup-socket.c:1592
#8 0x00007f42aff4898e in soup_server_disconnect (server=0x194f890) at /home/local/ANT/qignacio/gnome/src/libsoup/libsoup/soup-server.c:1682
#9 0x00007f42aff46062 in soup_server_dispose (object=0x194f890) at /home/local/ANT/qignacio/gnome/src/libsoup/libsoup/soup-server.c:252
#10 0x00007f42af88ff67 in g_object_unref (_object=0x194f890) at /home/local/ANT/qignacio/gnome/src/glib/gobject/gobject.c:3277
#11 0x0000000000400be6 in on_terminate_app ()
#12 0x00007f42af591879 in g_unix_signal_watch_dispatch (source=0x1957ae0, callback=0x400b96 <on_terminate_app>, user_data=0x0) at /home/local/ANT/qignacio/gnome/src/glib/glib/gmain.c:5175
#13 0x00007f42af58f2fa in g_main_dispatch (context=0x191bd40) at /home/local/ANT/qignacio/gnome/src/glib/glib/gmain.c:3148
#14 0x00007f42af59022a in g_main_context_dispatch (context=0x191bd40) at /home/local/ANT/qignacio/gnome/src/glib/glib/gmain.c:3813
#15 0x00007f42af59041d in g_main_context_iterate (context=0x191bd40, block=1, dispatch=1, self=0x1925890) at /home/local/ANT/qignacio/gnome/src/glib/glib/gmain.c:3886
#16 0x00007f42af590857 in g_main_loop_run (loop=0x1942980) at /home/local/ANT/qignacio/gnome/src/glib/glib/gmain.c:4082
#17 0x0000000000400dd5 in main ()
Attachment 354678, "test":
test.tar.gz
Version: 2.58.x