Bug 509642

Summary: Missing ppc64-linux syswraps already implemented on other linux arches.
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: generalAssignee: mcermak
Status: RESOLVED FIXED    
Severity: normal CC: mcermak
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
proposed patch
updated patch

Description Mark Wielaard 2025-09-18 16:13:11 UTC
The following syscalls don't seem to be wrapped on ppc64 even though they already have generic or linux wrappers on other arches: stime, setns, semtimedop, semctl, shmctl, msgctl, sigpending and
settimeofday.
Comment 1 mcermak 2025-09-19 08:50:33 UTC
To test this I've used:

TESTS="$(find . -type f -perm -u+x \( -name 'stime0*' -or -name 'setns0*' -or -name 'semop0*' -or -name 'semctl0*' -or -name 'shmctl0*' -or -name 'msgctl0*' -or -name 'sigpending0*' -or -name 'settimeofday0*' \) -exec basename '{}' ';')" make -j$(nproc) ltpchecks

This gives the following test results (when running under root):




el9 x86_64
Brief LTP test results summary
-----------------------------------------
PASS: 34
FAIL: 1
-----------------------------------------




el10 aarch64
Brief LTP test results summary
-----------------------------------------
PASS: 31
FAIL: 4
-----------------------------------------




el10 x86_64
Brief LTP test results summary
-----------------------------------------
PASS: 32
FAIL: 3
-----------------------------------------





el10 s390x
Brief LTP test results summary
-----------------------------------------
PASS: 22
FAIL: 13
-----------------------------------------




el9 s390x
Brief LTP test results summary
-----------------------------------------
PASS: 24
FAIL: 11
-----------------------------------------




el9 ppc64le
Brief LTP test results summary
-----------------------------------------
PASS: 18
FAIL: 17
-----------------------------------------




el9 aarch64
Brief LTP test results summary
-----------------------------------------
PASS: 33
FAIL: 2
-----------------------------------------




el10 ppc64le
Brief LTP test results summary
-----------------------------------------
PASS: 17
FAIL: 18
-----------------------------------------



So seems like there's some work across arches.  Will start trying fixing this one by one.
Comment 2 mcermak 2025-09-19 09:32:53 UTC
Hmmm, these testcases seem to be sensitive to parallelization, in which case they tend to be flaky.  Running them one by one seems to give more reliable test results:

TESTS=msgctl01 make ltpchecks OK
TESTS=msgctl02 make ltpchecks OK
TESTS=msgctl03 make ltpchecks OK
TESTS=msgctl04  make ltpchecks  FAILs on s390 and ppc64le
TESTS=msgctl05 make ltpchecks OK
TESTS=msgctl06 make ltpchecks OK
TESTS=semctl01 make ltpchecks OK
TESTS=semctl02 make ltpchecks OK
TESTS=semctl03 make ltpchecks FAILs on s390 and ppc64le
TESTS=semctl04 make ltpchecks OK
TESTS=semctl05 make ltpchecks OK
TESTS=semctl06 make ltpchecks OK
TESTS=semctl07 make ltpchecks OK
TESTS=semctl08 make ltpchecks OK
TESTS=semctl09 make ltpchecks FAILs on s390 and ppc64le
TESTS=semop01 make ltpchecks FAILs on s390 and ppc64le
TESTS=semop02 make ltpchecks FAILs on s390 and ppc64le
TESTS=semop03 make ltpchecks FAILs on s390 and ppc64le
TESTS=semop04 make ltpchecks OK
TESTS=semop05 make ltpchecks OK (takes long)
TESTS=setns01 make ltpchecks FAILs on ppc64le
TESTS=setns02 make ltpchecks FAILs on s390 and ppc64le
TESTS=settimeofday01 make ltpchecks OK
TESTS=settimeofday02 make ltpchecks OK
TESTS=shmctl01 make ltpchecks OK
TESTS=shmctl02 make ltpchecks FAILs on s390 and ppc64le
TESTS=shmctl03 make ltpchecks OK
TESTS=shmctl04 make ltpchecks OK
TESTS=shmctl05 make ltpchecks Is SLOW and FAILS everywhere except el9 x86_64
TESTS=shmctl06 make ltpchecks OK
TESTS=shmctl07 make ltpchecks OK
TESTS=shmctl08 make ltpchecks OK
TESTS=sigpending02 make ltpchecks FAILs on s390 and ppc64le
TESTS=stime01 make ltpchecks FAILs on ppc64le
TESTS=stime02 make ltpchecks FAILs on ppc64le
Comment 3 mcermak 2025-09-19 12:18:31 UTC
Created attachment 185091 [details]
proposed patch
Comment 4 mcermak 2025-09-19 12:19:52 UTC
I'm going to update the above patch so that it also covers https://bugs.kde.org/show_bug.cgi?id=509643 .
Comment 5 mcermak 2025-09-19 12:59:32 UTC
Created attachment 185095 [details]
proposed patch

This patch also covers https://bugs.kde.org/show_bug.cgi?id=509643 .

Related testcases:
TESTS=bpf_prog01 make ltpchecks   OK
TESTS=bpf_map01 make ltpchecks    OK
TESTS=bpf_prog02 make ltpchecks   OK
TESTS=bpf_prog03 make ltpchecks   OK
TESTS=bpf_prog04 make ltpchecks   OK
TESTS=bpf_prog06 make ltpchecks   OK
TESTS=bpf_prog05 make ltpchecks   OK
TESTS=bpf_prog07 make ltpchecks   OK
TESTS=sethostname02 make ltpchecks OK
TESTS=sethostname01 make ltpchecks OK
TESTS=sethostname03 make ltpchecks OK
TESTS=adjtimex01 make ltpchecks OK
TESTS=adjtimex02 make ltpchecks OK
TESTS=adjtimex03 make ltpchecks OK
Comment 6 Mark Wielaard 2025-09-19 13:07:58 UTC
Could you change the word "hook" in the commit message to "syswrap"?
And add the two bug URLs to the commit message and NEWS?
Comment 7 mcermak 2025-09-19 13:42:47 UTC
Created attachment 185097 [details]
updated patch

Absolutely.  Thanks for your review!   Please check the updated patch.
Comment 8 Mark Wielaard 2025-09-19 15:21:13 UTC
Double checked the GEN/LIN macros, fixed two whitespace issues and pushed:

commit 53c66de8857300172c62827a4fc06e28685892a0 (HEAD -> master, origin/master, origin/HEAD)
Author: Martin Cermak <mcermak@redhat.com>
Date:   Fri Sep 19 11:47:14 2025 +0200

    Add missing ppc64-linux and s390x-linux syswraps existing on other arches
    
    This update adds following ppc64le and s390x syswraps:
     - sys_msgctl
     - sys_semctl
     - sys_semtimedop
     - sys_sethostname
     - sys_shmctl
     - sys_sigpending
     - sys_stime
    
    This update adds following ppc64le syswraps:
     - sys_setns
    
    This update adds following s390x syswraps:
     - sys_bpf
    
    Blacklist the shmctl05, as it is a long running one.  It does
    pass on all architectures afaics, but needs a relatively high
    LTP_TIMEOUT_MUL setting. So, let's skip that one.
    
    https://bugs.kde.org/show_bug.cgi?id=509642
    https://bugs.kde.org/show_bug.cgi?id=509643