mktime call hangs on Cygwin 1.7.30, Windows 7 32 bit

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Sep 2 11:27:00 GMT 2014


On Sep  2 15:10, Alexey Shumkin wrote:
> Prelude.
> I use "self-compiled" Git (v2.x) on Cygwin (v1.7.30).
> Sometimes Git v2.0.4 hung while performing
>   git prune --expire 2.weeks.ago
> 
> I have investigated while debugging that `mktime` call hung.
> But that was an avoidable bug (skip prune - and all is ok). So, I've not
> reported it.
> 
> But after updating Git to v2.1.0
>   git commit --amend -C HEAD --date=''
> hangs, too. And now it is the often used operation by me.
> So, I've made a simple example (copied from Git sources) to reproduce
> the error.
> 
> $ cat cygwin-mktime-bug.c
> #include <time.h>
> #include <string.h>
> #include <stdio.h>
> 
> int main(int argc, char **argv)
> {
>      struct tm tm;
> 
>      memset(&tm, 0, sizeof(tm));
>      tm.tm_year = -1;
>      tm.tm_mon = -1;
>      tm.tm_mday = -1;
>      tm.tm_isdst = -1;
>      tm.tm_hour = -1;
>      tm.tm_min = -1;
>      tm.tm_sec = -1;
> 
>      printf("Working...\n");
>      time_t temp_time = mktime(&tm);
>      printf("Worked");
> }
> 
> $ gcc cygwin-mktime-bug.c -o cygwin-mktime-bug -I/usr/include -g
> $ ./cygwin-mktime-bug.exe
> Working...

Works fine for me every time on Cygwin 1.7.32 32 and 64 bit.  I ran
your testcase 1000 times in a loop.  It's slow, but it never hangs.
Btw., the code of mktime and low level stuff is basically identical
to the NetBSD implementation it has been taken from.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140902/e4e98c17/attachment.sig>


More information about the Cygwin mailing list