Bug 22553 - FREE command: Wrong display formatting
Summary: FREE command: Wrong display formatting
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA9-64-OK, MGA9-32-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2018-02-10 16:25 CET by Markus Robert Keßler
Modified: 2023-12-16 23:15 CET (History)
9 users (show)

See Also:
Source RPM: procps-ng-3.3.17-2.mga9.src.rpm
CVE:
Status comment: Advisory and packages in comment#29


Attachments
Test of procps-ng before and after the upgrade to 2.2 release (1.35 KB, text/plain)
2023-12-03 20:32 CET, katnatek
Details

Description Markus Robert Keßler 2018-02-10 16:25:26 CET
Description of problem:

Free command to show the amount of memory has an issue with locales.
At least for German language the displayed text is not formatted correctly:

$ LANGUAGE=en free
              total        used        free      shared  buff/cache   available
Mem:        4003196      691016      304156       93780     3008024     2929672
Swap:       4930236           0     4930236
$ LANGUAGE=de free
              gesamt       benutzt     frei      gemns.  Puffer/Cache verfügbar
Speicher:     4003196      691240      303932       93780     3008024     2929448
Swap:       4930236           0     4930236



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

See source version


How reproducible:

Always


Steps to Reproduce:
1. just
2. invoke
3. as shown
Comment 1 David Walser 2018-02-10 23:29:16 CET
I recommend reporting this upstream (if you want it to be fixed).  Thanks.
Comment 2 Marja Van Waes 2018-02-11 18:15:38 CET
It seems caused by the translated strings for "Mem:" and "Swap:" having different lengths than in English. In French the values for swap even end up in the wrong column: 

LANGUAGE=fr free
              total       utilisé      libre     partagé tamp/cache   disponible
Mem:        8050920     1831260      286324      117452     5933336     5798948
Partition d'échange:     8368256           0     8368256


@ Markus

When you file an upstream bug report, then please give the link to it in this report. 

Assigning to the registered maintainer.

CC: (none) => marja11
Whiteboard: (none) => MGA6TOO
Assignee: bugsquad => tmb
Version: 6 => Cauldron
Keywords: (none) => UPSTREAM

Comment 3 Markus Robert Keßler 2018-02-11 18:30:06 CET
Just alerted them via email list ( procps@freelists.org ).
Keep you updated in case of any response.
Comment 4 Markus Robert Keßler 2018-02-15 10:53:40 CET
Hi, looks like we will never get any respnse from them.
Had a look into SuSE's Tumbleweed-sources in the meantime -- they use dozens of patches for issues like this. Let's have a look into this rpm:
ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/opensuse/source/tumbleweed/repo/oss/suse/src/procps-3.3.12-10.1.src.rpm
Comment 5 sturmvogel 2023-11-12 22:56:36 CET
Fixed since v4.0.0
https://gitlab.com/procps-ng/procps/-/issues/229

Actual upstream version is 4.0.4

Mageia 9 still ships the heavily outdated procps-ng-3.3.17 from February 2021!
sturmvogel 2023-11-12 22:58:07 CET

Keywords: UPSTREAM => (none)
Whiteboard: MGA6TOO => (none)
Source RPM: procps-ng-3.3.12-1 => procps-ng-3.3.17-2.mga9.src.rpm
Version: Cauldron => 9

sturmvogel 2023-11-12 22:58:25 CET

Assignee: tmb => bugsquad

Comment 6 Lewis Smith 2023-12-01 21:31:12 CET
Thanks to DavidG, we now have version 4.0.4 in Cauldron.
May we ask you to do the Mageia 9 bit? + Advisory...

Assignee: bugsquad => geiger.david68210
Status comment: (none) => Fixed since v4.0.0

Comment 7 David GEIGER 2023-12-02 05:43:34 CET
Impossible to update mga9 with version 4.x, there is a lot of change with libraries that can't be updated!
Comment 8 David GEIGER 2023-12-02 10:50:09 CET
Please test the upcoming procps-ng-3.3.17-2.1.mga9 in Core/updates_testing repo!
Comment 9 katnatek 2023-12-02 19:42:54 CET Comment hidden (obsolete)

Assignee: geiger.david68210 => qa-bugs

Comment 10 katnatek 2023-12-02 19:50:09 CET Comment hidden (obsolete)
katnatek 2023-12-02 19:50:49 CET

Status comment: Fixed since v4.0.0 => Advisory and packages in comment#10

Comment 11 katnatek 2023-12-02 20:01:27 CET
@Markus Robert Keßler: can you test the packages proposed in your system, I can't reproduce the fail in my system with the current procps-ng packages

I test the update and the packages updates without issues
Comment 12 Marja Van Waes 2023-12-02 20:08:06 CET
Advisory from comment 10 added to SVN. Please remove the "advisory" keyword if it needs to be changed. It also helps when obsolete advisories are tagged as "obsolete"

Keywords: (none) => advisory

katnatek 2023-12-03 04:29:39 CET

CC: (none) => geiger.david68210

Comment 13 katnatek 2023-12-03 04:30:57 CET
Tested on Real Hardware Mageia i586 lxqt
Before the update:

