Bug 2083789 - Option --si doesn't switch from default --kibi to --kilo.
Summary: Option --si doesn't switch from default --kibi to --kilo.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: procps-ng
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Rybar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-10 18:50 UTC by r3obh
Modified: 2022-11-10 22:11 UTC (History)
3 users (show)

Fixed In Version: procps-ng-3.3.17-7.fc38 procps-ng-3.3.17-4.fc36.1 procps-ng-3.3.17-6.fc37.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-10-14 12:58:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description r3obh 2022-05-10 18:50:37 UTC
Description of problem:
Option --si doesn't switch from default (kibibytes) to international units (kilobytes) when unit is not specified.

Version-Release number of selected component (if applicable):
procps-ng-3.3.17-3.fc35.x86_64

How reproducible:
Always

Steps to Reproduce:
1. $ free 
               total        used        free      shared  buff/cache   available
Mem:       297144608     1898016   293631640       23780     1614952   293515612
Swap:      196603896           0   196603896

2. $ free --kibi
               total        used        free      shared  buff/cache   available
Mem:       297144608     1895936   293633688       23780     1614984   293517700
Swap:      196603896           0   196603896

3. $ free --si
               total        used        free      shared  buff/cache   available
Mem:       297144608     1897764   293631892       23780     1614952   293515864
Swap:      196603896           0   196603896

3. $ free --kilo
               total        used        free      shared  buff/cache   available
Mem:       304276078     1942495   300679864       24350     1653719   300561076
Swap:      201322389           0   201322389


Actual results:
free --si is the same as free --kibi.

Expected results:
free --si should be the same as free --kilo.

Comment 1 Jan Rybar 2022-09-19 14:44:41 UTC
Hello,

yes, this seems to be an intention indeed.
https://gitlab.com/procps-ng/procps/-/blob/master/free.c#L121

`--si` option seems to be only effective with `-h` (human readable) which makes sense and manpage implicitly describes that as such (yes, implicitly). 
As the default is not `-h` (human readable), but kibibytes, the SI output would be kilobytes, and this can be invoked by `--kilo` option instead of `--si`.

Yet, I believe a change can be made either in manpage to clarify this better or in code, shall the upstream maintainers agree with it.

Comment 2 Jan Rybar 2022-09-20 14:13:24 UTC
Made a pull request at upstream:
https://gitlab.com/procps-ng/procps/-/merge_requests/163

Comment 3 Jan Rybar 2022-09-29 15:25:53 UTC
Fixed in rawhide so far.

Comment 4 Fedora Update System 2022-10-04 18:10:21 UTC
FEDORA-2022-0acb497215 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-0acb497215

Comment 5 Fedora Update System 2022-10-04 20:47:41 UTC
FEDORA-2022-0acb497215 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-0acb497215`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-0acb497215

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2022-10-05 12:23:51 UTC
FEDORA-2022-1850eac8a3 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-1850eac8a3

Comment 7 Fedora Update System 2022-10-06 14:17:06 UTC
FEDORA-2022-1850eac8a3 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-1850eac8a3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-1850eac8a3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2022-10-06 17:51:05 UTC
FEDORA-2022-13aff5aadc has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-13aff5aadc

Comment 9 Fedora Update System 2022-10-07 16:00:00 UTC
FEDORA-2022-13aff5aadc has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-13aff5aadc`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-13aff5aadc

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2022-10-14 12:58:06 UTC
FEDORA-2022-13aff5aadc has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2022-11-10 22:11:06 UTC
FEDORA-2022-1850eac8a3 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


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