cURL / Mailing Lists / curl-library / Single Mail

curl-library

multi-threads SFTP in libcurl

From: CHEN Xiaolei A <Xiaolei.a.Chen_at_alcatel-sbell.com.cn>
Date: Thu, 11 Nov 2010 13:31:40 +0800

Hi,

   When using libcurl SFTP to download files in multi-threads, I encountered a problem: the concurrent thread number can not be greater than 20, or else core dump will probably occur.

   My environment:
   Local machine OS: Sun solaris 10
   Libcurl version: 7.21.0
   lissh2 version: 1.2.6
   openssl version: 0.9.8o

   Scenario:
   (1) Launch 30 threads to do FTP , and in each thread , download a big size file (12M) for 20 times.
        Result is OK
   (2) Launch 20+ threads to do SFTP, and in each thread, download a big size (12M) file for 20 times
        Result: core dumped very soon, and in some threads, CURLE_FAILED_INIT occurred.
   
   Attachment:
   (1) Compile log of libcurl, libssh2 and openssl.
   (2) A simple test code to reproduce the core attached. (Usage: compile the source code, then ./a.out operationTime threadNum)

   Thanks for have a look.

   Additional Question:
   (1) When we check core problem, we found that it may be caused by openssl, is there any method to make openssl thread-safe?

 
 <<libcurl_config.log>> <<libssh2_config.log>> <<openssl_config.log>> <<libcurl_m.cc>>

> Regards,
> -----------------------------------------------------------------------
> Chen Xiaolei ( ³ÂСÀÚ )
> oambase-wtk Team
> Telephone: +86 10 8477 7636
> Mail: Xiaolei.a.Chen_at_alcatel-sbell.com.cn
> -----------------------------------------------------------------------
>
   

   

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

Received on 2010-11-11