cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multi Thread problem ||

From: Chirag <chirag_at_cellcloud.com>
Date: Fri, 20 Sep 2002 23:07:22 +0530

Hi,

    I just got another crash..... and it confirmed the behaviour......(i.e.
simultaneously three thread connected to the same URL. Then one of them
closed the connection and later the other two could not close it, i
guess.....) please refer to the code in my first mail with the same subject.

##### SMSC Queue is NULL #####
------>Before CURL Perform
* Connected to 66.13.8.101 (66.13.8.101)
> GET /servlet/ICC?msisdn=919845352668&message=BUZZ%20A HTTP/1.1
Host: 66.13.8.101:8080
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

* Connected to 66.13.8.101 (66.13.8.101)
> GET /servlet/ICC?msisdn=919845299678&message=PTS HTTP/1.1
Host: 66.13.8.101:8080
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

* Connected to 66.13.8.101 (66.13.8.101)
> GET /servlet/ICC?msisdn=919845257581&message=GAME HTTP/1.1
Host: 66.13.8.101:8080
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

* Connection (#0) left alive
---------------> Result of the CURL PERFORM is 0
------>After CURL Perform

[1]+ Segmentation Fault (core dumped) ./mgateway
bash-2.03$

----- Original Message -----
From: "Daniel Stenberg" <daniel_at_haxx.se>
To: "libcurl Mailing list" <curl-library_at_lists.sourceforge.net>
Sent: Friday, September 20, 2002 9:45 PM
Subject: Re: Multi Thread problem

> On Fri, 20 Sep 2002, Chirag wrote:
>
> You didn't mention version here, but I trust this is curl 7.9.8 we're
talking
> about?
>
> > The problem is that this function is called by a number of threads (15
> > threads to be precise). The whole code runs fine for some time, but then
> > when there are say 5 requests at the same time to a same URL, and when
it
> > tries to retrive the content simultaneously, sometime in between i get a
> > seg_fault.
>
> Does the crash always happen when several threads get the same URL?
>
> > I have put VERBOSE and here is where it gives me a seg_fault always...
>
> And if you run the program with a debugger, can you get it to stop on the
> offending line? If so, which one is it?
>
> > By default i am giving a timeout of 60 secs. I dont know what cud be the
> > problem.
>
> That's only bad if the name lookup takes a long time since the abortion of
> that is made with a signal and I don't know what a Solaris threaded
program
> does with it.
>
> > I have tried all combination of increasing the timeout from 5 secs to 60
> > secs.
>
> What does it do without timeout?
>
> > Also i have tried it with 5 threads to 13 threads but the crash is
erratic.
> > As u see from the VERBOSE below....when two or more threads have
> > simultaneously got the content....my program goes down.
>
> No, I didn't really see that. When and where exactly does it crash?
>
> > http_body = (char *)strstr(chunk.memory, "\r\n\r\n");
>
> This approach really isn't necessary. You can pass in a different "chunk"
> pointer (or even callback function) for the headers when they are passed
to
> the callback.
>
> I found no obvious flaws in the code.
>
> --
> Daniel Stenberg -- curl related mails on curl related mailing lists
please
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
>
>

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-09-20