Bug 996927 - Two ppc64 specific testsuite failures (power_ISA2_05 and round)
Two ppc64 specific testsuite failures (power_ISA2_05 and round)
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: valgrind (Show other bugs)
7.0
ppc64 Unspecified
unspecified Severity medium
: rc
: ---
Assigned To: Mark Wielaard
Miroslav Franc
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-14 05:50 EDT by Mark Wielaard
Modified: 2016-01-31 21:41 EST (History)
7 users (show)

See Also:
Fixed In Version: valgrind-3.8.1-30.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-25 10:28:25 EDT
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)
memcheck/tests/ppc64/power_ISA2_05.stderr.diff (1.14 KB, text/plain)
2013-08-14 08:41 EDT, Mark Wielaard
no flags Details
memcheck/tests/ppc64/power_ISA2_05.stdout.diff (3.60 KB, text/plain)
2013-08-14 08:42 EDT, Mark Wielaard
no flags Details
none/tests/ppc64/round.stdout.diff (61.62 KB, text/plain)
2013-08-14 08:42 EDT, Mark Wielaard
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
IBM Linux Technology Center 96907 None None None Never

  None (edit)
Description Mark Wielaard 2013-08-14 05:50:28 EDT
Description of problem:

Two ppc64 specific testsuite failures (power_ISA2_05 and round).

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

valgrind-3.8.1-23.el7

How reproducible:

Always.

Steps to Reproduce:

Run the testsuite.

-- Running  tests in memcheck/tests/ppc64 ------------------------------
power_ISA2_05:   valgrind   --workaround-gcc296-bugs=yes ./power_ISA2_05 
sh: line 1: 21175 Segmentation fault      (core dumped) VALGRIND_LIB=/builddir/build/BUILD/valgrind-3.8.1/.in_place VALGRIND_LIB_INNER=/builddir/build/BUILD/valgrind-3.8.1/.in_place /builddir/build/BUILD/valgrind-3.8.1/./coregrind/valgrind --command-line-only=yes --memcheck:leak-check=no --tool=memcheck --workaround-gcc296-bugs=yes ./power_ISA2_05 > power_ISA2_05.stdout.out 2> power_ISA2_05.stderr.out
*** power_ISA2_05 failed (stdout) ***
*** power_ISA2_05 failed (stderr) ***
-- Finished tests in memcheck/tests/ppc64 ------------------------------

-- Running  tests in none/tests/ppc64 ----------------------------------
jm-fp:           valgrind   ./jm-insns -f 
jm-int:          valgrind   ./jm-insns -i 
jm-vmx:          valgrind   ./jm-insns -a 
jm_vec_isa_2_07: (skipping, prereq failed: ../../../tests/check_isa-2_07_cap)
lsw:             valgrind   ./lsw 
power6_bcmp:     valgrind   ./power6_bcmp 
power6_mf_gpr:   valgrind   ./power6_mf_gpr 
round:           valgrind   ./round 
*** round failed (stdout) ***
std_reg_imm:     valgrind   -q ./std_reg_imm 
test_dfp1:       valgrind   ./test_dfp1 
test_dfp2:       valgrind   ./test_dfp2 
test_dfp3:       valgrind   ./test_dfp3 
test_dfp4:       valgrind   ./test_dfp4 
test_dfp5:       valgrind   ./test_dfp5 
test_isa_2_06_part1: valgrind   ./test_isa_2_06_part1 
test_isa_2_06_part2: valgrind   ./test_isa_2_06_part2 
test_isa_2_06_part3: valgrind   ./test_isa_2_06_part3 
test_isa_2_07_part2: (skipping, prereq failed: ../../../tests/check_isa-2_07_cap)
tw_td:           valgrind   ./tw_td 
twi_tdi:         valgrind   ./twi_tdi 
-- Finished tests in none/tests/ppc64 ----------------------------------
Comment 2 Mark Wielaard 2013-08-14 08:41:17 EDT
Created attachment 786525 [details]
memcheck/tests/ppc64/power_ISA2_05.stderr.diff
Comment 3 Mark Wielaard 2013-08-14 08:42:15 EDT
Created attachment 786526 [details]
memcheck/tests/ppc64/power_ISA2_05.stdout.diff
Comment 4 Mark Wielaard 2013-08-14 08:42:49 EDT
Created attachment 786527 [details]
none/tests/ppc64/round.stdout.diff
Comment 5 Mark Wielaard 2013-08-14 08:46:04 EDT
Attached the test stdout/stderr log files for these two tests.

Looks like two separate issues. The power_ISA2_05 test crashes, but the round test gives output that is unexpected (and looks indeed like rounding issues).
Comment 6 Mark Wielaard 2013-08-14 09:14:07 EDT
The round test seems to fail in the same way against valgrind svn trunk. So doesn't seem specific to the rhel7 valgrind package (backports).

