tzdata info for WGT/WGST broken

Bug #1734967 reported by Thomas M Steenholdt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
New
Undecided
Unassigned
php7.0 (Debian)
Fix Released
Unknown
php7.0 (Ubuntu)
New
Undecided
Unassigned
php7.1 (Ubuntu)
New
Undecided
Unassigned
tzdata (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Using "America/Godthab" timezone, "WGT/WGST" is no longer displayed from date command but instead just "-03". Problem is evident in PHP applications too, which now think we're in Sao Paolo.

This appears to have changed with latest tzdata update or perhaps in combination with change from DST.

Same problem on 16.04, 17.10 and Debian 9.

Tags: artful xenial
Revision history for this message
Eric Desrochers (slashd) wrote :

Hi Thomas,

I have verified and I confirm this is not a bug, this change was done in tzdata upstream intentionally. If you think this change cause a regression, the first step would be to report it to tzdata upstream.

commit 2999bb5bee719acbba8b9dd50fb9fb00c7788623
Author: Paul Eggert <email address hidden>
Date: Tue Dec 27 23:14:02 2016 -0800

    Remove some invented abbreviations in ‘europe’

    * NEWS: Document this.
    * europe (America/Danmarkshavn, America/Scoresbysund, America/Godthab)
    (Atlantic/Reykjavik, Europe/Amsterdam, Atlantic/Azores)
    (Atlantic/Madeira, Europe/Zaporozhye):
    Use numeric time zone abbreviations instead of invented ones,
    for time zones with UT offsets that are integer minutes.
    ...

 Zone America/Godthab -3:26:56 - LMT 1916 Jul 28 # Nuuk
- -3:00 - WGT 1980 Apr 6 2:00
- -3:00 EU WG%sT
+ -3:00 - -03 1980 Apr 6 2:00
+ -3:00 EU -03/-02

- Eric

Changed in tzdata (Ubuntu):
status: New → Invalid
Revision history for this message
Eric Desrochers (slashd) wrote :

I'll set this bug as affecting php package, since this tzdata change is modifying the behaviour of php timezone.

## REPRODUCER ##

ubuntu@trusty:~# sudo ln -sf /usr/share/zoneinfo/America/Godthab /etc/localtime

ubuntu@trusty:~# reboot

ubuntu@trusty:~# ls -altr /etc/localtime
lrwxrwxrwx 1 root root 35 Nov 29 10:34 /etc/localtime -> /usr/share/zoneinfo/America/Godthab

ubuntu@trusty:~# date
Wed Nov 29 11:01:30 -03 2017

ubuntu@trusty:~# php /tmp/php_tz.php
America/Sao_Paulo

#/tmp/php_tz.php :

<?php
$script_tz = date_default_timezone_get();

echo $script_tz;
?>

- Eric

Revision history for this message
Nish Aravamudan (nacc) wrote :

Just to be clear, this isn't a bug based upon comment 1 but new tasks were opened in comment 2?

If it's purely an SRU regression in tzdata that should be figured out.

Im guessing this is an upstream php issue. Has it been fixed there?

Revision history for this message
Eric Desrochers (slashd) wrote :

Thomas,

I think the next step here is to verify if latest and greatest php upstream version have the same behaviour with the above tzdata upstream change.

This will tell us if the situation has been already addressed (intentionally or by happenstance) upstream or not.

I'm also afraid this change might impact other packages like php relying on "WGT" & "WGST".

Feel free to Affect other packages if you notice other similar cases with other packages.

- Eric

Revision history for this message
Eric Desrochers (slashd) wrote :

Took from Ubuntu php7 source code :

# ext/date/lib/timezonemap.h
1718 { "wgst", 1, -7200, "America/Godthab" },
1719 { "wgst", 1, -7200, "America/Danmarkshavn" },
1720 { "wgt", 0, -10800, "America/Godthab" },

Clearly php is expecting to get "wgt" & "wgts" value.

Let us know the outcome of testing the latest upstream php version.

tags: added: artful xenial
Revision history for this message
Eric Desrochers (slashd) wrote :

I have compile the php upstream source code from : https://github.com/php/php-src

# php --version
PHP 7.3.0-dev (cli) (built: Nov 30 2017 14:52:31) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2017 Zend Technologies

# date
Thu Nov 30 12:23:30 -03 2017

#php php_tz.php
UTC

I'll do a bisection, and will update the bug.

- Eric

Revision history for this message
Eric Desrochers (slashd) wrote :

At code inspection I have strong believe this commit is the one changing the behaviour between comment #2 (America/Sao_Paulo) and comment#6 (UTC)

* 8e3260376c Update timezonemap.h, which needs to match

commit 8e3260376c65b762a51eee7c30ab560dadefa1f6
Author: Derick Rethans <email address hidden>
Date: Tue Oct 24 14:55:13 2017 +0100

    Update timezonemap.h, which needs to match the bundled TZ db

...
- { "wgst", 1, -7200, "America/Godthab" },
- { "wgt", 0, -10800, "America/Godthab" },
...

$ git tag --contains 8e3260376c
php-7.0.26
php-7.0.26RC1
php-7.1.12
php-7.1.12RC1
php-7.2.0
php-7.2.0RC5
php-7.2.0RC6

It seems like this update has been backported in upstream 7.0, 7.1, ... ~1month ago.

This would possibly need an SRU to adapt our different PHP package version where it applies to stay align with new tzdata package.

- Eric

Revision history for this message
Eric Desrochers (slashd) wrote :

I'll try to do more testing to conclude my assumption and see if anything else is needed.

Meanwhile I have reported a bug in debbug :
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=883209

- Eric

Changed in php7.0 (Debian):
status: Unknown → New
Revision history for this message
Nish Aravamudan (nacc) wrote : Re: [Bug 1734967] Re: tzdata info for WGT/WGST broken

Is this already fixed in proposed (MRE to latest upstream php 7.0 and 7.1)?

On Dec 1, 2017 03:48, "Bug Watch Updater" <email address hidden>
wrote:

> ** Changed in: php7.0 (Debian)
> Status: Unknown => New
>
> --
> You received this bug notification because you are subscribed to php7.1
> in Ubuntu.
> Matching subscriptions: PHP7.0
> https://bugs.launchpad.net/bugs/1734967
>
> Title:
> tzdata info for WGT/WGST broken
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1734967/+subscriptions
>

Revision history for this message
Eric Desrochers (slashd) wrote :

Nish,

Sorry if I didn't mention it earlier but I am able to reproduce in debian/unstable and ubuntu/bionic with php7.1.

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Bionic Beaver (development branch)
Release: 18.04
Codename: bionic

# rmadison php7.1
 php7.1 | 7.1.11-0ubuntu2 | bionic | source, all

# dpkg (php7.1)
ii php7.1 7.1.11-0ubuntu2 all server-side, HTML-embedded scripting language (metapackage)
ii php7.1-cli 7.1.11-0ubuntu2 amd64 command-line interpreter for the PHP scripting language
ii php7.1-common 7.1.11-0ubuntu2 amd64 documentation, examples and common module for PHP
ii php7.1-json 7.1.11-0ubuntu2 amd64 JSON module for PHP
ii php7.1-opcache 7.1.11-0ubuntu2 amd64 Zend OpCache module for PHP
ii php7.1-readline 7.1.11-0ubuntu2 amd64 readline module for PHP

## dpkg (tzdata)
ii tzdata 2017c-1 all time zone and daylight-saving time data

# php --version
PHP 7.1.11-0ubuntu2 (cli) (built: Nov 7 2017 09:01:09) ( NTS )

# php /tmp/tz.php
America/Sao_Paulo

The tz bundle update [8e32603] has been first introduced in "php-7.1.12".

Revision history for this message
Eric Desrochers (slashd) wrote :

I just notice a new version of php in debian was release --> 7.1.12-1 (sid)

I'll give it a try today and see if problem still persist or not. This one should include the tz bundle change.

https://buildd.debian.org/status/logs.php?pkg=php7.1

- Eric

Revision history for this message
Eric Desrochers (slashd) wrote :

Same thing with new php pkg release in debian/unstable (php - 7.1.12-1).
It still displays America/Sao_Paulo

That exclude my theory about the tz bundle update. I'll do a proper bisect next week.

- Eric

Revision history for this message
Nish Aravamudan (nacc) wrote :

Does the Ubuntu php build use the bundled tzdata? A lot of stuff comes from
the system not the source (e.g, pcre iirc)

On Dec 1, 2017 18:40, "Eric Desrochers" <email address hidden>
wrote:

> Same thing with new php pkg release in debian/unstable (php - 7.1.12-1).
> It still displays America/Sao_Paulo
>
> That exclude my theory about the tz bundle update. I'll do a proper
> bisect next week.
>
> - Eric
>
> --
> You received this bug notification because you are subscribed to php7.1
> in Ubuntu.
> Matching subscriptions: PHP7.0
> https://bugs.launchpad.net/bugs/1734967
>
> Title:
> tzdata info for WGT/WGST broken
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1734967/+subscriptions
>

Revision history for this message
Eric Desrochers (slashd) wrote :

Nish,

Yes the Ubuntu php build is configure with tzdata as follow :

debian/rules: --with-system-tzdata

and tzdata is a Depends: for a quit some derived binary package of php.

(The above is observation from bionic php7.1 source pkg)

# debian/php-common.README.Debian
----------------------------------------------------------------------
Timezone data from system timezone database
----------------------------------------------------------------------

  Debian PHP has been patched to use the system wide timezone database
  from the tzdata package, making sure any updates there are
  automatically used by PHP as well.

  Note that this requires that the PHP process has access to
  /etc/localtime and /usr/share/zoneinfo. For any regular installation
  this should be the case, but in specific secured environments when
  reading the timezone database is impossible PHP will give a
  "Timezone database is corrupt - this should *never* happen!" error.
----------------------------------------------------------------------

- Eric

Revision history for this message
Thomas M Steenholdt (tmus) wrote :

Hi guys,

The removal of WGT/WGST from tzdata is crazy to me. Living in Greenland, I can imagine a bunch of different issues this will cause, so I'll try to figure out what is going on and what possibilities we have of rectifying it. Starting with upstream.

/Thomas

Revision history for this message
Eric Desrochers (slashd) wrote :

The more I look into this the more I start to think it may not be a php bug as I first guess.
php is relying on tzdata package so it should follow what tzdata bundle has in hand.

I wonder if the change I mentioned in Comment#1 is valid and/or if it has the appropriate informations for "America/Godthab", because for the moment it seems to share similar value as southamerica locations "America/Sao_Paulo" which I wonder if this could be the reason why it conflicts. If it's not conflicting or something not well taken into account.

Note that if I set the localtime to "America/Sao_Paulo", I don't see any conflict.
So it is really when "America/Godthab" is set and/or possibly other invented 'europe' abbreviation adjust in the same commit.

@Thomas,
At this stage, I would contact upstream ML (if any) or the author of the patch :
Paul Eggert <email address hidden>

----------------------
# filename: europe
Zone America/Godthab -3:26:56 - LMT 1916 Jul 28 # Nuuk
                        -3:00 - -03 1980 Apr 6 2:00
                        -3:00 EU -03/-02

# filename: southamerica
Zone America/Sao_Paulo -3:06:28 - LMT 1914
                        -3:00 Brazil -03/-02 1963 Oct 23 0:00
                        -3:00 1:00 -02 1964
                        -3:00 Brazil -03/-02

----------------------

# strings /usr/share/zoneinfo/America/Sao_Paulo
<-03>3<-02>,M10.3.0/0,M2.3.0/0

# strings /usr/share/zoneinfo/America/Godthab
<-03>3<-02>,M3.5.0/-2,M10.5.0/-1

----------------------

# ln -sf /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime

# date
Mon Dec 4 13:53:33 -02 2017

# php tz.php
America/Sao_Paulo

Revision history for this message
Thomas M Steenholdt (tmus) wrote :

I have started a dialogue on the TZ mailinglist to perhaps have the
change (WGT/WGST at least) reverted. That's my goal anyway, so we'll see
how it goes.

/Thomas

Changed in php7.0 (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.