FYI,
Forwarded with permission.
-- / daniel.haxx.se ---------- Forwarded message ---------- Date: Wed, 6 Jun 2012 12:43:43 From: Ganga <gangabhavanip@...> Subject: Reg Core dump in libssh2 with SFTP in main_arena () from /lib64/libc.so.6 Hi Daniel, I am getting the following Segmentation fault when using libssh2 functions in my code. Currently we are using version libssh2.so.1.0.0 Below is the backtrace from my code #0 0x00007f78d04195b8 in main_arena () from /lib64/libc.so.6 #1 0x00007f78d08ae910 in libssh2_packet_read () from /usr/lib64/libssh2.so.1 #2 0x00007f78d089f436 in libssh2_packet_require_ex () from /usr/lib64/libssh2.so.1 #3 0x00007f78d089e2e1 in libssh2_kex_exchange () from /usr/lib64/libssh2.so.1 #4 0x00007f78d08a5e98 in libssh2_session_startup () from /usr/lib64/libssh2.so.1 #5 0x00000000004dea3d in SftpAdapterClass::sftpInitiate(char const*, int, char const*, char const*, bool) () #6 0x00000000004ded60 in SftpAdapterClass::sftpConnect(char const*, int, char const*, char const*, bool) () #7 0x00000000004d4d13 in SSHFTPIV2::ftpConnect(std::string const&, std::string const&, std::string const&, std::string const&, bool) () #8 0x000000000048e9a4 in FTPIV2::checkConnection() () #9 0x00000000004765a3 in TransDest::checkConnection() () #10 0x0000000000476ab8 in TransDest::handleMessage(TransDest::setEvMsg*) () #11 0x000000000047a5eb in TransDest::svc() () #12 0x00007f78d1b41d97 in ACE_Task_Base::svc_run(void*) () from /usr/lib64/libACE.so.5 #13 0x00007f78d1b43435 in ACE_Thread_Adapter::invoke() () from /usr/lib64/libACE.so.5 #14 0x00007f78d15ec696 in start_thread () from /lib64/libpthread.so.0 #15 0x00007f78d0193cbd in clone () from /lib64/libc.so.6 ---Type <return> to continue, or q <return> to quit--- #16 0x0000000000000000 in ?? () Here we are trying to checkconnection which internally calls the stfp protocol that internally uses libssh2. The below is the flow of the calls we performed sock = socket(AF_INET, SOCK_STREAM, 0); if (sock == -1) { } // Getting the socket properties before setting the socket non blocking int arg1 = fcntl( sock, F_GETFL, NULL ); // Setting the socket non blocking result = fcntl( sock, F_SETFL, O_NONBLOCK); // Connecting to the remote ip address result = connect(sock, (struct sockaddr*)(&server),sizeof(struct sockaddr_in)); if (result != 0) { select( sock+1, 0, &writefdSet, 0, &tv ) } session = libssh2_session_init(); if(!session) { } rc = libssh2_session_startup(session, sock); if(rc) { libssh2_session_disconnect(session, "Normal Shutdown, Thank you for playing"); libssh2_session_free(session); close(sock); sock = -1; session=NULL; } libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1); Please guide me in providing the solution for this. Thanking you in Advance Warm Regards Ganga _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-develReceived on 2012-06-08