public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug time/28707] New: assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later
@ 2021-12-17  0:49 hp at sourceware dot org
  2021-12-17  1:00 ` [Bug time/28707] " hp at sourceware dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hp at sourceware dot org @ 2021-12-17  0:49 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28707

            Bug ID: 28707
           Summary: assert in tzfile.c __tzfile_read striking with
                    truncated timezones generated by tzcode-2021d and
                    later
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: time
          Assignee: unassigned at sourceware dot org
          Reporter: hp at sourceware dot org
  Target Milestone: ---

Created attachment 13858
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13858&action=edit
git patch with test-case

When using a timezone file generated by the zic in IANA
tzcode-2021d a.k.a. tzlib-2021d (also in tzlib-2021e; current as
of this writing), glibc asserts in __tzfile_read (on
e.g. tzset() for this file) and you may find lines matching
"tzfile.c:435: __tzfile_read: Assertion `num_types == 1' failed"
in your syslog.

Attached is a test-case including the tzfile for Asuncion
generated by tzlib-2021e as follows, using the tzlib-2021e zic:
"zic -d DEST -r @1546300800 -L /dev/null -b slim
SOURCE/southamerica".  Note that in its type 2 header, it has
two entries in its "time-types" array (types), but only one
entry in its "transition types" array (type_idxs).

This is valid and expected already in the published RFC8536, and
not even frowned upon: "Local time for timestamps before the
first transition is specified by the first time type (time type
0)" ... "every nonzero local time type index SHOULD appear at
least once in the transition type array".  Note the "nonzero ...
index".  Until the 2021d zic, index 0 has been shared by the
first valid transition but with 2021d it's separate, set apart
as a placeholder and only "implicitly" indexed.  (A draft update
of the RFC mandates that the entry at index 0 is a placeholder
in this case, hence can no longer be shared.)

So, unless glibc is specifically intended only to be used with
timezone-files generated by its own zic (an older version of the
tzcode zic), as opposed to e.g. timezone-files generated by
current (IANA) tzcode otherwise following RFC8536, the assert is
invalid.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug time/28707] assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later
  2021-12-17  0:49 [Bug time/28707] New: assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later hp at sourceware dot org
@ 2021-12-17  1:00 ` hp at sourceware dot org
  2021-12-30 11:16 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hp at sourceware dot org @ 2021-12-17  1:00 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28707

Hans-Peter Nilsson <hp at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |https://sourceware.org/pipe
                   |                            |rmail/libc-alpha/2021-Decem
                   |                            |ber/134316.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug time/28707] assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later
  2021-12-17  0:49 [Bug time/28707] New: assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later hp at sourceware dot org
  2021-12-17  1:00 ` [Bug time/28707] " hp at sourceware dot org
@ 2021-12-30 11:16 ` cvs-commit at gcc dot gnu.org
  2021-12-30 11:24 ` adhemerval.zanella at linaro dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-30 11:16 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28707

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Adhemerval Zanella
<azanella@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ebe899af0dc3215159a9c896ac6f35b72a18cb6e

commit ebe899af0dc3215159a9c896ac6f35b72a18cb6e
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Fri Dec 17 21:45:54 2021 +0100

    timezone: test-case for BZ #28707

    This test-case is the tzfile for Asuncion generated by
    tzlib-2021e as follows, using the tzlib-2021e zic: "zic -d
    DEST -r @1546300800 -L /dev/null -b slim
    SOURCE/southamerica".  Note that in its type 2 header, it
    has two entries in its "time-types" array (types), but only
    one entry in its "transition types" array (type_idxs).

            * timezone/Makefile, timezone/tst-pr28707.c,
            timezone/testdata/gen-XT5.sh: New test.

    Co-authored-by: Christopher Wong <Christopher.Wong@axis.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug time/28707] assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later
  2021-12-17  0:49 [Bug time/28707] New: assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later hp at sourceware dot org
  2021-12-17  1:00 ` [Bug time/28707] " hp at sourceware dot org
  2021-12-30 11:16 ` cvs-commit at gcc dot gnu.org
