Bug 1263765 - free -h segfault
free -h segfault
Status: ASSIGNED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: procps-ng (Show other bugs)
7.2
Unspecified Unspecified
low Severity medium
: rc
: ---
Assigned To: Jan Rybar
BaseOS QE - Apps
: Patch, Upstream
: 1362588 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-16 11:53 EDT by Branislav Náter
Modified: 2017-10-17 11:45 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
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)
Upstream backport patch with additional CLI options (5.10 KB, patch)
2017-07-27 10:32 EDT, Jan Rybar
no flags Details | Diff

  None (edit)
Description Branislav Náter 2015-09-16 11:53:55 EDT
Description of problem:
During testing of BZ#1246379, I've tried to pass huge numbers (petabytes of memory) to free utility. When trying to produce output in human readable form (-h), free segfaults.

Version-Release number of selected component (if applicable):
procps-ng-3.3.10-3.el7

Steps to Reproduce:
1. copy /proc/meminfo file and change "MemTotal" value to "123123123123123"
2. mount modified meminfo:
mount --bind meminfo /proc/meminfo
3. free -h

Actual results:
              total        used        free      shared  buff/cache   available
Segmentation fault

Expected results:
No segfault
Comment 2 Jaromír Cápík 2016-01-14 11:31:30 EST
In my case the free tool starts to crash when I get over 1192928601000 kB and the probability of crashing gets higher when the value is increased even more. That means it probably depends on other values which change in time. However, it's very probably an overflow in the evaluations and needs to be fixed.
Comment 6 Jan Rybar 2017-07-13 12:53:18 EDT
*** Bug 1362588 has been marked as a duplicate of this bug. ***
Comment 7 Jan Rybar 2017-07-13 13:05:09 EDT
According to the comment in code made by the author, 'free -h' generally acts as described above on systems with memory exceeding 1PB.

Problem is caused by character overflow in reserved Memory info column. Solution preventing this behaviour was deferred by upstream as no computer with that much memory exists so far.

Patch under construction.
Comment 9 Jan Rybar 2017-07-27 10:32 EDT
Created attachment 1305425 [details]
Upstream backport patch with additional CLI options

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