Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-20522

get_tzdb_list() looks for zoneinfo data at the wrong path

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Minor Minor
    • rhel-8.10
    • rhel-8.9.0
    • gcc-toolset-13-gcc
    • gcc-toolset-13-gcc-13.2.1-6.2.el8
    • None
    • Low
    • rhel-sst-pt-gcc
    • ssg_platform_tools
    • 21
    • 23
    • 1
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • All
    • None

      What were you trying to do that didn't work?

      The C++ function get_tzdb_list() does not return the expected result.

      Please provide the package NVR for which bug is seen:

      gcc-toolset-13-gcc-13.1.1-4.3.el8

      How reproducible:

      Always

      Steps to reproduce

      $ scl enable gcc-toolset-13 bash
      
      $ cat test_tzdb_list.cpp
      #include <iostream>
      #include <string>
      #include <string_view>
      #include <chrono>using namespace std;
      using namespace std::literals;
      using namespace std::chrono;int main()
      {
          for(const auto& l: get_tzdb_list())  {
              for(const auto& ll: l.zones) {
                  cout << ll.name() << endl;
              }
          }
      }
      
      $ g++ --std=c++23 -o test_tzdb_list test_tzdb_list.cpp
      
      $ ./test_tzdb_list

      Expected results

      $ ./test_tzdb_list
      Africa/Abidjan
      Africa/Algiers
      Africa/Bissau
      Africa/Cairo
      Africa/Casablanca
      ...
      Pacific/Tahiti
      Pacific/Tarawa
      Pacific/Tongatapu
      WET
      

      Actual results

      $ ./test_tzdb_list
      Etc/GMT
      Etc/UTC
      

      Additional information

      The problem happens because the implementation looks for the timezone data
      at /opt/rh/gcc-toolset-13/root/usr/share/zoneinfo, instead of at the system
      path, /usr/share/zoneinfo. It can be circumvented by creating a symbolic link:

      # ln -sr /usr/share/zoneinfo /opt/rh/gcc-toolset-13/root/usr/share/
      

              mpolacek@redhat.com Marek Polacek
              rhn-support-casantos Carlos Santos
              Marek Polacek Marek Polacek
              Vaclav Kadlcik Vaclav Kadlcik
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: