NetBSD Problem Report #50133

From martin@aprisoft.de  Thu Aug  6 15:29:39 2015
Return-Path: <martin@aprisoft.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 3B536A57FD
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  6 Aug 2015 15:29:39 +0000 (UTC)
Message-Id: <20150806152927.4C0E5ED0E4F@emmas.aprisoft.de>
Date: Thu,  6 Aug 2015 17:29:27 +0200 (CEST)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: perl's setenv is incompatible with NetBSD
X-Send-Pr-Version: 3.95

>Number:         50133
>Category:       pkg
>Synopsis:       perl's setenv is incompatible with NetBSD
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    martin
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 06 15:30:00 +0000 2015
>Closed-Date:    
>Last-Modified:  Sun Mar 06 18:05:01 +0000 2016
>Originator:     Martin Husemann
>Release:        NetBSD 7.99.20
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD whoever-brings-the-night.aprisoft.de 7.99.20 NetBSD 7.99.20 (WHOEVER) #71: Fri Jul 31 09:31:00 CEST 2015 martin@seven-days-to-the-wolves.aprisoft.de:/ssd/src/sys/arch/sparc64/compile/WHOEVER sparc64
Architecture: sparc64
Machine: sparc64
>Description:

Triggered by investigating a failing perl test on -current:

perl -e '$ENV{TZ} = "GMT-5"; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); print "$hour\n";$ENV{TZ} = "GMT+5"; ($sec,$min,$hour2,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); print "$hour2\n";'
20
20

This should print two hour values 10 hours apart and does so on netbsd-6, but
fails in -current and netbsd-7.

Note that a proper C test program (either using setenv(3) or putenv(3)) does
work:

#include <time.h>
#include <stdio.h>
#include <stdlib.h>

static void test(void)
{
        time_t now;
        struct tm *t;

        time(&now);
        t = localtime(&now);
        printf("hour: %d\n", t->tm_hour);
}

int main(int argc, char **argv)
{
        putenv("TZ=GMT-5");
        test();
        putenv("TZ=GMT+5");
        test();
        return 0;
}


Perl seems to manualy play games with "environ".

>How-To-Repeat:
s/a

>Fix:
n/a

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->pkgsrc-p5-people
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Sat, 08 Aug 2015 12:33:45 +0000
Responsible-Changed-Why:
Perl problem.


State-Changed-From-To: open->feedback
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sat, 08 Aug 2015 12:33:45 +0000
State-Changed-Why:
This is an upstream perl bug, not strictly a pkgsrc issue.
Did you report it upstream?


Responsible-Changed-From-To: pkgsrc-p5-people->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Sat, 20 Feb 2016 16:40:26 +0000
Responsible-Changed-Why:
Take


State-Changed-From-To: feedback->open
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sat, 20 Feb 2016 16:40:26 +0000
State-Changed-Why:
Not much hope in filing it upstream w/o patches


From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50133 CVS commit: src/lib/libc/time
Date: Sat, 20 Feb 2016 15:11:38 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Sat Feb 20 20:11:37 UTC 2016

 Modified Files:
 	src/lib/libc/time: localtime.c

 Log Message:
 PR/50133: Martin Husemann: Can't cache $TZ.
 XXX: Pullup-7


 To generate a diff of this commit:
 cvs rdiff -u -r1.100 -r1.101 src/lib/libc/time/localtime.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50133 CVS commit: [netbsd-7] src/lib/libc/time
Date: Sun, 6 Mar 2016 18:01:48 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Mar  6 18:01:48 UTC 2016

 Modified Files:
 	src/lib/libc/time [netbsd-7]: localtime.c

 Log Message:
 Pull up following revision(s) (requested by christos in ticket #1121):
 	lib/libc/time/localtime.c: revision 1.101
 PR/50133: Martin Husemann: Can't cache $TZ.
 XXX: Pullup-7


 To generate a diff of this commit:
 cvs rdiff -u -r1.82.2.1 -r1.82.2.2 src/lib/libc/time/localtime.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.