curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Stuck in poll on network disconnect

From: Magdy, Marco via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 13 Jun 2019 00:31:53 +0000

Hello,

We're using libcurl in the AWS C++ SDK following the guidelines in the documentation when it comes to timeouts. https://curl.haxx.se/libcurl/c/CURLOPT_TIMEOUT_MS.html%ef»¿. Namely, setting the timeout to 0 and relying on the low-speed-time and low-speed-limit options to determine if a connection has stalled. See https://github.com/aws/aws-sdk-cpp/blob/master/aws-cpp-sdk-core/source/http/curl/CurlHandleContainer.cpp#L118. However, we're encountering a problem (that happens 50-ish% of the time) when the connection is lost; we see libcurl stuck with the following stack trace:

poll 0x00007f2441f4e74d
<unknown> 0x00007f243fccff03
curl_multi_wait 0x00007f243fccab93
curl_easy_perform 0x00007f243fcc39e7

If I set CURLOPT_TIMEOUT_MS to something else (e.g. 1000) then the problem goes away, no hangs.
FWIW, my colleagues and I could not reproduce the problem on MacOS, but we're able to reproduce it consistently (again happens about half of the time) when we try on Linux by simply turning off during a transfer.

So, is this a bug? What is your guidance otherwise?

$ curl --version
curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL

Thank you,

Marco

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-06-13