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: Dunaj, Robert via curl-users <>
Date: Mon, 2 Mar 2020 09:31:29 +0000


Thanks for the answer.

We don't know yet what breaks that logic.
I'm still investigating why it happens.

After the changing to use <= 0, the issue is gone.
So I think this small change could be added there, as it shouldn't break anything.

-----Original Message-----
From: Daniel Stenberg <>
Sent: Wednesday, February 26, 2020 11:30 PM
To: Dunaj, Robert via curl-users <>
Cc: Dunaj, Robert <>
Subject: Re: Infinite loop in wakeup check in Curl_multi_wait

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
"The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. Dynatrace sp. z o.o. (registration number KRS 595) is a company registered in Poland whose registered office is at ul. Grunwaldzka 411,80-309 Gdansk Rejestr handlowy KRS 0000000595 Sadu Rejonowego Gdansk-Polnoc w Gdansku VII Wydzial Gospodarczy Kapital zakladowy 4.240.000 zl oplacony gotówka; NIP: 584-20-88-050; REGON: 191352920"
Received on 2020-03-02