Bug 416760 - ppc64le Assertion 'VG_IS_16_ALIGNED(sizeof(struct rt_sigframe))' failed
Summary: ppc64le Assertion 'VG_IS_16_ALIGNED(sizeof(struct rt_sigframe))' failed
Status: CLOSED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-25 18:53 UTC by Mark Wielaard
Modified: 2020-04-17 18:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
PPC64 alginment fix for struct rt_sigframe (864 bytes, patch)
2020-02-21 23:10 UTC, Carl Love
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2020-01-25 18:53:30 UTC
Various ppc64le tests fail on Fedora rawhide with:

valgrind: m_sigframe/sigframe-ppc64-linux.c:155 (vgPlain_sigframe_create): Assertion 'VG_IS_16_ALIGNED(sizeof(struct rt_sigframe))' failed.

I assume something changed the size of struct rt_sigframe, but I haven't investigated what yet. Note that Fedora rawhide currently uses a pre-release of gcc 10 and a pre-release of glibc 2.31.

Linux buildvm-ppc64le-19.ppc.fedoraproject.org 5.4.10-200.fc31.ppc64le #1 SMP Thu Jan 9 19:42:56 UTC 2020 ppc64le ppc64le ppc64le GNU/Linux

glibc-2.30.9000-31.fc32.ppc64le
gcc-10.0.1-0.5.fc32.ppc64le
binutils-2.33.1-12.fc32.ppc64le
Comment 1 Mark Wielaard 2020-01-25 19:21:42 UTC
It looks like this was caused by:

commit 3bac39a10abf292d332bb20ab58c6dd5c28f9108
Author: Eugene Syromyatnikov <evgsyr@gmail.com>
Date:   Fri Mar 8 04:07:00 2019 +0100

    include/vki: fix vki_siginfo_t definition on amd64, arm64, and ppc64

Which was backported to the fedora valgrind 3.15.0 based version.

That patch was to fix bug #405201 Incorrect size of struct vki_siginfo on 64-bit Linux architectures
Comment 2 Carl Love 2020-02-11 16:06:58 UTC
Looks like this bug has also been reported in bug 416760.

https://bugs.kde.org/show_bug.cgi?id=416760
Comment 3 Carl Love 2020-02-11 16:08:10 UTC
Arg, added comment to wrong bug.
Comment 4 Carl Love 2020-02-11 21:08:36 UTC
Found a partial fix.  

The following patch reduces the number of regression tests on PPC64 significantly

 coregrind/m_sigframe/sigframe-ppc64-linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coregrind/m_sigframe/sigframe-ppc64-linux.c b/coregrind/m_sigframe/
sigframe-ppc64-linux.c
index 0406f3c..b54c4e0 100644
--- a/coregrind/m_sigframe/sigframe-ppc64-linux.c
+++ b/coregrind/m_sigframe/sigframe-ppc64-linux.c
@@ -112,7 +112,7 @@ struct rt_sigframe {
    vki_siginfo_t         info;
    struct vg_sig_private priv;
    UChar                 abigap[288];   // unused
-};
+} __attribute__ ((aligned (16)));
 
 #define SET_SIGNAL_LR(zztst, zzval)                          \
    do { tst->arch.vex.guest_LR = (zzval);                    \
-- 
2.7.4

See bugzilla 417427 for more details
Comment 5 Carl Love 2020-02-21 23:10:42 UTC
Created attachment 126279 [details]
PPC64 alginment fix for struct rt_sigframe

The attached patch fixes the alignment for the rt_sigframe structure on PPC64.  This fixes numerous regresion errors.  On power 7, 8 and 9, it fixes 31 stderr failures, 10 stdout failures.
Comment 6 Carl Love 2020-04-17 18:32:49 UTC
The attchement was commited.

commit 6f8920fd8f9381cf75f5dd0c3c65ac5d86c0a537                                 
Author: Carl Love <carll@us.ibm.com>                                            
Date:   Fri Feb 21 17:22:26 2020 -0600                                          
                                                                                
    PPC64, fix for alignment of the rt_sigframe data structure.                 
                                                                                
    The PPC64 implementation checks that the data structure is aligned.  The    
    changes in commit listed below breaks the alignment.  This patch adds an    
    explicit alignment directive to ensure the data structure is allocated      
    with the required alignment.  This fixes 31 stderr failures, 10 stdout      
    failures on the Power 7, Power 8 and Power 9 platforms.            

Changing status to RESOLVED/FIXED
Comment 7 Carl Love 2020-04-17 18:33:20 UTC
Closing as there has been no regression fallout from the fix.