From owner-freebsd-bugs Thu May 24 19:20: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 93B3137B42C for ; Thu, 24 May 2001 19:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4P2K1g20197; Thu, 24 May 2001 19:20:01 -0700 (PDT) (envelope-from gnats) Received: from mx1.aist.go.jp (mx1.aist.go.jp [150.29.246.133]) by hub.freebsd.org (Postfix) with ESMTP id C003E37B424 for ; Thu, 24 May 2001 19:10:27 -0700 (PDT) (envelope-from akr@coulee.etl.go.jp) Received: from rpsmtp1.aist.go.jp by mx1.aist.go.jp with ESMTP id f4P2AL518560 for ; Fri, 25 May 2001 11:10:21 +0900 (JST) env-from (akr@coulee.etl.go.jp) Received: from eccu1-1.etl.go.jp by rpsmtp1.aist.go.jp with ESMTP id f4P2ALP24114 for ; Fri, 25 May 2001 11:10:21 +0900 (JST) env-from (akr@coulee.etl.go.jp) Received: from flux.etl.go.jp (dhcpea003 [150.29.203.193]) by eccu1-1.etl.go.jp (8.9.3/3.7W-ETL-MASTER) with ESMTP id LAA24838 for ; Fri, 25 May 2001 11:10:20 +0900 (JST) Received: by flux.etl.go.jp (Postfix, from userid 23483) id 01D54727; Fri, 25 May 2001 11:10:18 +0900 (JST) Message-Id: <20010525021018.01D54727@flux.etl.go.jp> Date: Fri, 25 May 2001 11:10:18 +0900 (JST) From: akr@m17n.org Reply-To: akr@m17n.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/27630: mktime problem. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 27630 >Category: bin >Synopsis: mktime failure. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 24 19:20:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Tanaka Akira >Release: FreeBSD 4.2-RELEASE i386 >Organization: m17n >Environment: FreeBSD flux 4.2-RELEASE FreeBSD 4.2-RELEASE #2: Fri Jan 12 22:55:02 JST 2001 akr@flux:/usr/src/sys/compile/AKR i386 >Description: mktime(3) fails on some condition. For example, TZ=Africa/Monrovia, 1972/05/01 00:44:30 cannot be converted to time_t. Since this example is taken from `zdump -v Africa/Monrovia' and it is after Epoch, there is no reason to fail. Actually, I tested all time listed in `zdump -v' for each timezone in /usr/share/zoneinfo and found many failures. Above failure is one of them. >How-To-Repeat: % cat tst.c #include #include int main() { struct tm a; time_t t; a.tm_year = 1972 - 1900; a.tm_mon = 5 - 1; a.tm_mday = 1; a.tm_hour = 0; a.tm_min = 44; a.tm_sec = 30; a.tm_wday = 0; a.tm_yday = 0; a.tm_isdst = -1; t = mktime(&a); if (t == -1) { perror("mktime"); exit(1); } printf("no problem\n"); return 0; } % gcc tst.c % TZ=Africa/Monrovia ./a.out mktime: Undefined error: 0 % >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message