LANGUAGE=fr free
               total       utilisé      libre     partagé tamp/cache   disponible
Mem:         2050256      552932      370984       70060     1126340     1198848
Partition d'échange:    4189564           0     4189564

LANGUAGE=de free
              gesamt       benutzt     frei      gemns.  Puffer/Cache verfügbar
Speicher:    2050256      555336      366760       71776     1128160     1194728
Swap:        4189564           0     4189564

After the update
LANGUAGE=fr free
               total        used        free      shared  buff/cache   available
Mem:         2050256     1203848      173376       68852      673032      556892
Swap:        4189564      146808     4042756
[katnatek@cefiro ~]$ LANGUAGE=de free
               total        used        free      shared  buff/cache   available
Mem:         2050256     1204808      172408       68860      673040      555924
Swap:        4189564      146808     4042756

@David GEIGER: Is the expected behaviour? It looks like the problematic locales are removed
Comment 14 David GEIGER 2023-12-03 07:55:48 CET
Nop there is now an issue with translation files, please test next procps-ng-3.3.17-2.2.mga9 update!
Comment 15 Marja Van Waes 2023-12-03 16:10:04 CET
(In reply to David GEIGER from comment #14)
> Nop there is now an issue with translation files, please test next
> procps-ng-3.3.17-2.2.mga9 update!

Updated the advisory with procps-ng-3.3.17-2.2.mga9
Comment 16 katnatek 2023-12-03 20:32:34 CET
Created attachment 14192 [details]
Test of procps-ng before and after the upgrade to 2.2 release

New test after tweak my /etc/rpm/macros to include de and fr locales (bug#32589)
I restore current procps-ng
Make test for en de and fr locales 
update to procps-ng-3.3.17-2.2.mga9 packages
Make again the test for en de and fr locales

The behaviour improves but still a few misaligned

Tested on Real Hardware Mageia 9 i586 lxqt
katnatek 2023-12-04 19:27:29 CET

CC: (none) => ubuntu

Comment 17 katnatek 2023-12-04 19:30:08 CET
Markus as reporter, please test if the procps-ng-3.3.17-2.2 packages are good enough for you, the list of packages is the same as in comment#10 just change 2.1 to 2.2
Comment 18 Brian Rockwell 2023-12-08 05:00:41 CET
Works with english and seems to format properly

CC: (none) => brtians1

Comment 19 katnatek 2023-12-08 22:43:04 CET
(In reply to Brian Rockwell from comment #18)
> Works with english and seems to format properly

English is the only language that works
Comment 20 Guillaume Bedot 2023-12-09 20:48:29 CET
Alignment is still not good, i have for long set alias free='LANG=C free -h' because of this.


$ free
               total       utilisé      libre     partagé tamp/cache   disponible
Mem:         3764788     1321628      354744       21860     2398028     2443160
Échange:     8189244     1573036     6616208

$ LANG=C free
               total        used        free      shared  buff/cache   available
Mem:         3764788     1351452      426212       21860     2296736     2413336
Swap:        8189244     1573036     6616208

CC: (none) => geex+mageia

Comment 21 David GEIGER 2023-12-10 09:49:12 CET
your window seems too small, you should increase its size.
Comment 22 Guillaume Bedot 2023-12-10 11:26:09 CET
I'm using the gnome-terminal default of 80x24. Resizing changes nothing.
I think they fixed the alignment for Mem and Swap lines, but not the header line.
In the outputs of https://gitlab.com/procps-ng/procps/-/issues/229 , all the header lines are in english...
Comment 23 Otto Leipälä 2023-12-13 18:00:14 CET
(In reply to Guillaume Bedot from comment #20)
What terminal what are you usin?
I use source code pro semi bold 10
i get this with Finnish (Finland locale) :

[ozky@ozky-pc ozky]$ free
               total        used        free      shared  buff/cache   available
Mem:         8020760     4002072      291564      821052     3727124     2860500
Swap:       41575184     1530880    40044304
[ozky@ozky-pc ozky]$ LANG=C free
               total        used        free      shared  buff/cache   available
Mem:         8020760     4001612      337536      821828     3681612     2839912
Swap:       41575184     1530368    40044816
Comment 24 katnatek 2023-12-14 02:14:03 CET
(In reply to Otto Leipälä from comment #23)
> (In reply to Guillaume Bedot from comment #20)
> What terminal what are you usin?
> I use source code pro semi bold 10
> i get this with Finnish (Finland locale) :
> 
> [ozky@ozky-pc ozky]$ free
>                total        used        free      shared  buff/cache  
> available
> Mem:         8020760     4002072      291564      821052     3727124    
> 2860500
> Swap:       41575184     1530880    40044304
> [ozky@ozky-pc ozky]$ LANG=C free
>                total        used        free      shared  buff/cache  
> available
> Mem:         8020760     4001612      337536      821828     3681612    
> 2839912
> Swap:       41575184     1530368    40044816

You get the output in English because the application not have translations for you language: 

usr/share/locale/de/LC_MESSAGES/procps-ng.mo
/usr/share/locale/fr/LC_MESSAGES/procps-ng.mo
/usr/share/locale/pl/LC_MESSAGES/procps-ng.mo
/usr/share/locale/pt_BR/LC_MESSAGES/procps-ng.mo
/usr/share/locale/sv/LC_MESSAGES/procps-ng.mo
/usr/share/locale/uk/LC_MESSAGES/procps-ng.mo
/usr/share/locale/vi/LC_MESSAGES/procps-ng.mo
/usr/share/locale/zh_CN/LC_MESSAGES/procps-ng.mo

the bug is valid and present at less for de and fr, see our brand new wiki page to test this type of bugs https://wiki.mageia.org/en/QA_process_for_testing_foreign_language_issues
Comment 25 Guillaume Bedot 2023-12-14 09:05:32 CET
@Otto, like katnatek said, you are comparing the same output (used, shared, etc don't seem finnish to me).
I'm comparing C / en locale with my language (fr) locale.
Comment 26 Otto Leipälä 2023-12-14 09:37:16 CET
Yes....
Comment 27 Herman Viaene 2023-12-14 14:57:51 CET
Before the update of procps-ng (wiki above applied)
$ LANGUAGE=nl free
               total        used        free      shared  buff/cache   available
Mem:         3849256     1420048      259944      130696     2169264     2005608
Swap:        4094988        8764     4086224
after the update has been installed:
$ LANGUAGE=nl free
free: symbol lookup error: free: undefined symbol: kb_committed_as, version LIBPROCPS_0

CC: (none) => herman.viaene

Comment 28 katnatek 2023-12-14 19:07:28 CET
(In reply to Herman Viaene from comment #27)
> Before the update of procps-ng (wiki above applied)
> $ LANGUAGE=nl free
>                total        used        free      shared  buff/cache  
> available
> Mem:         3849256     1420048      259944      130696     2169264    
> 2005608
> Swap:        4094988        8764     4086224
> after the update has been installed:
> $ LANGUAGE=nl free
> free: symbol lookup error: free: undefined symbol: kb_committed_as, version
> LIBPROCPS_0

You not install
lib(64)procps8-3.3.17-2.2.mga9
Comment 29 katnatek 2023-12-14 19:09:48 CET
Advisory:
#####################################################################
free command output is misaligned when using many non-english locales
this update fixes the issue

References:
####################################################################
https://gitlab.com/procps-ng/procps/-/issues/229
https://bugs.mageia.org/show_bug.cgi?id=22553


Packages in 9/core/updates_testing:
#####################################################################
procps-ng-3.3.17-2.2.mga9
lib(64)procps-devel-3.3.17-2.2.mga9
lib(64)procps8-3.3.17-2.2.mga9



SRPM:
####################################################################
procps-ng-3.3.17-2.2.mga9
katnatek 2023-12-14 19:10:11 CET

Status comment: Advisory and packages in comment#10 => Advisory and packages in comment#29

Comment 30 katnatek 2023-12-14 19:10:57 CET
Just update the advisory to make clear the versions
Comment 31 katnatek 2023-12-14 19:13:39 CET
Give the 32-OK, based in my test in comment#16 and the lack of feedback of reporter

Whiteboard: (none) => MGA9-32-OK

PC LX 2023-12-16 01:27:54 CET

CC: (none) => mageia

Comment 32 Morgan Leijström 2023-12-16 02:11:07 CET
mga9-64 OK: I see the problem fixed:
tested de and fr, and working output in nl too (same phrases as en) and sv is also OK.

@Marja:
Advisory need be updated regarding versions

I refrain from now validating as i have read it is not enough to remove the advisory keyword to hinder pushing when advisory is already uploaded.

CC: (none) => fri
Keywords: advisory => (none)
Whiteboard: MGA9-32-OK => MGA9-64-OK, MGA9-32-OK

Comment 33 Marja Van Waes 2023-12-16 12:57:43 CET
(In reply to Morgan Leijström from comment #32)

> 
> @Marja:
> Advisory need be updated regarding versions
> 

Again? To which version, then?

(In reply to Marja Van Waes from comment #15)
> (In reply to David GEIGER from comment #14)
> > Nop there is now an issue with translation files, please test next
> > procps-ng-3.3.17-2.2.mga9 update!
> 
> Updated the advisory with procps-ng-3.3.17-2.2.mga9

Sorry if I'm blind again, but procps-ng-3.3.17-2.2.mga9 is in the advisory in SVN.
AFAICS that is the same as in the Advisory in comment 29


Last revision:
https://svnweb.mageia.org/advisories/22553.adv?revision=15399&view=markup

Revision log:
https://svnweb.mageia.org/advisories/22553.adv?view=log

Please re-add the advisory keyword if that is OK
Comment 34 Morgan Leijström 2023-12-16 14:02:04 CET
Sorry, i got confused.
All OK :)

Keywords: (none) => advisory, validated_update
CC: (none) => sysadmin-bugs

Comment 35 Mageia Robot 2023-12-16 23:15:39 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2023-0148.html

Status: NEW => RESOLVED
Resolution: (none) => FIXED


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