No. we didnot share the same curl handle in multi-threads.
The attachment is our test code. Thanks.

Best  Regards, 
Xing 

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Dan Fandrich
Sent: 2010年11月12日 16:08
To: [email protected]
Subject: Re: multi-threads SFTP in libcurl

On Fri, Nov 12, 2010 at 10:59:12AM +0800, SU Xing A wrote:
>      It is not that libssh2 suddenly do wrong when go beyond 20 threads. It 
> still happened but not often when less than 20 threads.
>      This issue happened when we use libcurl/libssh2/openssl in 
> multi-threads. It do not appear in single thread.
> ....
> From the pstack, I guess when libssh2 call "diffie_hellman_sha1/BN_CTX_free", 
> some resource was released but thread 22 still needed. So coredump happened.
> Is it any clue? Thanks a lot.

Are you by any chance using the same curl handle in more than one thread?
That's a no-no; libcurl is thread safe only if you never access the same handle 
in more than one thread at a time.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Attachment: libcurl_m.cc
Description: libcurl_m.cc

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to