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 724239 - soup_session_queue_message - Connection terminated unexpectedly
soup_session_queue_message - Connection terminated unexpectedly
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
2.39.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-02-12 14:52 UTC by bill
Modified: 2014-02-17 16:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
reproducer for my problem.. (3.95 KB, application/x-compressed-tar)
2014-02-12 14:52 UTC, bill
  Details
strace of soup-client run where issue was seen. (168.55 KB, text/plain)
2014-02-14 19:13 UTC, bill
  Details
gsocket: fix g_socket_condition_timed_wait() recovery after EINTR (959 bytes, patch)
2014-02-14 20:36 UTC, Dan Winship
committed Details | Review

Description bill 2014-02-12 14:52:11 UTC
Created attachment 268919 [details]
reproducer for my problem..

I'm not sure how to describe what is happening.  I have a reproducer and hope that I'm simply using/implementing things incorrectly.

The situation is that I have a global SoupSession.  The reproducer spawns several processes using forkpty.  I read the output via a GIOChannel and send the data via the SoupSession.  If one of these processes finishes while I'm in the middle of a soup_session_queue_message transaction I get error code 7 - Connection terminated unexpectedly.

If I do one of the following I can eliminate the issue:

- Open SoupSession with timeout = 0
- Create a new SoupSession from inside GIOChannel and don't use the static global SoupSession.

Is there a real bug here?  or am I leaking file descriptors and causing the problem?

Thanks!


To run the reproducer:
% make

Shell 1
% ./soup-server

Shell 2
% ./soup-client --server http://localhost:8081/

You will get the following output on Shell 2 
** (soup-client:22971): WARNING **: output code:7 Reason:Connection terminated unexpectedly

run again if you don't get the error.  It happens every time for me, but it is time sensitive.
Comment 1 bill 2014-02-14 19:13:42 UTC
Created attachment 269136 [details]
strace of soup-client run where issue was seen.

Here is an starce -tt -f of soup-client when it showed the issue.
Comment 2 Dan Winship 2014-02-14 20:36:32 UTC
Created attachment 269143 [details] [review]
gsocket: fix g_socket_condition_timed_wait() recovery after EINTR

After getting an EINTR, g_socket_condition_timed_wait() has to adjust
its timeout, but it was trying to convert from nanoseconds to
microseconds by multiplying by 1000 rather than dividing... Oops.
Comment 3 Dan Winship 2014-02-14 20:37:17 UTC
Bill: test F19 build at http://koji.fedoraproject.org/koji/taskinfo?taskID=6531992
Comment 4 bill 2014-02-17 01:46:18 UTC
Hi Dan,

This does indeed fix the problem for me.  Thank you so much!
Comment 5 Dan Winship 2014-02-17 16:38:36 UTC
Attachment 269143 [details] pushed as 4139b26 - gsocket: fix g_socket_condition_timed_wait() recovery after EINTR