Subject: Re: libssh2_sftp_write now hangs eventually

Re: libssh2_sftp_write now hangs eventually

From: Mark Riordan <mriordan_at_ipswitch.com>
Date: Mon, 8 Nov 2010 16:55:03 -0600

I've gotten a bit further.

As you recall, calling libssh2_trace(session, ~0);
(all debugging enabled) caused so much output to be generated that the
timing changed, and the hang during the SFTP upload went away.

So, I disabled various combinations of trace flags until I got the hang to
reappear.
Now I'm enabling just LIBSSH2_TRACE_ERROR.

I changed the last line of sftp_write in sftp.c to:
    return _libssh2_error(session, LIBSSH2_ERROR_EAGAIN,
      "Would block at end of sftp_write");

During the last write, the program now gets this:

...
libssh2_sftp_write 2 sent 8000 bytes [This is a successful write]
[libssh2] 1.245994 Failure Event: -37 - Unable to send channel data
[libssh2] 1.245994 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.245994 Failure Event: -37 - Unable to send channel data
[libssh2] 1.245994 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.245994 Failure Event: -37 - Unable to send channel data
[libssh2] 1.245994 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.245994 Failure Event: -37 - Unable to send channel data
[libssh2] 1.245994 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.245994 Failure Event: -37 - Unable to send channel data
[libssh2] 1.245994 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.245994 Failure Event: -37 - Unable to send channel data
[libssh2] 1.245994 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.261619 Failure Event: -37 - Unable to send channel data
[libssh2] 1.261619 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.261619 Failure Event: -37 - Unable to send channel data
[libssh2] 1.261619 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.261619 Failure Event: -37 - Unable to send channel data
[libssh2] 1.261619 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.261619 Failure Event: -37 - Unable to send channel data
[libssh2] 1.261619 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.261619 Failure Event: -37 - Unable to send channel data
[libssh2] 1.261619 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.261619 Failure Event: -37 - Unable to send channel data
[libssh2] 1.261619 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.261619 Failure Event: -37 - Unable to send channel data
[libssh2] 1.261619 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.261619 Failure Event: -37 - Unable to send channel data
[libssh2] 1.261619 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.261619 Failure Event: -37 - Unable to send channel data
[libssh2] 1.261619 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.277244 Failure Event: -37 - Unable to send channel data
[libssh2] 1.277244 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.277244 Failure Event: -37 - Unable to send channel data
[libssh2] 1.277244 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.277244 Failure Event: -37 - Unable to send channel data
[libssh2] 1.277244 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.277244 Failure Event: -37 - Unable to send channel data
[libssh2] 1.277244 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.277244 Failure Event: -37 - Unable to send channel data
[libssh2] 1.277244 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.277244 Failure Event: -37 - Unable to send channel data
[libssh2] 1.277244 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.277244 Failure Event: -37 - Unable to send channel data
[libssh2] 1.277244 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.277244 Failure Event: -37 - Unable to send channel data
[libssh2] 1.277244 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.292869 Failure Event: -37 - Unable to send channel data
[libssh2] 1.292869 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.292869 Failure Event: -37 - Unable to send channel data
[libssh2] 1.292869 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.292869 Failure Event: -37 - Unable to send channel data
[libssh2] 1.292869 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.292869 Failure Event: -37 - Unable to send channel data
[libssh2] 1.292869 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.292869 Failure Event: -37 - Unable to send channel data
[libssh2] 1.292869 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.292869 Failure Event: -37 - Unable to send channel data
[libssh2] 1.292869 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.292869 Failure Event: -37 - Unable to send channel data
[libssh2] 1.292869 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.292869 Failure Event: -37 - Unable to send channel data
[libssh2] 1.292869 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.292869 Failure Event: -37 - Unable to send channel data
[libssh2] 1.292869 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.308494 Failure Event: -37 - Unable to send channel data
[libssh2] 1.308494 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.308494 Failure Event: -37 - Unable to send channel data
[libssh2] 1.308494 Failure Event: -37 - Would block at end of sftp_write
[libssh2] 1.308494 Failure Event: -37 - Would block at end of sftp_write

Every time I run it, it logs "Would block at end of sftp_write"
twice immediately before hanging.

A clue?

Mark

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-11-08