Subject: libssh2_sftp_init() blocks and does not return

libssh2_sftp_init() blocks and does not return

From: Heiner Steven <>
Date: Wed, 18 Mar 2009 00:42:29 +0100


I compiled our existing SSH file copy program and tried using it
with the current CVS version of libssh2 (from 2009-03-18).

Unfortunately it does not work: the program "hangs" in the library
call libssh2_sftp_init() and does not return. The "sftp-server"
process has been started correctly (and can be seen in the process list).

Aborting the program I get the following stack trace:

#0 0x00007f6fe65790d5 in recv () from /lib/
#1 0x000000000042a62a in _libssh2_packet_read (session=0x16546d0)
     at transport.c:362
#2 0x00000000004116dd in libssh2_channel_read_ex (channel=0x165ca40,
     stream_id=0, buf=0x7fffef643a10 "–:dÔˇ\177", buflen=4) at channel.c:1515
#3 0x000000000041d4ca in sftp_packet_read (sftp=0x165d790) at sftp.c:154
#4 0x000000000041daef in sftp_packet_require (sftp=0x165d790,
     packet_type=2 '\002', request_id=0, data=0x7fffef643ad0,
     data_len=0x7fffef643ac8) at sftp.c:303
#5 0x000000000041e8c0 in libssh2_sftp_init (session=0x16546d0) at sftp.c:645
#6 0x0000000000408337 in getsftp (conn=0x63c9b8, url=0x1652e80)
     at ../../../quality.smove/src/smove/remoteops.c:577
#7 0x0000000000408bab in remote_fstat (connp=0x63c9b8, url=0x1652e80,
     mustexist=false) at ../../../quality.smove/src/smove/remoteops.c:949
#8 0x0000000000404842 in gen_fstat (connp=0x63c9b8, url=0x1652e80,
     mustexist=false) at ../../../quality.smove/src/smove/smove.c:850
#9 0x0000000000405a10 in main (argc=4, argv=0x7fffef644828)
     at ../../../quality.smove/src/smove/smove.c:1671

"strace" shows the process blocking in "recvfrom(3, ...".

Is this a known problem?


Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial.
libssh2-devel mailing list
Received on 2009-03-18