Hide Forgot
+++ This bug was initially created as a clone of Bug #702826 +++ GNU time can print out the maximum RSS usage of its subprocess. The ru_maxrss value returned by the wait4 syscall is in units of kilobytes, but GNU time incorrectly treats this as a number of pages, multiplying the value by 4 before displaying it. [...] Steps to Reproduce: 1. /usr/bin/time -f %M perl -e '"x" x 400 x 1024 x 1024' Actual results: A bit over 1600000, indicating maximum RSS usage of 1.6 GB. This is not even possible on my system as it only has 1 GB of physical RAM. Expected results: Approximately 400000, since Perl should only be allocating around 400 MB. [...] $ strace -ve wait4 /usr/bin/time -f %M perl -e '"x" x 400 x 1024 x 1024' wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, {ru_utime={0, 146977}, ru_stime={0, 676897}, ru_maxrss=411356, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=102901, ru_majflt=1, ru_nswap=0, ru_inblock=176, ru_oublock=0, ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=1, ru_nivcsw=40}) = 7459 --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=7459, si_status=0, si_utime=14, si_stime=68} (Child exited) --- 1645424 ---- RHEL-6.1 affected.
Created attachment 498298 [details] Fix
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. If you would like it considered as an exception in the current release, please ask your support representative.
Created attachment 560195 [details] test case
*** Bug 783143 has been marked as a duplicate of this bug. ***
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate, in the next release of Red Hat Enterprise Linux.
time-1.7-37.1.el6 ================= :: [ INFO ] :: RSS usage of given script is suppose to be about 412024 kB :: [ PASS ] :: Measuring RSS usege (Expected 0, got 0) :: [ FAIL ] :: RSS max usage should be < 450000 (Assert: "450000" should be greater than "1647232") :: [ PASS ] :: RSS max usage should be > 400000 (Assert: "1647232" should be greater than "400000") :: [ INFO ] :: RSS value is 399 % of expected value time-1.7-38.el6 =============== :: [ INFO ] :: RSS usage of given script is suppose to be about 412024 kB :: [ PASS ] :: Measuring RSS usege (Expected 0, got 0) :: [ PASS ] :: RSS max usage should be < 450000 (Assert: "450000" should be greater than "411804") :: [ PASS ] :: RSS max usage should be > 400000 (Assert: "411804" should be greater than "400000") :: [ INFO ] :: RSS value is 99 % of expected value verified on all relevant architectures
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0710.html