1 Jun 2003 11:41
multithreading problem with libcurl
Konstantin Schauwecker <hi <at> konstantin-schauwecker.de>
2003-06-01 09:41:22 GMT
2003-06-01 09:41:22 GMT
Hello everybody I have some strange problems when using libcurl in multiple threads. I've spend days of debugging and modifying my source, and now I'm completely helpless(Continue reading)I have an application which uses 10 threads (I had the problem with lower counts of threads too). Each thread calls a curl_easy_init to get a curl handle. All threads are doing constantly HTTP requests. Now my Problems: On Linux: The program runs fine for a few minutes, but then it crashes with a segmentation fault. Valgrind told me, that the reason for crashing is inside of libcurl. Here the output of valgrind: ==1487== valgrind's libpthread.so: KLUDGED call to: siglongjmp (cleanup handlers are ignored) ==1487== Invalid read of size 4 ==1487== at 0x40235303: Curl_resolv (hostip.c:242) ==1487== Address 0x41B0C3B0 is on thread 1's stack ==1487== ==1487== Invalid read of size 4 ==1487== at 0x4023B01B: Curl_failf (sendf.c:154) ==1487== Address 0x10 is not stack'd, malloc'd or free'd I thougth this might be a problem of setting the wrong options. So I tried to remove the calls of curl_easy_setopt to a minimum (I already tried reducing all code to a minimum *g*), but it didn't help.
I have an application which uses 10 threads (I had the problem with lower
counts of threads too). Each thread calls a curl_easy_init to get a curl
handle. All threads are doing constantly HTTP requests.
Now my Problems:
On Linux:
The program runs fine for a few minutes, but then it crashes with a
segmentation fault. Valgrind told me, that the reason for crashing is inside
of libcurl. Here the output of valgrind:
==1487== valgrind's libpthread.so: KLUDGED call to: siglongjmp (cleanup
handlers are ignored)
==1487== Invalid read of size 4
==1487== at 0x40235303: Curl_resolv (hostip.c:242)
==1487== Address 0x41B0C3B0 is on thread 1's stack
==1487==
==1487== Invalid read of size 4
==1487== at 0x4023B01B: Curl_failf (sendf.c:154)
==1487== Address 0x10 is not stack'd, malloc'd or free'd
I thougth this might be a problem of setting the wrong options. So I tried to
remove the calls of curl_easy_setopt to a minimum (I already tried reducing
all code to a minimum *g*), but it didn't help.
> Now my Problems:
>
> On Linux:
> The program runs fine for a few minutes, but then it crashes with a
> segmentation fault. Valgrind told me, that the reason for crashing is inside
> of libcurl. Here the output of valgrind:
One silly question, do you handle timeouts ?, and have you then disabled
the signal handler (CURLOPT_NOSIGNAL) ?
Would it be possible for you to post both some sample code, and a small
Makefile that generated the crash ?
/BL
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
RSS Feed