Bug 1533595

Summary: systemd-run -M fails to run a command with UTF8 chars
Product: Red Hat Enterprise Linux 7 Reporter: Davide Principi <davide.principi>
Component: systemdAssignee: systemd-maint
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-15 07:34:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Davide Principi 2018-01-11 17:30:09 UTC
Description of problem:

For certain UTF8 string lengths systemd-run fails to run a command in a separate machine

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

- CentOS 7.4
- systemd-219-42.el7_4.4.x86_64
- Linux vm5.dpnet.nethesis.it 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

How reproducible:

always

Steps to Reproduce:

1. prepare the container chroot:
   yum -y --releasever=/ --installroot=/var/lib/machines/c1 install bash systemd

2. spawn a container:
   /usr/bin/systemd-nspawn --boot --machine=c1 -D /var/lib/machines/c1

3. open a new terminal and run the script:
 
   for ((I=1; I<10; I++)); do USERNAME=$(printf 'à%.0s' `seq 1 $I`); systemd-run -M c1 -q -t /usr/bin/echo $I $USERNAME; done

Actual results:

1 à
2 àà
3 ààà
4 àààà
5 ààààà
Failed to start transient service unit: Message did not receive a reply (timeout by message bus)

Expected results (with "a" instead of "à"):

1 a
2 aa
3 aaa
4 aaaa
5 aaaaa
6 aaaaaa
7 aaaaaaa
8 aaaaaaaa
9 aaaaaaaaa

Additional info:

LANG=en_US.UTF-8
Running in KVM
This bug was originally reported here:

https://github.com/NethServer/dev/issues/5400

Comment 2 Jan Synacek 2018-01-31 13:28:06 UTC
https://github.com/systemd/systemd/issues/8056

Comment 3 Jan Synacek 2018-01-31 13:37:20 UTC
Meanwhile, an obvious thing to do is: don't do it.

Comment 4 Jan Synacek 2018-02-01 09:08:33 UTC
Apparently, this has been fixed in https://github.com/systemd/systemd/commit/2e59b241ca86b8338c706a7a704d301fde908581.

Comment 8 RHEL Program Management 2021-02-15 07:34:32 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.