Neil Gierman wrote:
> > Sorry, my fault, I've been meaning to recreate the patch but have
> > little time.
>
> Is this the patch? I have a habit of not deleting emails.
No, I made three more revisions of the patch which never went to
list.
I found the problem using your strace output however.
It's the exact same logical error, but if you are sure that you have
tested this using fixed libssh2 from git, then it must exist also
somewhere else in the code.
Neil Gierman wrote:
> execve(".libs/sftp_write", [".libs/sftp_write", "XX.XX.XX.XX"], [/* 31 vars
> */]) = 0
..
> write(2, "libssh2_sftp_open() is done, now"..., 44) = 44
Ok, so open() is done. Let's look at the first packet.
> write(2, "[libssh2] 0.801613 SFTP: Writing"..., 45) = 45
> gettimeofday({1253543972, 802010}, NULL) = 0
> write(2, "[libssh2] 0.802010 Conn: Writing"..., 71) = 71
> recv(4, 0x811e298, 16384, MSG_NOSIGNAL) = -1 EAGAIN (Resource temporarily
> unavailable)
> gettimeofday({1253543972, 802388}, NULL) = 0
> write(2, "[libssh2] 0.802388 Conn: Sending"..., 73) = 73
> brk(0x8166000) = 0x8166000
> send(4,
> "\325[`-\232\213\376\365\5\257\346$\223\3216\363\310\357}6IP>+\321O*\210\0GL\17"...,
> 32820, MSG_NOSIGNAL) = 13032
The full packet is 32820 bytes. 13032 get sent here. The packet is
not done yet.
> gettimeofday({1253543972, 804143}, NULL) = 0
> write(2, "[libssh2] 0.804143 Failure Event"..., 68) = 68
I think it's wrong that these spins are reported as failure events,
but whatever.
> select(5, [4], [4], NULL, NULL) = 1 (in [4])
This select()s on fd 4 (server socket) for reading (first [4]) and
writing (second [4]) availability. One socket becomes available, so
send again:
> send(4,
> "\200\202\22\365,\27bH\2\217`\311!\30\'#\364&b\234\204\347\273w\27\6\3j\322\221\'\212"...,
> 19788, MSG_NOSIGNAL) = 5792
Now there are 19788 bytes remaining in the packet. 5792 get sent,
leaving 13996 bytes.
> gettimeofday({1253543972, 806971}, NULL) = 0
> write(2, "[libssh2] 0.806971 Failure Event"..., 68) = 68
Another "failure event".
> select(5, [4], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
This select()s on fd 4 again, but only for reading! This suggests
that libssh2 now believes that the packet has been fully sent and is
waiting for a reply. Bad libssh2.
This can either be the same bug that bit Jeremy, the same logical
error in another part of libssh2, or a problem with how the direction
bits that control what to select on get set.
//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel