Bug 25039 - mktime fails when .tm_isdst=1 on i686-linux-gnu with > 2.28-10
Summary: mktime fails when .tm_isdst=1 on i686-linux-gnu with > 2.28-10
Status: RESOLVED DUPLICATE of bug 24630
Alias: None
Product: glibc
Classification: Unclassified
Component: time (show other bugs)
Version: 2.29
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-26 11:32 UTC by winter-gcc
Modified: 2019-10-04 21:47 UTC (History)
0 users

See Also:
Host: i686-linux-gnu
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
Repro/Regression test, fails when isdst = 1 on > glibc 2.28-10 (346 bytes, text/x-csrc)
2019-09-26 11:32 UTC, winter-gcc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description winter-gcc 2019-09-26 11:32:15 UTC
Created attachment 12005 [details]
Repro/Regression test, fails when isdst = 1 on > glibc 2.28-10

Running test application on older glibc (2.28-10 Debian version):

# time in DST
$ ./a.out 1569497187
tzname[0] = CET
tzname[1] = CEST
timezone = -3600
daylight = 1
time   = 1569497187
.tm_isdst = 1
tzname[0] = UTC
tzname[1] = UTC
timezone = 0
daylight = 0
mktime = 1569504387 (time += 7200)
# time not in DST
$ ./a.out 1575198000
tzname[0] = CET
tzname[1] = CEST
timezone = -3600
daylight = 1
time   = 1575198000
.tm_isdst = 0
tzname[0] = UTC
tzname[1] = UTC
timezone = 0
daylight = 0
mktime = 1575201600 (time += 3600)

Regression with 2.29-2 (Debian version):

#  time in DST
$ ./a.out 1569497187
tzname[0] = CET
tzname[1] = CEST
timezone = -3600
daylight = 1
time   = 1569497187
.tm_isdst = 1
tzname[0] = UTC
tzname[1] = UTC
timezone = 0
daylight = 0
mktime = -1 (time += -1569497188)
# errno is EOVERFLOW

# time not in DST
$ ./a.out 1575198000
tzname[0] = CET
tzname[1] = CEST
timezone = -3600
daylight = 1
time   = 1575198000
.tm_isdst = 0
tzname[0] = UTC
tzname[1] = UTC
timezone = 0
daylight = 0
mktime = 1575201600 (time += 3600)

In compared the diff from 2.29-2 to git current master and could not detect meaningful changes so I believe this test case still fails / show the regression.
Comment 1 winter-gcc 2019-09-26 11:50:01 UTC
May I add that it is of course quite strange to set the timezone to default UTC (with no DST) and then require a DST-time to converted but the man page does not forbid it and it worked before.
If you want to break backward-compatibility please update man page and consider EINVAL instead of EOVERFLOW since the current errno suggests an overflow.
Comment 2 Andreas Schwab 2019-09-26 12:16:36 UTC
dup

*** This bug has been marked as a duplicate of bug 24630 ***