cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re[2]: libcurl crashes when running inseparate thread with request timeout set

From: Никита Дорохин <kit-d_at_ukr.net>
Date: Wed, 26 May 2010 09:27:54 +0300
('binary' encoding is not supported, stored as-is)

I've blocked all the signals in main thread and it worked out. Probably Linux delivers the signal to first&nbsp;available thread with signal mask unset for the particular signal. If signal is blocked then Linux tries to delivers the&nbsp;signal to next thread if any.

However, probably, &nbsp;libcurl schedules timeout signal delivery (the one which is responsible for interrupting the resolver) regardless target thread id and&nbsp;thus Linux chooses the thread to deliver the signal. In this case I the only chance I have is to block signals in all thread except for the thread running libcurl engine.

&nbsp;

Nikita

--- Исходное сообщение ---
От кого: Daniel Stenberg <daniel_at_haxx.se>
Кому: libcurl development <curl-library_at_cool.haxx.se>
Дата: May 25, 2010 23:30:21
Тема: Re: libcurl crashes when running inseparate thread with request timeout set

On Tue, 25 May 2010, Никита Дорохин wrote:
>
> > I have an application with 2 thread running. At some point first thread
> > sends a message to second thread to get HTTP page. When second thread
> > receives the message it initializes libcurl and sends HTTP GET request with
> > CURLOPT_TIMEOUT set to 30 sec.
>
> The stock synchronous resolver and signals not disabled? Then that's the
> reason: signals and threads don't mix very well...
>
> --
>
> / daniel.haxx.se
>

<a href='http://www.ukr.net/msX7uf/footer/8e5b4b'> Впливай на подіїї шоу «Фабрика. Суперфінал»! Голосуй!</a>.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-26