Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1503942 - timedatectl crashes if the length of the day name in the current locale is long
timedatectl crashes if the length of the day name in the current locale is long
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd (Show other bugs)
7.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Jan Synacek
Frantisek Sumsal
:
Depends On: 1503452
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-19 03:03 EDT by Jan Synacek
Modified: 2018-04-10 07:25 EDT (History)
4 users (show)

See Also:
Fixed In Version: systemd-219-47.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1503452
Environment:
Last Closed: 2018-04-10 07:24:09 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0711 None None None 2018-04-10 07:25 EDT

  None (edit)
Description Jan Synacek 2017-10-19 03:03:18 EDT
+++ This bug was initially created as a clone of Bug #1503452 +++

Description of problem:
Crash in the last command:


% export LANG=en_US.UTF-8
[hedayat@hv ~]% date
Wed Oct 18 10:54:07 +0330 2017
[hedayat@hv ~]% timedatectl
      Local time: Wed 2017-10-18 11:24:10 +0400
  Universal time: Wed 2017-10-18 07:24:10 UTC
        RTC time: Wed 2017-10-18 07:24:10
       Time zone: Asia/Folan (+0400, +0400)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no
[hedayat@hv ~]% 
[hedayat@hv ~]% export LANG=fa_IR.UTF-8
[hedayat@hv ~]% date
چهارشنبه ۱۸ اكتبر ۱۷، ساعت ۱۰:۵۴:۲۴ (+0330)
[hedayat@hv ~]% timedatectl            
Assertion 'xstrftime: a[] must be big enough' failed at ../src/timedate/timedatectl.c:105, function print_status_info(). Aborting.
zsh: abort (core dumped)  timedatectl


Version-Release number of selected component (if applicable):
systemd-234-8.fc27.x86_64

How reproducible:
Depends on the current day of week. Happens on Wednesdays & Thursdays in fa_IR locale

--- Additional comment from Jan Synacek on 2017-10-18 09:41:44 CEST ---

src/basic/time-util.h:75:#define FORMAT_TIMESTAMP_MAX (3+1+10+1+8+1+6+1+6+1)
src/timedate/timedatectl.c:75:        char a[FORMAT_TIMESTAMP_MAX];
src/timedate/timedatectl.c:105                 xstrftime(a, "%a %Y-%m-%d %H:%M:%S %Z", localtime_r(&sec, &tm));

It seems that the maximum format length assumption only holds for non-wide/variable encoded characters.

--- Additional comment from Zbigniew Jędrzejewski-Szmek on 2017-10-18 16:32:23 CEST ---

https://github.com/systemd/systemd/pull/7123
Comment 1 Jan Synacek 2017-10-19 04:01:03 EDT
Note that using the same reproducer as in the original bug report didn't reproduce the problem for me. It should be fixed anyway, as the assumption in the code is simply wrong.
Comment 2 Jan Synacek 2017-10-24 08:49:00 EDT
https://github.com/lnykryn/systemd-rhel/pull/165
Comment 4 Lukáš Nykrýn 2017-11-13 09:20:17 EST
fix merged to staging branch -> https://github.com/lnykryn/systemd-rhel/pull/165 -> post
Comment 10 errata-xmlrpc 2018-04-10 07:24:09 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, 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-2018:0711

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