@ 2021-12-30 11:24 ` adhemerval.zanella at linaro dot org
  2021-12-30 21:31 ` hp at sourceware dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2021-12-30 11:24 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28707

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.35
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg

--- Comment #2 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
Fixed on 2.35.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug time/28707] assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later
  2021-12-17  0:49 [Bug time/28707] New: assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later hp at sourceware dot org
                   ` (2 preceding siblings ...)
  2021-12-30 11:24 ` adhemerval.zanella at linaro dot org
@ 2021-12-30 21:31 ` hp at sourceware dot org
  2022-01-04 18:02 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hp at sourceware dot org @ 2021-12-30 21:31 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28707

--- Comment #3 from Hans-Peter Nilsson <hp at sourceware dot org> ---
For some reason only the test-case commit triggered bugzilla, so I'll mention
the sha for the commit to master of the actual fix too:
c36f64aa6dff13b12a1e03a185e75a50fa9f6a4c.
Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug time/28707] assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later
  2021-12-17  0:49 [Bug time/28707] New: assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later hp at sourceware dot org
                   ` (3 preceding siblings ...)
  2021-12-30 21:31 ` hp at sourceware dot org
@ 2022-01-04 18:02 ` fweimer at redhat dot com
  2022-01-04 18:03 ` fweimer at redhat dot com
  2022-01-07  9:41 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: fweimer at redhat dot com @ 2022-01-04 18:02 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28707

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
              Flags|                            |security-
           See Also|                            |https://bugzilla.redhat.com
                   |                            |/show_bug.cgi?id=2033648

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug time/28707] assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later
  2021-12-17  0:49 [Bug time/28707] New: assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later hp at sourceware dot org
                   ` (4 preceding siblings ...)
  2022-01-04 18:02 ` fweimer at redhat dot com
@ 2022-01-04 18:03 ` fweimer at redhat dot com
  2022-01-07  9:41 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: fweimer at redhat dot com @ 2022-01-04 18:03 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28707

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugzilla.redhat.com
                   |                            |/show_bug.cgi?id=2033649

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug time/28707] assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later
  2021-12-17  0:49 [Bug time/28707] New: assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later hp at sourceware dot org
                   ` (5 preceding siblings ...)
  2022-01-04 18:03 ` fweimer at redhat dot com
@ 2022-01-07  9:41 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-07  9:41 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28707

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.34/master branch has been updated by Florian Weimer
<fw@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d5ba02f67dd62a63e29c29eebd6c543722aa6b5b

commit d5ba02f67dd62a63e29c29eebd6c543722aa6b5b
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Fri Dec 17 21:45:54 2021 +0100

    timezone: test-case for BZ #28707

    This test-case is the tzfile for Asuncion generated by
    tzlib-2021e as follows, using the tzlib-2021e zic: "zic -d
    DEST -r @1546300800 -L /dev/null -b slim
    SOURCE/southamerica".  Note that in its type 2 header, it
    has two entries in its "time-types" array (types), but only
    one entry in its "transition types" array (type_idxs).

            * timezone/Makefile, timezone/tst-pr28707.c,
            timezone/testdata/gen-XT5.sh: New test.

    Co-authored-by: Christopher Wong <Christopher.Wong@axis.com>
    (cherry picked from commit ebe899af0dc3215159a9c896ac6f35b72a18cb6e)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-01-07  9:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17  0:49 [Bug time/28707] New: assert in tzfile.c __tzfile_read striking with truncated timezones generated by tzcode-2021d and later hp at sourceware dot org
2021-12-17  1:00 ` [Bug time/28707] " hp at sourceware dot org
2021-12-30 11:16 ` cvs-commit at gcc dot gnu.org
2021-12-30 11:24 ` adhemerval.zanella at linaro dot org
2021-12-30 21:31 ` hp at sourceware dot org
2022-01-04 18:02 ` fweimer at redhat dot com
2022-01-04 18:03 ` fweimer at redhat dot com
2022-01-07  9:41 ` 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).