Subject: Re: Re: core dump when calling libssh2_session_disconnect when sftp server timeout

Re: Re: core dump when calling libssh2_session_disconnect when sftp server timeout

From: Ahmad Zaidee Abu <zaideeabu_at_gmail.com>
Date: Sun, 18 Dec 2011 21:28:13 +0800

> SIGPIPE is a generic UNIX signal, received when an application tries to
> write to a no longer existing pipe/socket connection.
>
> To avoid this crashing your application, set the signal as ignored.
>
> #include <signal.h>
>
> [...]
>
> signal(SIGPIPE, SIG_IGN);
>
> Regards
> Henrik
>
>
Hi Henrik/ experts,

Thanks for the quick response. I've tried your suggestion, but it still
doesn't help. Instead this is giving additional error, see gdb:
 si_code: 1 - SEGV_MAPERR - Address not mapped to object.
0xc00000001e83c3d0:0 in EVP_DigestInit_ex () at digest.c:211
211 digest.c: No such file or directory.
        in digest.c
(gdb) bt
#0 0xc00000001e83c3d0:0 in EVP_DigestInit_ex () at digest.c:211
#1 0xc00000001eabaf60:0 in HMAC_Init () at hmac.c:107
#2 0xc000000009020e00:0 in mac_method_hmac_sha1_hash+0xa0 ()
   from
/home/cpt2a3a/elink_home_hpux/elink622p/EventLink/base/control/2/9/bin/libssh2.so.1
#3 0xc000000009052cf0:0 in _libssh2_transport_write+0x730 ()
   from
/home/cpt2a3a/elink_home_hpux/elink622p/EventLink/base/control/2/9/bin/libssh2.so.1
#4 0xc000000009036ef0:0 in session_disconnect+0x3c0 ()
   from
/home/cpt2a3a/elink_home_hpux/elink622p/EventLink/base/control/2/9/bin/libssh2.so.1
#5 0xc000000009037030:0 in libssh2_session_disconnect_ex+0x50 ()
. . .

Any idea?

BTW, if you don't mind me asking what would be the impact if we're not
calling the libssh2_session_disconnect when we already know it's already
disconnected by the server side? From the function itself, I see that it
only used to send disconnect data to server "rc =
_libssh2_transport_write(session, session->disconnect_data,
session->disconnect_data_len);" and I don't see any other special handling
for releasing memory etc...

Any comments on this?

Thanks & Best Regards,
zaidee

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-12-18