Bug 496696

Summary: memtester exits with invalid return code
Product: [Fedora] Fedora Reporter: Mace Moneta <moneta.mace>
Component: memtesterAssignee: Lucian Langa <lucilanga>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: lucilanga, moneta.mace
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-20 19:42:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mace Moneta 2009-04-20 18:53:07 UTC
Description of problem:

Memtester documentation indicates that the exit return code should be 0-7 (0 or the OR of x01, x02, x04).  It is exiting with return code 130, apparently always:

# memtester 2000
memtester version 4.0.8 (64-bit)
Copyright (C) 2007 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).

pagesize is 4096
pagesizemask is 0xfffffffffffff000
want 2000MB (2097152000 bytes)
got  2000MB (2097152000 bytes), trying mlock ...locked.
Loop 1:
  Stuck Address       : testing   2^C
[root@slayer ~]# echo $?
130


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

memtester-4.0.8-3.fc11.x86_64

How reproducible:

Always

Steps to Reproduce:
1.Run memtester
2.ctrl-c to exit
3.Check return code
  
Actual results:

130

Expected results:

0 to 7, depending on whether a failure was detected.
Additional info:

Comment 1 Lucian Langa 2009-04-20 19:33:12 UTC
130 meaning is: script terminated by ctrl-c
(http://tldp.org/LDP/abs/html/exitcodes.html)

Running memtester on a 10 M with one iteration exit code is setup properly:

memtester 10 1
memtester version 4.0.8 (64-bit)
Copyright (C) 2007 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).

pagesize is 4096
pagesizemask is 0xfffffffffffff000
want 10MB (10485760 bytes)
got  10MB (10485760 bytes), trying mlock ...locked.
Loop 1/1:
  Stuck Address       : ok         
  Random Value        : ok
  Compare XOR         : ok
  Compare SUB         : ok
  Compare MUL         : ok
  Compare DIV         : ok
  Compare OR          : ok
  Compare AND         : ok
  Sequential Increment: ok
  Solid Bits          : ok         
  Block Sequential    : ok         
  Checkerboard        : ok         
  Bit Spread          : ok         
  Bit Flip            : ok         
  Walking Ones        : ok         
  Walking Zeroes      : ok         

Done.

# echo $?
0

Comment 2 Mace Moneta 2009-04-20 19:42:19 UTC
I received a similar response from the author:

> That's if you let it exit by itself.  If you kill it, the exit code will be as
> set by your system; 130 is typically the value (encoded as per exit()) for
> SIGINT -- i.e. ctrl-c.
> 
> That's normal.
> 
> Charles

That means that running without a loop count is not useful, as you'll never know if an error occurred during the run (which may last several days).

Since this is by design, I'll close the bug.