curl / Mailing Lists / curl-users / 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.

Re: Infinite loop in wakeup check in Curl_multi_wait

From: Daniel Stenberg via curl-users <>
Date: Wed, 26 Feb 2020 23:29:30 +0100 (CET)

On Wed, 26 Feb 2020, Dunaj, Robert via curl-users wrote:

> It happens on Amazon Linux AMI 2018.03 (kernel 4.14.114-83.126.amzn1.x86_64)
> machine. I attached with the gdb and buf content is not changing after each
> read. So I suspect that sread returns 0 (end of file).

That's a terrible situation to end up in!

But why does it want to read in the first place? It should only call sread()
for that socket if poll() said it was readable, and it should only be readable
if it was written to...

What breaks that logic?

> Shouldn't == 0 check be added there?

If you change the check to use <= 0 there, does it fix your issue?

We should probably change that while(1) loop into something that at least will
not get stuck forever...

  / | Commercial curl support up to 24x7 is available!
                   | Private help, bug fixes, support, ports, new features
Received on 2020-02-26