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

Bug#1001774: marked as done (tm_isdst=1 with mktime produces unexpected output )



Your message dated Wed, 22 Dec 2021 12:22:59 +0100
with message-id <YcMKkzA9y4N8cjeE@aurel32.net>
and subject line Re: Bug#1001774: tm_isdst=1 with mktime produces unexpected output
has caused the Debian Bug report #1001774,
regarding tm_isdst=1 with mktime produces unexpected output 
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1001774: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001774
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: glibc
Version: 2.31

Use of mktime with tm_isdst=1 results in -1 indicating an error. This appears unexpected, and cannot be replicated on OS X 11.6.1, Centos 7.9, Fedora 35, Alpine or RHEL 8. The issue was first observed on Github Actions ubuntu-latest (20.04). 

This issue was originally opened on the CPython bug tracker. They advised opening a bug report with both Ubuntu and Debian. The original report with CPython can be found here:

https://bugs.python.org/issue44413

An example C program follows at the end of the bug report, and can be compiled with “gcc bug.c -o bug”. 

An example of execution of the bug, and failure, within a glibc 2.31 environment can be found here:

https://github.com/wasade/cpython/runs/4541212472?check_suite_focus=true#step:17:57

Thank you for your time. Please let me know if additional information would be helpful. This is my first bug report to Debian. Though I reviewed the guidance docs, I apologize in advance if I overlooked something.
-Daniel

#include <time.h>
#include <stdio.h>

void do_test() {
  struct tm tm_works = { .tm_year=117,
                         .tm_mon=4,
                         .tm_mday=26,
                         .tm_hour=15,
                         .tm_min=30,
                         .tm_sec=16,
                         .tm_wday=4,
                         .tm_yday=145,
                         .tm_isdst=-1 };
  
  struct tm tm_fails = { .tm_year=117,
                         .tm_mon=4,
                         .tm_mday=26,
                         .tm_hour=15,
                         .tm_min=30,
                         .tm_sec=16,
                         .tm_wday=4,
                         .tm_yday=145,
                         .tm_isdst=1 };

  time_t works = mktime(&tm_works);
  time_t fails = mktime(&tm_fails);

  if(works == -1) {
      printf("Unexpected failure\n");
  } else {
      if(works == fails) {
          printf("Test passed\n");
      } else {
          printf("Test failed: works=%d; fails=%d\n", (int)works, (int)fails);
      }
  }
}

int main(int argc, char **argv) {
    do_test();
}

--- End Message ---
--- Begin Message ---
On 2021-12-20 14:01, Daniel McDonald wrote:
> Dear Aurelien,
> 
> Great, thank you. This is definitive. I will follow up on the ubuntu and cpython reports referencing the resolution here. 
> 

Thanks for the heads up. I am tehrefore closing the bug.

Regards,
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

--- End Message ---

Reply to: