Bug 1149375
Summary: | Time::Local patch for year 2038 on 64 bit breaks timelocal | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Dennis van Dok <dennisvd> | ||||||
Component: | perl | Assignee: | perl-maint-list | ||||||
Status: | CLOSED ERRATA | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | urgent | ||||||||
Version: | 5.11 | CC: | bgollahe, charlieb-redhat-bugzilla, cww, dkochuka, jherrman, jkurik, jorton, jrarnold, juanino, lzachar, msaxena, ppisar, psabata | ||||||
Target Milestone: | rc | Keywords: | Patch, Regression | ||||||
Target Release: | --- | ||||||||
Hardware: | x86_64 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | perl-5.8.8-43.el5_11 | Doc Type: | Bug Fix | ||||||
Doc Text: |
Prior to this update, faulty adjustments for allowable epoch values led to integer overflows. As a consequence, calling the Time::Local::timelocal() Perl function on a 64-bit platform printed a number of warning messages along with its intended output. With this update, the mentioned adjustments have been removed and calling Time::Local::timelocal() now prints only the expected output.
|
Story Points: | --- | ||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2014-10-30 14:19:16 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Dennis van Dok
2014-10-03 23:30:12 UTC
Thank you for the report. Please contact Red Hat support to justify your business case properly. This warning was fixed by following upstream commit in Time-Local-1.12_01: commit 1c71e5bc5b789414e43c53776cc396aeeeda48fc Author: Dave Rolsky <autarch> Date: Fri Mar 31 09:11:34 2006 +0000 revert lots of earlier changes about extending range around edges merge warn with croak doc tweaks to remove suggestion that nocheck versions should be used for doing datetime math diff --git a/Changes b/Changes index ec1093b..d5a3bdc 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,14 @@ +1.12_01 2006-03-31 + +- Reverted changes from 1.07_90 that attempted to extend range of +allowable epoch values around edge cases. It turns out that this was +causing integer overflows + +- In one error case, the module could warn and then croak. I changed +it to simply croak with the whole message. Based on a patch by Michael +Schwern from rt.perl.org #36268. + + The only relevant change is actually removing the _zoneadjust() calls in the timelocal() because "this was causing integer overflows". The upstream change can be viewed better as difference between commits d34123b..1c71e5b. Created attachment 945048 [details]
Upstream fix ported to Time-Local-1.11 as delivered by perl-5.8.8
How to test: (1) Run command: $ TZ=UTC perl -w -MTime::Local -e 'print timelocal(0,0,0,3,9,114), qq{\n};' (2) Check the standard output. There is only one line equaled to "2148595200" string. (3) Check the error output. Before: A lot of warnings like "Use of uninitialized value in integer addition (+) at /usr/lib/perl5/5.8.8/Time/Local.pm line 81." is printed. See comment #1. After: The error output is empty. You should also check some dates for year after 2038-01-01. Please note they should work only on 64-bit platforms. See bug #1057047. You should also test different time zones because timelocal() is sensitive to it. E.g. TZ=Europe/Prague should return "2148591600". Created attachment 948549 [details]
Upstream fix ported to Time-Local-1.11 and perl-5.8.8
This patch adds a modification to internal test suite as commited by upstream. It removes two tests checking for usability of exact maximal 31-bit values. These test would fail on 32-bit platform because this patch removes adjustments for time zone offsets, so the now-usable values vary on time zone. Therefore the code cuts unacceptable values one day before using up whole 31-bit value.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2014-1761.html |