Summary: | "ps -o lstart" broken for some locales | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Mikhail Teterin <mi> | ||||
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | rol, vegaio, yuripv | ||||
Priority: | --- | ||||||
Version: | 11.3-STABLE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Looks like the UTF-8, US-ASCII, ISO8859-1 and ISO8859-15 are all fine, while most others (like my own uk_UA.KOI8-U) are broken... Apparently the problem isn't in ps itself and rather in libxo which talks about locales in general, but then uses a lot of handrolled conversions that apply only to ascii/utf-8. I'll look into it if no one beats me to it. It turned out to be not as bad as I thought, I'll try proposing a patch upstream: https://github.com/Juniper/libxo/pull/68 Please check if it fixes the issue for you. *** Bug 229453 has been marked as a duplicate of this bug. *** *** Bug 230068 has been marked as a duplicate of this bug. *** A commit references this bug: Author: yuripv Date: Sun Jun 7 08:21:20 UTC 2020 New revision: 361887 URL: https://svnweb.freebsd.org/changeset/base/361887 Log: ps: use %hs instead of %s format specifiers Use %hs (locale-based encoding) instead of %s (UTF-8) format for strings that are expected to be in current locale encoding (date/time, process names/argument list). PR: 241491 Reviewed by: phil Differential Revision: https://reviews.freebsd.org/D22160 Changes: head/bin/ps/keyword.c head/bin/ps/print.c head/bin/ps/ps.c |
Created attachment 208599 [details] Demonstrate the problem Depending on $LANG, the value printed for the STARTED column may be an empty string (or a sequence of blanks?) Attached is a simple shell script listing both the broken and the Ok locales.