The power_ISA2_05 testcase also fails against valgrind svn trunk, but doesn't crash. There is just the following stdout diff:

--- power_ISA2_05.stdout.exp    2013-08-13 10:47:51.516805085 -0400
+++ power_ISA2_05.stdout.out    2013-08-14 08:52:14.952422021 -0400
@@ -19,7 +19,7 @@
 lfdp (-1024.000000, 1025.000000) => F_hi=-1024.000000, F_lo=1025.000000
 stfdp (2.204800, -4.102400) => F_hi=2.204800, F_lo=-4.102400
 lfdpx (2.204800, -4.102400) => F_hi=2.204800, F_lo=-4.102400
-stfdpx (2.204800, 2.204800) => F_hi=2.204800, F_lo=2.204800
+stfdpx (-4.102400, 2.204800) => F_hi=-4.102400, F_lo=2.204800
 lfiwax (-1024.000000) => FRT=(ffffffff, c0900000)
 prtyd (0) => parity=0
 prtyw (0) => parity=0

The crash might be because of a bad backported patch in the valgrind package, I'll investigate some more.
Comment 7 IBM Bug Proxy 2013-08-14 09:41:24 EDT
I cannot reproduce the Segmentation fault you're seeing with memcheck/tests/ppc64/power_ISA2_05 on my RHEL 6.4 system (building with stock toolchain).

