delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/09/02/07:12:20

X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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 DOT crezoff AT gmail DOT com>
X-Google-Original-From: Alexey Shumkin <Alex DOT Crezoff AT gmail DOT com>
Date: Tue, 2 Sep 2014 15:10:45 +0400
To: cygwin AT cygwin DOT com
Subject: mktime call hangs on Cygwin 1.7.30, Windows 7 32 bit
Message-ID: <20140902111045.GA5860@ashu-win7>
MIME-Version: 1.0
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019