X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:date:to:subject:message-id:mime-version
	:content-type; q=dns; s=default; b=A50V6DVnmLvpRoXQNaU/Miai43ZYM
	hNz5j1duFUIP1tgtdXYa2BomRChndLLEtsCc8cES8imvzW9sr5l4xqpGVm2Ba9mU
	AvDmRyL4SyGennPJ5kQSmXykAvwjRv9jXEVJlly5r9vVv5VECGoC2SGOxyklyAJc
	7PHNWtU8HOoZ58=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:date:to:subject:message-id:mime-version
	:content-type; s=default; bh=zmc2RcJgBDwJ2VLYVge2kK2nAC8=; b=X5U
	ajyEpGCBvgFlZ6k4HbN4BOI739r12G85D+EYgJYJ3CW5dvuz+7E4kXeEqLvGD3vp
	RSukR4tRUciNxwbeI/NDqJF8XLhv4pxE0sO9I+TBDqvb4sP6UDy9MFgxYCbQicqc
	wnbQ2gn90nLFaT1D3JNgHV3z/wQgDxyRE4yok518=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-lb0-f180.google.com
X-Received: by 10.112.29.147 with SMTP id k19mr1655357lbh.102.1409656247117;        Tue, 02 Sep 2014 04:10:47 -0700 (PDT)
From: Alexey Shumkin <alex.crezoff@gmail.com>
X-Google-Original-From: Alexey Shumkin <Alex.Crezoff@gmail.com>
Date: Tue, 2 Sep 2014 15:10:45 +0400
To: cygwin@cygwin.com
Subject: mktime call hangs on Cygwin 1.7.30, Windows 7 32 bit
Message-ID: <20140902111045.GA5860@ashu-win7>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1251
Content-Disposition: inline
User-Agent: Mutt/1.5.22 (2013-10-16)

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...



So, there is a question: how to fix it?
Nota bene: I do not want to use Cygwin x64 (there were no exim when I've tested it).


-- 
Alexey Shumkin

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

