zmq_poll stops expiring timeout in virtualized Windows 7

Description

When running one test, I noticed that my application called zmq_poll with timeout of 2000 but it at one day stopped expiring the timeout. Similarly, a client application that connected to it and had a loop that used QueryPerformanceCounter for timeout, suddenly froze and stopped firing the timeout. After doing some research, I have found that VirtualBox's QueryPerformanceCounter doesn't guarantee monotonicity https://www.virtualbox.org/ticket/11951. They argue that even Windows QueryPerformanceCounter doesn't guarantee it.

Then I have found that zmq_poll calls clock_t::now_ms which in turn calls clock_t::now_us which uses QueryPerformanceCounter.

I wasn't able to reproduce the specific conditions that makes QueryPerformanceCounter behave as that, but the attached program would reproduce the problem if these conditions were met.

Environment

Windows 7 host running a VirtualBox with a Windows 7 guest

Activity

Show:
PieterP
November 9, 2013, 8:53 AM

Backported patches to 4.0.x, will go on next stable.

FelipeF
November 11, 2013, 3:59 PM

I'm reopening this issue because the build on MinGW has been broken, so it needs an additional backporting.

Assignee

Unassigned

Reporter

FelipeF

Labels

None

Components

Fix versions

Affects versions

Priority

Major