[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: session establishment struck


Aris,

Thank you for your response.

We create multiple ssh sessions simultaneously to multiple hosts. For each
host we connect, I have a read thread to read from ssh session and write
thread that writes to session. I don't see any problem on solaris, but I am
observing this problem intermittently on red hat linux.

It might be a redhat linux bug described by the following post where call
is struck at malloc:
http://www.linuxquestions.org/questions/red-hat-31/%5Brhel-6-0%5D-deadlock-in-malloc-glibc-2-12-1-25-a-890389/

I will see if upgrading glibc solves the problem.

Anyway, when I have multiple ssh sessions simultaneously to lots of network
elements to manage them, and a separate read and write thread for each of
the session, is there any particular threading guideline I need to follow?

Thank you and Regards,
Vasuki

On Sat, Aug 25, 2012 at 2:36 AM, Aris Adamantiadis <aris@xxxxxxxxxxxx>wrote:

> Hi,
>
> I see this is a thread dump - Do you follow the best practices for
> handling threads within libssh [1] ?
>
> Do this happen every time or on a small fraction of the time ? What is
> your environment/cpu (I guess some kind of linux on x64)?
> Do you do several launches of ssh connections at same time ?
>
> I must say this looks very strange because your stacktrace lies right
> into malloc... Do you do some strange threading (using an other
> threading lib than libpthread ?)
>
> Kr,
>
> Aris
>
> [1] http://api.libssh.org/master/libssh_tutor_threads.html
> Le 25/08/12 01:17, Vasuki Gubbi a écrit :
> > Hi,
> >
> > I am trying to connect using SSH and I see that my thread is struck for
> > ever and does not return. I am attaching the thread dump below. Please
> > let me know if there is an issue?
> >
> >
> > #0  0x0000003ab2ef619e in __lll_lock_wait_private () from
> /lib64/libc.so.6
> > #1  0x0000003ab2e7c1d8 in _L_lock_9165 () from /lib64/libc.so.6
> > #2  0x0000003ab2e79ad2 in malloc () from /lib64/libc.so.6
> > #3  0x0000003ab2e6fd9b in __libc_message () from /lib64/libc.so.6
> > #4  0x0000003ab2e75716 in malloc_printerr () from /lib64/libc.so.6
> > #5  0x0000003ab2e78e58 in _int_malloc () from /lib64/libc.so.6
> > #6  0x0000003ab2e79add in malloc () from /lib64/libc.so.6
> > #7  0x0000003ab9e5d84e in CRYPTO_malloc () from /usr/lib64/libcrypto.so.6
> > #8  0x0000003ab9eb92c7 in EVP_DigestInit_ex () from
> > /usr/lib64/libcrypto.so.6
> > #9  0x0000003ab9e6a556 in HMAC_Init_ex () from /usr/lib64/libcrypto.so.6
> > #10 0x00007fbe66f08ed5 in hmac_init () from
> > /NS1500/netsmart8.0/lib/libssh.so.4
> > #11 0x00007fbe66ef3a5d in packet_encrypt () from
> > /NS1500/netsmart8.0/lib/libssh.so.4
> > #12 0x00007fbe66f0380f in packet_send2 () from
> > /NS1500/netsmart8.0/lib/libssh.so.4
> > #13 0x00007fbe66f038f5 in packet_send () from
> > /NS1500/netsmart8.0/lib/libssh.so.4
> > #14 0x00007fbe66ef0a0c in ssh_service_request () from
> > /NS1500/netsmart8.0/lib/libssh.so.4
> > #15 0x00007fbe66ee5113 in ask_userauth () from
> > /NS1500/netsmart8.0/lib/libssh.so.4
> > #16 0x00007fbe66ee57fa in ssh_userauth_none () from
> > /NS1500/netsmart8.0/lib/libssh.so.4
> > #17 0x00007fbe66ee6e1c in ssh_userauth_autopubkey () from
> > /NS1500/netsmart8.0/lib/libssh.so.4
> >
> > Regards,
> > Vasuki
>
>
>

Follow-Ups:
Re: session establishment struckAndreas Schneider <asn@xxxxxxxxxxxxxx>
References:
session establishment struckVasuki Gubbi <gkvasuki@xxxxxxxxx>
Re: session establishment struckAris Adamantiadis <aris@xxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org