public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/108530] New: [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae
@ 2023-01-24 19:46 seurer at gcc dot gnu.org
  2023-01-24 20:16 ` [Bug libstdc++/108530] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: seurer at gcc dot gnu.org @ 2023-01-24 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108530
           Summary: [13 regression] std/time/tzdb/1.cc fails after
                    r13-5168-g559993b85744ae
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:559993b85744ae09d33eedb1cb062392ac482f94, r13-5168-g559993b85744ae

This started failing on one of our older (power 7 BE) servers after this
commit.  Does the change maybe require something not supported here (an older
SUSE distro)?

make  -k check RUNTESTFLAGS="conformance.exp=std/time/tzdb/1.cc"
FAIL: std/time/tzdb/1.cc execution test
# of expected passes            1
# of unexpected failures        1


terminate called after throwing an instance of 'std::runtime_error'
  what():  tzdb: cannot determine current zone
FAIL: std/time/tzdb/1.cc execution test


std/time/zoned_time/custom.cc also fails now with the same error.


commit 559993b85744ae09d33eedb1cb062392ac482f94
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sat Jan 14 13:33:58 2023 +0000

    libstdc++: Embed a static copy of tzdata.zi

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

* [Bug libstdc++/108530] [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae
  2023-01-24 19:46 [Bug libstdc++/108530] New: [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae seurer at gcc dot gnu.org
@ 2023-01-24 20:16 ` redi at gcc dot gnu.org
  2023-01-24 21:20 ` seurer at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2023-01-24 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

I think those tests were being skipped as UNSUPPORTED before that commit. The
point of the commit was to enable these features on systems that don't provide
a tzdata.zi file.

What does 'ls -l /etc/localtime' show on that box? Is it a regular file,
instead of a symlink to a file under /use/share/zoneinfo ?

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

* [Bug libstdc++/108530] [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae
  2023-01-24 19:46 [Bug libstdc++/108530] New: [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae seurer at gcc dot gnu.org
  2023-01-24 20:16 ` [Bug libstdc++/108530] " redi at gcc dot gnu.org
@ 2023-01-24 21:20 ` seurer at gcc dot gnu.org
  2023-01-24 23:21 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: seurer at gcc dot gnu.org @ 2023-01-24 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from seurer at gcc dot gnu.org ---
Yes it is a regular file.

With the previous commit it wasn't UNSUPPORTED and worked just fine:

g:ff6c7617102df365918402c6ccc8e497c47dbe60, r13-5167-gff6c7617102df3
make  -k check RUNTESTFLAGS="conformance.exp=std/time/tzdb/1.cc"
# of expected passes            2


This is quite an old system (it's soon to be retired) and I don't see the issue
elsewhere.

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

* [Bug libstdc++/108530] [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae
  2023-01-24 19:46 [Bug libstdc++/108530] New: [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae seurer at gcc dot gnu.org
  2023-01-24 20:16 ` [Bug libstdc++/108530] " redi at gcc dot gnu.org
  2023-01-24 21:20 ` seurer at gcc dot gnu.org
@ 2023-01-24 23:21 ` redi at gcc dot gnu.org
  2023-01-24 23:42 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2023-01-24 23:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-01-24
           Keywords|                            |testsuite-fail

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to seurer from comment #2)
> Yes it is a regular file.
> 
> With the previous commit it wasn't UNSUPPORTED and worked just fine:

Ah, because rather than being UNSUPPORTED, the test was skipping some checks
via #if


// { dg-additional-options "-DHAVE_TZDB" { target tzdb } }

void
test_current()
{
#ifdef HAVE_TZDB
  const tzdb& db = get_tzdb();
  const time_zone* tz = db.current_zone();
  VERIFY( tz == std::chrono::current_zone() );
#endif
}

Previously this machine did not match the effective target tzdb, and so
std::chrono::current_zone() was not tested. Now it matches the et, and so that
function is tested.

And because it's a regular file, that function doesn't work, so we get a FAIL
now. I should really have split that test into two files, one that tests the
always-available functionality and one which depends on effective target tzdb.
That would have gone from UNSUPPORTED to FAIL for the latter test, instead of
the confusing PASS -> FAIL case we have now for something that never actually
worked.

PR 108409 tracks some other causes of that function not working, but this one
is different. And that reminds me I've seen this before: gcc303 in the compile
farm is a FreeBSD 13.0 system, and /etc/localtime is a regular file there too:

$ ssh gcc303 file /etc/localtime
/etc/localtime: timezone data, version 2, 1 gmt time flag, 1 std time flag, no
leap seconds, no transition times, 1 abbreviation char

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

* [Bug libstdc++/108530] [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae
  2023-01-24 19:46 [Bug libstdc++/108530] New: [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-01-24 23:21 ` redi at gcc dot gnu.org
@ 2023-01-24 23:42 ` redi at gcc dot gnu.org
  2023-01-24 23:51 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2023-01-24 23:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
   Target Milestone|---                         |13.0

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I have a patch.

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

* [Bug libstdc++/108530] [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae
  2023-01-24 19:46 [Bug libstdc++/108530] New: [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae seurer at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-01-24 23:42 ` redi at gcc dot gnu.org
@ 2023-01-24 23:51 ` cvs-commit at gcc dot gnu.org
  2023-01-24 23:53 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-24 23:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:e00d5cafbe1a77772ecc57eec921ff0b7dd41344

commit r13-5339-ge00d5cafbe1a77772ecc57eec921ff0b7dd41344
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Jan 24 23:43:24 2023 +0000

    libstdc++: Use /etc/sysconfig/clock for std::chrono::current_zone()
[PR108530]

    On some systems /etc/localtime is a tzfile, not a symlink to one. We
    cannot use it to determine the current time zone in that case. See if
    /etc/sysconfig/clock sets the variable DEFAULT_TIMEZONE instead.

    libstdc++-v3/ChangeLog:

            PR libstdc++/108530
            * src/c++20/tzdb.cc (current_zone): Look for DEFAULT_TIMEZONE in
            /etc/sysconfig/clock.

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

* [Bug libstdc++/108530] [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae
  2023-01-24 19:46 [Bug libstdc++/108530] New: [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae seurer at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-01-24 23:51 ` cvs-commit at gcc dot gnu.org
@ 2023-01-24 23:53 ` redi at gcc dot gnu.org
  2023-01-25  7:37 ` rguenth at gcc dot gnu.org
  2023-01-26 13:38 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2023-01-24 23:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Should be fixed, if this works on that machine:

$ grep ^DEFAULT_TIMEZONE= /etc/sysconfig/clock
DEFAULT_TIMEZONE="UTC"

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

* [Bug libstdc++/108530] [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae
  2023-01-24 19:46 [Bug libstdc++/108530] New: [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae seurer at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-01-24 23:53 ` redi at gcc dot gnu.org
@ 2023-01-25  7:37 ` rguenth at gcc dot gnu.org
  2023-01-26 13:38 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-25  7:37 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* [Bug libstdc++/108530] [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae
  2023-01-24 19:46 [Bug libstdc++/108530] New: [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae seurer at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-01-25  7:37 ` rguenth at gcc dot gnu.org
@ 2023-01-26 13:38 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-26 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 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:93e2bf51dedd0870b78b770b72e34b15a7a0d14a

commit r13-5385-g93e2bf51dedd0870b78b770b72e34b15a7a0d14a
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jan 26 09:26:35 2023 +0000

    libstdc++: Fix strings read from /etc/sysconfig/clock [PR108530]

    In r13-5339-ge00d5cafbe1a77 I made std::chrono::current_zone() look for
    DEFAULT_TIMEZONE in /etc/sysconfig/clock but that is the wrong variable.
    Old Suse systems use TIMEZONE to determine which zone /etc/localtime is
    a copy of, and old RHEL system use ZONE.

    libstdc++-v3/ChangeLog:

            PR libstdc++/108530
            * src/c++20/tzdb.cc (current_zone): Look for TIMEZONE or ZONE in
            /etc/sysconfig/clock, not DEFAULT_TIMEZONE.

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

end of thread, other threads:[~2023-01-26 13:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24 19:46 [Bug libstdc++/108530] New: [13 regression] std/time/tzdb/1.cc fails after r13-5168-g559993b85744ae seurer at gcc dot gnu.org
2023-01-24 20:16 ` [Bug libstdc++/108530] " redi at gcc dot gnu.org
2023-01-24 21:20 ` seurer at gcc dot gnu.org
2023-01-24 23:21 ` redi at gcc dot gnu.org
2023-01-24 23:42 ` redi at gcc dot gnu.org
2023-01-24 23:51 ` cvs-commit at gcc dot gnu.org
2023-01-24 23:53 ` redi at gcc dot gnu.org
2023-01-25  7:37 ` rguenth at gcc dot gnu.org
2023-01-26 13:38 ` cvs-commit 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).