curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Application gets blocked in libcurl v7.50.2

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 7 Mar 2017 03:00:05 -0500

On 3/6/2017 12:07 AM, Saurav Babu wrote:
> On further analysis it is observed that timeout_ms value in waitperform() function is -1. I checked code
> and found that if timeout_ms is less that 0 then there is a possibility of timeout argument to be NULL in
> select function call. According to man page of select(), it can block indefinitely if timeout argument is
> NULL.
>
> Is there any specific reason for timeout_ms to be -1?
> Also is there any way so that application is not blocked indefinitely in such situations?

The behavior you experienced was a bug and has now been fixed along with
two other bugs in the same area. There are 3 commits for the fixes:
29be83e [1], bfaab31 [2] and 958e176 [3].

Or if it's easier since nothing else has really changed from 7.50.2 in
asyn-ares.c (besides style changes) if your copy is not modified you
could just replace the one you have with the one from master [4]. And of
course you could do the same thing if you use the latest curl release
[5][6] (recommended).

[1]: https://github.com/curl/curl/commit/29be83e.patch
[2]: https://github.com/curl/curl/commit/bfaab31.patch
[3]: https://github.com/curl/curl/commit/958e176.patch
[4]: https://raw.githubusercontent.com/curl/curl/958e176/lib/asyn-ares.c
[5]: https://curl.haxx.se/download/curl-7.53.1.tar.gz
[6]: https://curl.haxx.se/download/curl-7.53.1.tar.gz.asc

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-03-07