Bug 406198

Summary: none/tests/ppc64/test_isa_3_0_other test sporadically including CA bit in output
Product: [Developer tools] valgrind Reporter: Will Schmidt <will_schmidt>
Component: generalAssignee: Julian Seward <jseward>
Status: CLOSED FIXED    
Severity: normal CC: cel, will_schmidt
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: proposed patch to suppress CA bit display

Description Will Schmidt 2019-04-03 21:30:35 UTC
SUMMARY
It was pointed out to me that valgrind attempts to display ALL bits of the XER, but our tests only set or clear a few of the bits. 
In particular, we sometimes (not always) are seeing the CA bit show up in the test results. 
This is noticed with the addex test, as illustrated below.

--- test_isa_3_0_other.stdout.exp-LE	2019-03-25 15:44:12.283983772 -0500
+++ test_isa_3_0_other.stdout.out	2019-04-03 14:18:47.072441960 -0500
@@ -40,15 +40,15 @@
 modud ffffffffffffffff, 0000001cbe991def => 000000043eb0c0b2 (00000000)
 modud ffffffffffffffff, ffffffffffffffff => 0000000000000000 (00000000)
 
-addex 0000000000000000, 0000000000000000 => 0000000000000000 (00000000)
-addex 0000000000000000, 0000001cbe991def => 0000001cbe991def (00000000)
-addex 0000000000000000, ffffffffffffffff => ffffffffffffffff (00000000)
-addex 0000001cbe991def, 0000000000000000 => 0000001cbe991def (00000000)
-addex 0000001cbe991def, 0000001cbe991def => 000000397d323bde (00000000) OV32
-addex 0000001cbe991def, ffffffffffffffff => 0000001cbe991dee (00000000) OV OV32
-addex ffffffffffffffff, 0000000000000000 => 0000000000000000 (00000000) OV OV32
-addex ffffffffffffffff, 0000001cbe991def => 0000001cbe991def (00000000) OV OV32
-addex ffffffffffffffff, ffffffffffffffff => ffffffffffffffff (00000000) OV OV32
+addex 0000000000000000, 0000000000000000 => 0000000000000000 (00000000) CA
+addex 0000000000000000, 0000001cbe991def => 0000001cbe991def (00000000) CA
+addex 0000000000000000, ffffffffffffffff => ffffffffffffffff (00000000) CA
+addex 0000001cbe991def, 0000000000000000 => 0000001cbe991def (00000000) CA
+addex 0000001cbe991def, 0000001cbe991def => 000000397d323bde (00000000) CA OV32
+addex 0000001cbe991def, ffffffffffffffff => 0000001cbe991dee (00000000) OV CA OV32
+addex ffffffffffffffff, 0000000000000000 => 0000000000000000 (00000000) OV CA OV32
+addex ffffffffffffffff, 0000001cbe991def => 0000001cbe991def (00000000) OV CA OV32
+addex ffffffffffffffff, ffffffffffffffff => ffffffffffffffff (00000000) OV CA OV32



STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Will Schmidt 2019-04-03 21:31:27 UTC
This is actually a valgrind testcase issue, not a problem with valgrind itself.
Comment 2 Will Schmidt 2019-04-03 21:35:15 UTC
Created attachment 119234 [details]
proposed patch to suppress CA bit display

first-blush proposed patch.
Comment 3 Carl Love 2019-04-05 20:07:40 UTC
Patch reviewed and tested on Power 7, Power 8 BE, Power 8 LE, Power 9.  The patch fixes the reported error.  The patch has been committed to mainline.

commit 7804ba3debb0ee990aaa49949d2629445c103d2b
Author: Carl Love <carll@us.ibm.com>
Date:   Fri Apr 5 15:04:23 2019 -0500

    PPC64, fix test_isa_3_0_other.c test