pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/50133: perl's setenv is incompatible with NetBSD



>Number:         50133
>Category:       pkg
>Synopsis:       perl's setenv is incompatible with NetBSD
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 06 15:30:00 +0000 2015
>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@localhost:/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



Home | Main Index | Thread Index | Old Index