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 <curl-users_at_cool.haxx.se>
Date: Mon, 2 Mar 2020 09:31:29 +0000

Hi

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 <daniel_at_haxx.se>
Sent: Wednesday, February 26, 2020 11:30 PM
To: Dunaj, Robert via curl-users <curl-users_at_cool.haxx.se>
Cc: Dunaj, Robert <Robert.Dunaj_at_dynatrace.com>
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...

--
  / daniel.haxx.se | Commercial curl support up to 24x7 is available!
                   | Private help, bug fixes, support, ports, new features
                   | https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.wolfssl.com%2Fcontact%2F&amp;data=02%7C01%7Crobert.dunaj%40dynatrace.com%7Cb411f5c4f6a34c36ff4308d7bb0ba28d%7C70ebe3a35b30435d9d677716d74ca190%7C1%7C1%7C637183530959383040&amp;sdata=sVVm28QoO1AEiroqjSh9c90Md0lGNnJWiElgGD3RS6E%3D&amp;reserved=0
"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"
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2020-03-02