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

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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=paTbP5YhpaOTVKWSexCKka8LmNjpW65L8jDo5DSPQyMiejYnYOmf7
vgU9ROPGvnHOw/Gpsk6QKtGZR1k+USFZa1ZrDK8jG6i4nWnTm/1c+vkIZQX8EFoa
L22Ms2gbIzzfcxHDCwZKuxo4xKzeyKS8gFd7AtH/1FBgg6xhuB6o7k=
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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=tXwem5WIeBqa7xdHoHnnNWJ/3tM=; b=PbRUltzxyFqrzeKCKmirCEXDk5q9
IGJAOB0xyhEhu0OU59Rpi9Jew8Mv1pHG2pA+74JXZBpdHTkTAqxtf7bqYRFm9kjb
9jGaMhQSgF2N5DVOOBmRQ7lziZ1qwPZKiYWu5ryJlZpmvQxelLF/UHLIMdAcA7O4
oaFTc7HbB/pXH0s=
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=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2
X-HELO: calimero.vinschen.de
Date: Tue, 2 Sep 2014 13:27:19 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: mktime call hangs on Cygwin 1.7.30, Windows 7 32 bit
Message-ID: <20140902112719.GA6056@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20140902111045 DOT GA5860 AT ashu-win7>
MIME-Version: 1.0
In-Reply-To: <20140902111045.GA5860@ashu-win7>
User-Agent: Mutt/1.5.23 (2014-03-12)

--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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
>=20
> 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.
>=20
> But after updating Git to v2.1.0
>   git commit --amend -C HEAD --date=3D''
> 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.
>=20
> $ cat cygwin-mktime-bug.c
> #include <time.h>
> #include <string.h>
> #include <stdio.h>
>=20
> int main(int argc, char **argv)
> {
>      struct tm tm;
>=20
>      memset(&tm, 0, sizeof(tm));
>      tm.tm_year =3D -1;
>      tm.tm_mon =3D -1;
>      tm.tm_mday =3D -1;
>      tm.tm_isdst =3D -1;
>      tm.tm_hour =3D -1;
>      tm.tm_min =3D -1;
>      tm.tm_sec =3D -1;
>=20
>      printf("Working...\n");
>      time_t temp_time =3D mktime(&tm);
>      printf("Worked");
> }
>=20
> $ 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

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--T4sUOijqQbZv57TR
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJUBamWAAoJEPU2Bp2uRE+gpJ4P/3vsSbPbrEh6uLkq0GzL9q/Y
SgioegagHjgDQq3RPVn1x0I5nUJQJLZk5fYWVI2CAlKEHLmqeK8jQ1Zs+SAKF1fY
0Av2za2Cnj4c/Xuor/VRGsujp9rj6KI7eRv+gqXmIol4GmDT1kFCb14TOdHZqq/l
+cvZBwlRU/9H0EAOIjeQ9vLG9rXk6zFkdboPSaTTI9aMN8w6d/v10Yig+oQYbqW4
3GyEmx28y+QNGIgBQ1ZUWxM3xMt2Wa8U5DAmv/UEYA+4eAWzWOAphgkSrVqo3SLR
ijyUJ0P66e6072gWR+7A7wmWXRJCfWz+eHlQYKgYD6o/9IURmzRx7iVRek25SECe
V9GJH506Hq1kTyghRiN+dwywz/H1gNWz8yB44qGmECyoZyeNbNn9gU418tcWCipF
fpU1x8yZW2GHQU/BSt6Xlbjqglrm7+b+l+VQuFMSunn+2B+3GXkuVbFpS0NUC/Jv
phtdJrVsv5xRKQkbmiPRvH9agSQKwmo+Gt24W3w6X+trFT1MwBuU5jApz5ETNnaV
6iOaVDsxOUZJfJmaPzpuvwsYdNDjkI4wXqsQrWuLla7gfpQ5d/BDtAzIbCSOPG+c
amkHKwzt2S2d2EBug/zEOSSKR663EBAYqpFnEP/YuRVd45JUJrFyKIR8M3KCOAEj
BNAdbl11AcZqv5XJflXd
=aQEA
-----END PGP SIGNATURE-----

--T4sUOijqQbZv57TR--

- Raw text -


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