As for the failure with none/tests/ppc64/round . . . This is not a regression; that test was poorly designed and has been flakey for a long time.  It's very low on my priority list to look at fixing this, especially since the testcases are not included in RHEL valgrind rpm package.  So my recommendation for now is to ignore the error.
Comment 8 Mark Wielaard 2013-08-14 10:02:13 EDT
(In reply to IBM Bug Proxy from comment #7)
> I cannot reproduce the Segmentation fault you're seeing with
> memcheck/tests/ppc64/power_ISA2_05 on my RHEL 6.4 system (building with
> stock toolchain).

I think it is specific to the current RHEL7 toolchain.
The crash seems to come from not backporting valgrind svn r13490
https://bugs.kde.org/show_bug.cgi?id=323116
I am testing a package with that backported.
Then there is still a small diff in expected output (like comment #6, but slightly different, I'll post when I have the new package ready).

> As for the failure with none/tests/ppc64/round This is not a regression

Yes, it looks so. Thanks. I'll concentrate on the power_ISA2_05 issue and leave the round issue for upstream.
Comment 9 Mark Wielaard 2013-08-14 13:12:16 EDT
(In reply to Mark Wielaard from comment #8)
> (In reply to IBM Bug Proxy from comment #7)
> > I cannot reproduce the Segmentation fault you're seeing with
> > memcheck/tests/ppc64/power_ISA2_05 on my RHEL 6.4 system (building with
> > stock toolchain).
> 
> I think it is specific to the current RHEL7 toolchain.
> The crash seems to come from not backporting valgrind svn r13490
> https://bugs.kde.org/show_bug.cgi?id=323116
> I am testing a package with that backported.

Nope that isn't it either. For some reason the binary created seems to always crash, even when not ran under valgrind:

Program received signal SIGSEGV, Segmentation fault.
test_reservation () at power_ISA2_05.c:180
180	   __asm__ volatile ("lwarx %0, 20, 21, 1":"=r" (RT));
(gdb) disassemble 
Dump of assembler code for function test_reservation:
   0x0000000010000f80 <+0>:	mflr    r0
   0x0000000010000f84 <+4>:	std     r0,16(r1)
   0x0000000010000f88 <+8>:	std     r31,-8(r1)
   0x0000000010000f8c <+12>:	stdu    r1,-192(r1)
   0x0000000010000f90 <+16>:	mr      r31,r1
   0x0000000010000f94 <+20>:	addis   r9,r2,-2
   0x0000000010000f98 <+24>:	addi    r9,r9,-27992
   0x0000000010000f9c <+28>:	ld      r7,0(r9)
   0x0000000010000fa0 <+32>:	ld      r8,8(r9)
   0x0000000010000fa4 <+36>:	ld      r10,16(r9)
   0x0000000010000fa8 <+40>:	ld      r9,24(r9)
   0x0000000010000fac <+44>:	std     r7,136(r31)
   0x0000000010000fb0 <+48>:	std     r8,144(r31)
   0x0000000010000fb4 <+52>:	std     r10,152(r31)
   0x0000000010000fb8 <+56>:	std     r9,160(r31)
   0x0000000010000fbc <+60>:	addi    r9,r31,136
   0x0000000010000fc0 <+64>:	std     r9,112(r31)
   0x0000000010000fc4 <+68>:	addi    r9,r31,136
   0x0000000010000fc8 <+72>:	addi    r10,r9,8
   0x0000000010000fcc <+76>:	ld      r9,112(r31)
   0x0000000010000fd0 <+80>:	subf    r9,r9,r10
   0x0000000010000fd4 <+84>:	std     r9,120(r31)
   0x0000000010000fd8 <+88>:	ld      r9,112(r31)
   0x0000000010000fdc <+92>:	or      r20,r0,r9
   0x0000000010000fe0 <+96>:	ld      r9,120(r31)
   0x0000000010000fe4 <+100>:	or      r21,r0,r9
=> 0x0000000010000fe8 <+104>:	lwarx   r9,r20,r21,1
   0x0000000010000fec <+108>:	stw     r9,128(r31)
   0x0000000010000ff0 <+112>:	lwz     r9,128(r31)
   0x0000000010000ff4 <+116>:	extsw   r9,r9
   0x0000000010000ff8 <+120>:	addis   r3,r2,-2
   0x0000000010000ffc <+124>:	addi    r3,r3,-28024
   0x0000000010001000 <+128>:	mr      r4,r9
   0x0000000010001004 <+132>:	bl      0x100003e0 <00000011.plt_call.printf@@GLIBC_2.4>
Comment 10 Mark Wielaard 2013-08-14 13:14:30 EDT
That is the binary as compiled in the package. A svn trunk checkout build run seems fine.

(gdb) break power_ISA2_05.c:180
Breakpoint 1 at 0x10000fe8: file power_ISA2_05.c, line 180.
(gdb) run
Starting program: /root/valgrind/memcheck/tests/ppc64/power_ISA2_05 

Breakpoint 1, test_reservation () at power_ISA2_05.c:180
180	   __asm__ volatile ("lwarx %0, 20, 21, 1":"=r" (RT));
Dump of assembler code for function test_reservation:
   0x0000000010000f80 <+0>:	mflr    r0
   0x0000000010000f84 <+4>:	std     r0,16(r1)
   0x0000000010000f88 <+8>:	std     r31,-8(r1)
   0x0000000010000f8c <+12>:	stdu    r1,-192(r1)
   0x0000000010000f90 <+16>:	mr      r31,r1
   0x0000000010000f94 <+20>:	addis   r9,r2,-2
   0x0000000010000f98 <+24>:	addi    r9,r9,-27992
   0x0000000010000f9c <+28>:	ld      r7,0(r9)
   0x0000000010000fa0 <+32>:	ld      r8,8(r9)
   0x0000000010000fa4 <+36>:	ld      r10,16(r9)
   0x0000000010000fa8 <+40>:	ld      r9,24(r9)
   0x0000000010000fac <+44>:	std     r7,136(r31)
   0x0000000010000fb0 <+48>:	std     r8,144(r31)
   0x0000000010000fb4 <+52>:	std     r10,152(r31)
   0x0000000010000fb8 <+56>:	std     r9,160(r31)
   0x0000000010000fbc <+60>:	addi    r9,r31,136
   0x0000000010000fc0 <+64>:	std     r9,112(r31)
   0x0000000010000fc4 <+68>:	addi    r9,r31,136
   0x0000000010000fc8 <+72>:	addi    r10,r9,8
   0x0000000010000fcc <+76>:	ld      r9,112(r31)
   0x0000000010000fd0 <+80>:	subf    r9,r9,r10
   0x0000000010000fd4 <+84>:	std     r9,120(r31)
   0x0000000010000fd8 <+88>:	ld      r9,112(r31)
   0x0000000010000fdc <+92>:	ori     r20,r9,0
   0x0000000010000fe0 <+96>:	ld      r9,120(r31)
   0x0000000010000fe4 <+100>:	ori     r21,r9,0
=> 0x0000000010000fe8 <+104>:	lwarx   r9,r20,r21,1
   0x0000000010000fec <+108>:	stw     r9,128(r31)
   0x0000000010000ff0 <+112>:	lwz     r9,128(r31)
   0x0000000010000ff4 <+116>:	extsw   r9,r9
   0x0000000010000ff8 <+120>:	addis   r3,r2,-2
   0x0000000010000ffc <+124>:	addi    r3,r3,-28024
   0x0000000010001000 <+128>:	mr      r4,r9
   0x0000000010001004 <+132>:	bl      0x100003e0 <00000011.plt_call.printf@@GLIBC_2.4>
Comment 11 Mark Wielaard 2013-08-14 13:17:32 EDT
hmmm, so it is the difference between ori and or after all:

--- /tmp/v.out.1	2013-08-14 19:14:35.569725171 +0200
+++ /tmp/v.out.2	2013-08-14 19:14:54.807651315 +0200
@@ -22,9 +22,9 @@
    0x0000000010000fd0 <+80>:	subf    r9,r9,r10
    0x0000000010000fd4 <+84>:	std     r9,120(r31)
    0x0000000010000fd8 <+88>:	ld      r9,112(r31)
-   0x0000000010000fdc <+92>:	ori     r20,r9,0
+   0x0000000010000fdc <+92>:	or      r20,r0,r9
    0x0000000010000fe0 <+96>:	ld      r9,120(r31)
-   0x0000000010000fe4 <+100>:	ori     r21,r9,0
+   0x0000000010000fe4 <+100>:	or      r21,r0,r9
 => 0x0000000010000fe8 <+104>:	lwarx   r9,r20,r21,1
    0x0000000010000fec <+108>:	stw     r9,128(r31)
    0x0000000010000ff0 <+112>:	lwz     r9,128(r31)

I'll double check again why that is happening. Either I applied the patch wrongly or the configure check somehow detects something different.
Comment 12 Mark Wielaard 2013-08-14 13:36:43 EDT
Think I finally found it, there was another patch upstream missing.

r13279

    test_reservation(), test_double_pair_instrs(): Fix broken inline assembly
    causing segfaults with gcc-4.7.  The inline assembly still isn't right,
    but it's better than it was before.

Retesting again.
Comment 13 Mark Wielaard 2013-08-14 15:40:39 EDT
(In reply to Mark Wielaard from comment #12)
> Think I finally found it, there was another patch upstream missing. r13279.

Yep, that was it. So now everything compiles and nothing is crashing. There is still a diff in output:

=================================================
./memcheck/tests/ppc64/power_ISA2_05.stdout.diff
=================================================
--- power_ISA2_05.stdout.exp	2012-08-17 02:59:47.000000000 -0400
+++ power_ISA2_05.stdout.out	2013-08-14 14:43:40.795465887 -0400
@@ -19,7 +19,7 @@
 lfdp (-1024.000000, 1025.000000) => F_hi=-1024.000000, F_lo=1025.000000
 stfdp (2.204800, -4.102400) => F_hi=2.204800, F_lo=-4.102400
 lfdpx (2.204800, -4.102400) => F_hi=2.204800, F_lo=-4.102400
-stfdpx (2.204800, 2.204800) => F_hi=2.204800, F_lo=2.204800
+stfdpx (-4.102400, 2.204800) => F_hi=-4.102400, F_lo=2.204800
 lfiwax (-1024.000000) => FRT=(ffffffff, c0900000)
 prtyd (0) => parity=0
 prtyw (0) => parity=0

But I think we are now just looking at test output issues and all code generation issues are solved. So for now I mark this fixed in valgrind-3.8.1-24.fc20 and we can work upstream to improve the testsuite.

Please do let me know (or open new bug reports) if there are other ppc64 issues that might need a look or a backport to 3.8.1.
Comment 14 Mark Wielaard 2013-09-25 14:49:09 EDT
Not fully resolved yet. Default powerpc targets have changed and the testsuite build picks this up. We need to explicitly build with the right -mcpu= flag for each test case and not (accidentally) rely on any gcc or rpm-config
Comment 16 Mark Wielaard 2013-09-25 17:03:13 EDT
Sorry, still not fully resolved. We also have to ignore the configure check for PPC floating point phased out category. The result might differ on ppc vs ppc64 and config.h ends up as public header under /usr/include/valgrind causing multilib problems. The result would only be used for two test cases, not in any of the tools.
Comment 18 IBM Bug Proxy 2013-10-25 10:13:00 EDT
To Red Hat team:
I'm confused about what, if anything, I need to do concerning this bug now that the RHEL 7 Partner Inspection Build is available.  The original problem reported involved a segmentation fault in the memcheck/tests/ppc64/power_ISA2_05 testcase which is *not* included in the Valgrind package installed with RHEL.  It seems that a gcc fix was found that resolved that seg fault.  So can we just close this bug?
Comment 19 Mark Wielaard 2013-10-25 10:18:19 EDT
(In reply to IBM Bug Proxy from comment #18)
> To Red Hat team:
> I'm confused about what, if anything, I need to do concerning this bug now
> that the RHEL 7 Partner Inspection Build is available.  The original problem
> reported involved a segmentation fault in the
> memcheck/tests/ppc64/power_ISA2_05 testcase which is *not* included in the
> Valgrind package installed with RHEL.  It seems that a gcc fix was found
> that resolved that seg fault.  So can we just close this bug?

Yes, I think we can close this bug now.

The bug was indeed that when the testsuite was run during package build this testcase would crash. That has been solved. The valgrind testsuite isn't shipped in the package itself. It is only ran during package building to make sure the package itself is sane.
Comment 21 IBM Bug Proxy 2016-01-31 21:41:49 EST
------- Comment From mpjohn@us.ibm.com 2013-08-14 13:31 EDT-------

------- Comment From mpjohn@us.ibm.com 2013-10-25 14:04 EDT-------

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