• 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/
      

            [RHEL-20522] get_tzdb_list() looks for zoneinfo data at the wrong path

            Errata Tool added a comment -

            Since the problem described in this issue should be resolved in a recent advisory, it has been closed.

            For information on the advisory (gcc-toolset-13-gcc bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2024:3011

            Errata Tool added a comment - Since the problem described in this issue should be resolved in a recent advisory, it has been closed. For information on the advisory (gcc-toolset-13-gcc bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2024:3011

            This should fix it:

            --- a/gcc.spec
            +++ b/gcc.spec
            @@ -927,7 +927,7 @@ CONFIGURE_OPTS="\
             %endif
                --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \
                --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only \
            -   --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=%{_datadir}/zoneinfo \
            +   --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=%{_root_datadir}/zoneinfo \
             %ifnarch %{mips}
                --with-linker-hash-style=gnu \
             %endif
            

            Marek Polacek added a comment - This should fix it: --- a/gcc.spec +++ b/gcc.spec @@ -927,7 +927,7 @@ CONFIGURE_OPTS="\ %endif --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \ --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only \ - --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=%{_datadir}/zoneinfo \ + --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=%{_root_datadir}/zoneinfo \ %ifnarch %{mips} --with-linker-hash-style=gnu \ %endif

              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: