[PATCH] Multiple timer issues

Irányossy Knoblauch Artúr ikartur@gmail.com
Wed Feb 17 22:30:00 GMT 2016


Dear Cygwin Maintainers,

First of all, thank you for your work, I really enjoy using this software!

However, I have noticed that adjusting the system time can cause some
programs to misbehave. I have found bugs in the POSIX timer
implementation and a bug in the select() function's timeout handling.

Please find the proposed patches attached.


Regarding POSIX timers:

I have also created a small test application (see timer_test.c and the
Makefile) to demonstrate the issue. Please try to run it on both Linux
and Cygwin!

The test tries to set the system time back and forth to see the effect
on different kinds of timers. Please note, that for setting the system
time, the test has to be run with the necessary administrative rights
provided.


Regarding select():

The timeout shall be immune to adjustments to the system clock in all
cases; so the 'gtod' clock shouldn't be used, because it is not
monotonic.


I have tried to keep the changes as minimal as possible.
I hope that signing a legal agreement is not necessary, since these
are just bugfixes; if you think otherwise, please let me know.

Best Regards,
Artúr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-POSIX-timer-fixes.patch
Type: text/x-patch
Size: 3813 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20160217/5bc5569c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Make-select-immune-to-system-clock-adjustments.patch
Type: text/x-patch
Size: 1176 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20160217/5bc5569c/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Eliminate-dead-code.patch
Type: text/x-patch
Size: 2136 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20160217/5bc5569c/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 126 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20160217/5bc5569c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: timer_test.c
Type: text/x-csrc
Size: 2590 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20160217/5bc5569c/attachment-0003.bin>


More information about the Cygwin-patches mailing list