public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/108211] New: std::chrono::current_zone() fails if zone only has one component
@ 2022-12-23 14:34 redi at gcc dot gnu.org
  2022-12-23 14:34 ` [Bug libstdc++/108211] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-12-23 14:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108211

            Bug ID: 108211
           Summary: std::chrono::current_zone() fails if zone only has one
                    component
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

$ ls -l /etc/localtime
lrwxrwxrwx. 1 root root 25 Mar 15  2017 /etc/localtime ->
../usr/share/zoneinfo/UTC


Libstdc++ incorrectly assumes the local timezone will be "foo/bar" and so it
breaks for "UTC" or any other name without a slash in it.

terminate called after throwing an instance of 'std::runtime_error'
  what():  tzdb: cannot determine current zone


This causes:

FAIL: std/time/tzdb/1.cc execution test
FAIL: std/time/zoned_time/custom.cc execution test

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/108211] std::chrono::current_zone() fails if zone only has one component
  2022-12-23 14:34 [Bug libstdc++/108211] New: std::chrono::current_zone() fails if zone only has one component redi at gcc dot gnu.org
@ 2022-12-23 14:34 ` redi at gcc dot gnu.org
  2022-12-23 23:46 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-12-23 14:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108211

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
   Target Milestone|---                         |13.0
   Last reconfirmed|                            |2022-12-23
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/108211] std::chrono::current_zone() fails if zone only has one component
  2022-12-23 14:34 [Bug libstdc++/108211] New: std::chrono::current_zone() fails if zone only has one component redi at gcc dot gnu.org
  2022-12-23 14:34 ` [Bug libstdc++/108211] " redi at gcc dot gnu.org
@ 2022-12-23 23:46 ` redi at gcc dot gnu.org
  2023-01-05  0:53 ` cvs-commit at gcc dot gnu.org
  2023-01-05  0:55 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-12-23 23:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108211

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The obvious solution is to try locate_zone(dir/filename) and if that fails try
locate_zone(filename).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/108211] std::chrono::current_zone() fails if zone only has one component
  2022-12-23 14:34 [Bug libstdc++/108211] New: std::chrono::current_zone() fails if zone only has one component redi at gcc dot gnu.org
  2022-12-23 14:34 ` [Bug libstdc++/108211] " redi at gcc dot gnu.org
  2022-12-23 23:46 ` redi at gcc dot gnu.org
@ 2023-01-05  0:53 ` cvs-commit at gcc dot gnu.org
  2023-01-05  0:55 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-05  0:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108211

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:56be1970765b6302de19977790a537d6feaaa34b

commit r13-5004-g56be1970765b6302de19977790a537d6feaaa34b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Jan 4 20:49:59 2023 +0000

    libstdc++: Support single components in name of chrono::current_zone()
[PR108211]

    We currently only handle the case where /etc/localtime is a symlink to a
    path like ".../Etc/UTC" and fail for ".../UTC". This makes both work.

    libstdc++-v3/ChangeLog:

            PR libstdc++/108211
            * src/c++20/tzdb.cc (chrono::current_zone()): Check for zone
            using only last component of the name.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/108211] std::chrono::current_zone() fails if zone only has one component
  2022-12-23 14:34 [Bug libstdc++/108211] New: std::chrono::current_zone() fails if zone only has one component redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-01-05  0:53 ` cvs-commit at gcc dot gnu.org
@ 2023-01-05  0:55 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2023-01-05  0:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108211

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-05  0:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-23 14:34 [Bug libstdc++/108211] New: std::chrono::current_zone() fails if zone only has one component redi at gcc dot gnu.org
2022-12-23 14:34 ` [Bug libstdc++/108211] " redi at gcc dot gnu.org
2022-12-23 23:46 ` redi at gcc dot gnu.org
2023-01-05  0:53 ` cvs-commit at gcc dot gnu.org
2023-01-05  0:55 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).