Bug 30839 - TimeZone-related code fails on PPC64 little-endian if "TZ" env is not set
Summary: TimeZone-related code fails on PPC64 little-endian if "TZ" env is not set
Status: RESOLVED DUPLICATE of bug 30360
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib (show other bugs)
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: marcos.henrich
URL:
Depends on:
Blocks:
 
Reported: 2015-06-05 08:04 UTC by Jo Shields
Modified: 2015-06-08 03:33 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 30360

Description Jo Shields 2015-06-05 08:04:25 UTC
This is bizarre.

If TZ is set to the value in /etc/timezone, it;s fine.

If TZ is set to a different valid timezone, it's fine.

If TZ is set to a garbage value that doesn't exist, it's fine.

If TZ is not set, exception.

minicloud@debianle:/tmp$ TZ=America/Sao_Paulo mono tztest.exe 
6/5/2015 10:14:00 AM
minicloud@debianle:/tmp$ cat /etc/timezone 
America/Sao_Paulo
minicloud@debianle:/tmp$ mono tztest.exe 

Unhandled Exception:
System.TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException' was thrown.
Comment 1 Jo Shields 2015-06-05 10:29:27 UTC

*** This bug has been marked as a duplicate of bug 30360 ***
Comment 2 Marcin Cieślak 2015-06-08 03:32:35 UTC
It occurs to me that only /etc/localtime and /usr/share/zoneinfo/... are tried, /etc/timezone is not used at all. Note they are different: /etc/timezone contains the name of the zone, and /etc/localtime.

I can see that /etc/timezone is a debianism, and debian's tzsetup updates *both* /etc/timezone and /etc/localtime, the latter should work with Mono.

I'd say supporting /etc/timezone is a non-standard extension that is not necessary for most cases (are there relatively modern systems setting /etc/timezone and not setting /etc/localtime?)
Comment 3 Marcin Cieślak 2015-06-08 03:33:08 UTC
Note they are different: /etc/timezone contains the name of the zone, and /etc/localtime contains the actual time zone data.