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.

Re: Found infinite looping in libCurl version 7.55.1

From: Uma Shunmugan via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 3 Feb 2020 10:28:02 -0500

Thanks, Daniel, for the prompt response. And, sorry about my late response.

I have been *able to reproduce* the issue by using a mock version of
GetTickCount() that would roll over to 0 in 5 minutes from first use
(though it didn't happen every time with my app). Since we don't want to
upgrade to the last version of libcurl right now, I've recompiled libcurl
7.55.1 with some changes to force the use of GetTickCount64(), with the
caveat that it needs to run on Windows 2008 or later. JFYI, because I had
compile issues with VS 2013 that we use for building our code, I stuck with
VS 2005 to build libcurl, but I had to add Windows Kit 8.1 directories to
the project to make it build.

Cheers,
 Uma
...

> It is not a known issue but having the time wrap and start over at zero
> sounds
> like something that could be problematic.
>
> > If so, is there a fix for it?
>
> Current libcurl doesn't use GetTickCount() if you run on Vista or later so
> it
> should already be avoided. For older systems there's no fix as far as I
> can
> see.
>

...

> > Now, I've checked timeval.c in 7.55.1, and realized that
> GetTickcount64()
> > would have been used instead, if _WIN32_WINNT and _WIN32_WINNT_VISTA had
> > been defined to the correct values. It's not clear to me where/how
> these
> > macros are to be defined, though. Is there a configuration option for
> these
> > in the build? If not, could I simply define these in config-win32.h?
> FYI,
> > I had compiled libcurl on Window 2008 using Visual Studio 2005, and
> > obviously these macros were not defined at all.
>
> I don't remember what 7.55.1 did.

> > If this issue could not be due to time value rolling over problem, is
> there
> > any other known issues that would explain this infinite looping? What
> else
> > could I do to debug this further?
>
> I'm not aware of any infinite looping bug mentioned in recent years until
> your
> mail here.
>
> To debug it, I would first try hard to reproduce (possibly by writing a
> mock
> version of GetTickCount() for curl). Then when reproduced, see if a
> current
> libcurl is likely to have similar logic that can be tricked in the same or
> similar ways.
>

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