cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multithreaded HTTP POST to UPLOAD data

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 12 Aug 2009 09:39:57 +0200 (CEST)

On Wed, 12 Aug 2009, Raghu PV wrote:

> Recently i started using libcurl 7.15.5 version on Redhat Linux 5 system to
> perform HTTP POST for upload test.
> I have coded my application using pthreads to have 3 threads and each thread
> does HTTP POST upload to the same URL using "easy" interface of libcurl.
> Using pthreads, i am trying acheive the initiation of data transfer from 3
> threads at the same time.
> When the threads execute "curl_easy_perform()" concurrently, I find
> segmentation violation.GDB with the core dump points that curl_escape() call
> raises signal 11

In 99.6% of the cases when people report bugs similar to this, the fault is in
the user application. Since you run Linux you should have no problems to run
your app with valgrind and track down the problem from there.

You should of course also note that 7.15.5 is an old release and you may very
well suffer from one or more bugs that we fixed ages ago...

> Is libcurl thread-safe to implement applications like this?

Yes.

> are the functions like curl_escape() and curl_easy_perform() are implemented
> to be rentrant code?

Yes.

> Any thoughts how to fix this problem?

As outlined above. Valgrind and/or upgrading libcurl.

> if the latest version of libcurl might solve the problem then how do i
> install latest libcurl shared library?

If you want to install it using your vendor's methods, then you ask them. If
you want to build from source, then you can just build and install a separate
lib using ./configure --prefix or similar.

The choice is yours!

-- 
  / daniel.haxx.se
Received on 2009-08-12