Bug 1322585 - glibc: strptime cannot parse strftime output in some locales
Summary: glibc: strptime cannot parse strftime output in some locales
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: glibc team
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-30 19:51 UTC by Carlos O'Donell
Modified: 2019-06-07 20:22 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1322292
Environment:
Last Closed: 2019-06-07 20:22:44 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Sourceware 19890 0 'P2' 'NEW' 'strptime() and strftime() symmetry and support of %x and %X' 2019-12-01 16:11:41 UTC

Description Carlos O'Donell 2016-03-30 19:51:04 UTC
+++ This bug was initially created as a clone of Bug #1322292 +++

Description of problem:

While testing ausearch time parsing we recently discovered that some locales have broken date and time. In particular, a time given by strftime() cannot be parsed correctly by strptime() afterwards. 

In RHEL-6.8 Snapshot 2.0 there are 50 such locales, the list of them is attached to this BZ. 

A test case for glibc prepared by Steve Grubb is attached to this BZ as well.

Version-Release number of selected component (if applicable):

glibc-2.12-1.192.el6

How reproducible:

100%

Steps to Reproduce:

1. Compile the test case into test binary.
2. execute it for each locale (for L in $(locale -a); do ./test $L; done)

Actual results:

50 broken locales, from ar_AE to my_MM.utf8.

Expected results:

No broken locales.

Additional info:

I would like to thank Steve to pointing to the issue and sharing the test case.

--- Additional comment from Ondrej Moriš on 2016-03-30 04:38 EDT ---



--- Additional comment from Ondrej Moriš on 2016-03-30 04:39 EDT ---



--- Additional comment from Carlos O'Donell on 2016-03-30 15:45:58 EDT ---

Upstream 2.22 has less broken locales:
Error converting time string to struct in gd_GB locale
Error converting time string to struct in gd_GB.iso885915 locale
Error converting time string to struct in gd_GB.utf8 locale
Error converting time string to struct in lzh_TW locale
Error converting time string to struct in lzh_TW.utf8 locale
Error converting time string to struct in my_MM locale
Error converting time string to struct in my_MM.utf8 locale

Same with upstream master (using a chroot script):
FAIL: Error converting time string to struct in gd_GB locale
FAIL: Error converting time string to struct in gd_GB.iso885915 locale
FAIL: Error converting time string to struct in gd_GB.utf8 locale
FAIL: Error converting time string to struct in lzh_TW locale
FAIL: Error converting time string to struct in lzh_TW.utf8 locale
FAIL: Error converting time string to struct in my_MM locale
FAIL: Error converting time string to struct in my_MM.utf8 locale

This is going to have to go upstream first.

Depending on the change the backport may not be suitable for RHEL6, but might be for RHEL7 (I'll clone to there next).

I filed an upstream bug.

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

--- Additional comment from Carlos O'Donell on 2016-03-30 15:50:32 EDT ---

RHEL 7 shows:

FAIL: Error converting time string to struct in ar_AE locale
FAIL: Error converting time string to struct in ar_AE.iso88596 locale
FAIL: Error converting time string to struct in ar_AE.utf8 locale
FAIL: Error converting time string to struct in ar_BH locale
FAIL: Error converting time string to struct in ar_BH.iso88596 locale
FAIL: Error converting time string to struct in ar_BH.utf8 locale
FAIL: Error converting time string to struct in ar_DZ locale
FAIL: Error converting time string to struct in ar_DZ.iso88596 locale
FAIL: Error converting time string to struct in ar_DZ.utf8 locale
FAIL: Error converting time string to struct in ar_EG locale
FAIL: Error converting time string to struct in ar_EG.iso88596 locale
FAIL: Error converting time string to struct in ar_EG.utf8 locale
FAIL: Error converting time string to struct in ar_IQ locale
FAIL: Error converting time string to struct in ar_IQ.iso88596 locale
FAIL: Error converting time string to struct in ar_IQ.utf8 locale
FAIL: Error converting time string to struct in ar_JO locale
FAIL: Error converting time string to struct in ar_JO.iso88596 locale
FAIL: Error converting time string to struct in ar_JO.utf8 locale
FAIL: Error converting time string to struct in ar_KW locale
FAIL: Error converting time string to struct in ar_KW.iso88596 locale
FAIL: Error converting time string to struct in ar_KW.utf8 locale
FAIL: Error converting time string to struct in ar_LB locale
FAIL: Error converting time string to struct in ar_LB.iso88596 locale
FAIL: Error converting time string to struct in ar_LB.utf8 locale
FAIL: Error converting time string to struct in ar_LY locale
FAIL: Error converting time string to struct in ar_LY.iso88596 locale
FAIL: Error converting time string to struct in ar_LY.utf8 locale
FAIL: Error converting time string to struct in ar_MA locale
FAIL: Error converting time string to struct in ar_MA.iso88596 locale
FAIL: Error converting time string to struct in ar_MA.utf8 locale
FAIL: Error converting time string to struct in ar_OM locale
FAIL: Error converting time string to struct in ar_OM.iso88596 locale
FAIL: Error converting time string to struct in ar_OM.utf8 locale
FAIL: Error converting time string to struct in ar_QA locale
FAIL: Error converting time string to struct in ar_QA.iso88596 locale
FAIL: Error converting time string to struct in ar_QA.utf8 locale
FAIL: Error converting time string to struct in ar_SD locale
FAIL: Error converting time string to struct in ar_SD.iso88596 locale
FAIL: Error converting time string to struct in ar_SD.utf8 locale
FAIL: Error converting time string to struct in ar_SY locale
FAIL: Error converting time string to struct in ar_SY.iso88596 locale
FAIL: Error converting time string to struct in ar_SY.utf8 locale
FAIL: Error converting time string to struct in ar_TN locale
FAIL: Error converting time string to struct in ar_TN.iso88596 locale
FAIL: Error converting time string to struct in ar_TN.utf8 locale
FAIL: Error converting time string to struct in ar_YE locale
FAIL: Error converting time string to struct in ar_YE.iso88596 locale
FAIL: Error converting time string to struct in ar_YE.utf8 locale
FAIL: Error converting time string to struct in my_MM locale
FAIL: Error converting time string to struct in my_MM.utf8 locale
FAIL: Error setting locale no_NO.ISO-8859-1

Which points at a core ar_* locale issue, and a core my_* locale issue.

Comment 3 Carlos O'Donell 2019-06-07 20:22:44 UTC
There is currently no fix for this and there haven't been many requests to fix this issue (beyond developer thoroughness in testing).

I'm marking this CLOSED/WONTFIX.

We will track this via the upstream bug report, and work there to improve testing and fix the issues with the locales (which are a smaller set in glibc master).


Note You need to log in before you can comment on or make changes to this bug.