curl-library
Re: multi_threads
Date: Mon, 05 Dec 2005 16:09:01 -0700
Daniel Stenberg wrote:
> On Mon, 5 Dec 2005, Yi Li wrote:
>
>> The program fault. Does anybody know why?
>
>
> ...
>
>> the usage is : exename inputFile threadsNumber
>
>
> ...
>
> pthread_t tid[4];
>
> for(i=0; i< numThread; i++) {
> error = pthread_create(&tid[i],
>
> ...
>
> Buffer overflow when 'i' reaches 4.
>
sorry for the mistake. I just try to modify my code to the simple sample
code and made the mistake.
the new attachment is my code. and I got segmentation fault. in gdb it
says:
Curl_hash_clean () from /usr/lib/libcurl.so.2
#1 0x40045f16 in Curl_hash_destroy () from /usr/lib/libcurl.so.2
#2 0x4004473f in curl_easy_cleanup () from /usr/lib/libcurl.so.2
#3 0x08049025 in pull_one_url(void*) () at try.cc:89
#4 0x40053dac in start_thread () from /lib/tls/libpthread.so.0
#5 0x402179ea in clone () from /lib/tls/libc.so.6
Any ideas?
Thanks
Michael.
- text/x-c++ attachment: try.cc