Bugs item #2875635, was opened at 2009-10-09 10:47
Message generated for change (Tracker Item Submitted) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2875635&group_id=125852
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: libssh2_channel_close() hangs in non blocking mode
Initial Comment:
Hi,
I am having problems with non responding connections again. I am using
libssh2-1.2.1. I am always using the non blocking mode for all the libssh2
functions, and the socket is created with a timeout. All the libssh2 functions
are executed in a loop that reruns it until the result is not EAGAIN and it
exists after few seconds anyway so that it does not hang. It works well for all
the initialization and the read/write libssh2 functions.
The problem is now the program is hanging in libssh2_channel_close(), and the
session/channel is still in non-blocking mode. It sounds the problem is the big
"do { ... } while(1)" loop in _libssh2_transport_read(). The socket is broken
and this function will try to read something forever. It has been hanging for
at least 60 seconds, and then a monitor decided to stop the program, so that we
get the backtrace:
(gdb) bt
#0 0x00007f4c7be47221 in _libssh2_transport_read (session=0x7f4c74047270) at
transport.c:312
#1 0x00007f4c7be2fe4c in channel_close (channel=0x7f4c7400df70) at
channel.c:2276
#2 0x00007f4c7be30090 in libssh2_channel_close (channel=0x7f4c7400df70) at
channel.c:2307
#3 0x0000000000413b1d in connpool_internal_repairifbroken (cp=0x629c50,
descriptor=4308,
reconnected=0x426b3e5c,
monname=0x426d4a20 "mon4")
Is there a workaround for this problem ? If not I think we should implement a
default timeout in _libssh2_transport_read().
Thanks
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2875635&group_id=125852
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel