https://bugs.kde.org/show_bug.cgi?id=431157
--- Comment #16 from Mark Wielaard <m...@klomp.org> ---
(In reply to Carl Love from comment #15)
> Created attachment 135371 [details]
> patch to add support for the scv instruction
> 
> Cleaned up formatting, spacing and a minor functional fix.

Unfortunately this patch doesn't seem to work correctly on a ppc64le setup with
linux 5.11.0 and glibc 2.32.9000, which uses SCV:

 LD_SHOW_AUXV=1 /bin/true
AT_DCACHEBSIZE:       0x80
AT_ICACHEBSIZE:       0x80
AT_UCACHEBSIZE:       0x0
AT_SYSINFO_EHDR:      0x7fff905c0000
AT_L1I_CACHESIZE:     32768
AT_L1I_CACHEGEOMETRY: 128B line size, 32-way set associative
AT_L1D_CACHESIZE:     32768
AT_L1D_CACHEGEOMETRY: 128B line size, 32-way set associative
AT_L2_CACHESIZE:      524288
AT_L2_CACHEGEOMETRY:  32B line size, 2048-way set associative
AT_L3_CACHESIZE:      10485760
AT_L3_CACHEGEOMETRY:  32B line size, 40960-way set associative
AT_HWCAP:             true_le archpmu vsx arch_2_06 dfp ic_snoop smt mmu fpu
altivec ppc64 ppc32
AT_PAGESZ:            65536
AT_CLKTCK:            100
AT_PHDR:              0x10f1b0040
AT_PHENT:             56
AT_PHNUM:             9
AT_BASE:              0x7fff905d0000
AT_FLAGS:             0x0
AT_ENTRY:             0x10f1b1ad8
AT_UID:               0
AT_EUID:              0
AT_GID:               0
AT_EGID:              0
AT_SECURE:            0
AT_RANDOM:            0x7fffcd3e3272
AT_HWCAP2:            scv darn ieee128 arch_3_00 vcrypto tar isel ebb dscr
arch_2_07
AT_EXECFN:            /bin/true
AT_PLATFORM:          power9
AT_BASE_PLATFORM:     power9

A simple testcase:

# LANG=en.UTF-8 ./vg-in-place /bin/true --help
==108495== Memcheck, a memory error detector
==108495== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==108495== Using Valgrind-3.17.0.GIT and LibVEX; rerun with -h for copyright
info
==108495== Command: /bin/true --help
==108495== 
==108495== Warning: invalid file descriptor -2 in syscall openat()
==108495== Invalid read of size 4
==108495==    at 0x492B7C0: _nl_load_locale_from_archive (in
/usr/lib64/power9/libc-2.32.9000.so)
==108495==    by 0x4929ECF: _nl_find_locale (in
/usr/lib64/power9/libc-2.32.9000.so)
==108495==    by 0x492945F: setlocale (in /usr/lib64/power9/libc-2.32.9000.so)
==108495==    by 0x181963: ??? (in /usr/bin/true)
==108495==    by 0x49195B3: generic_start_main.constprop.0.isra.0 (in
/usr/lib64/power9/libc-2.32.9000.so)
==108495==    by 0x491978F: (below main) (in
/usr/lib64/power9/libc-2.32.9000.so)
==108495==  Address 0x26 is not stack'd, malloc'd or (recently) free'd
==108495== 
==108495== 
==108495== Process terminating with default action of signal 11 (SIGSEGV):
dumping core
==108495==  Access not within mapped region at address 0x26
==108495==    at 0x492B7C0: _nl_load_locale_from_archive (in
/usr/lib64/power9/libc-2.32.9000.so)
==108495==    by 0x4929ECF: _nl_find_locale (in
/usr/lib64/power9/libc-2.32.9000.so)
==108495==    by 0x492945F: setlocale (in /usr/lib64/power9/libc-2.32.9000.so)
==108495==    by 0x181963: ??? (in /usr/bin/true)
==108495==    by 0x49195B3: generic_start_main.constprop.0.isra.0 (in
/usr/lib64/power9/libc-2.32.9000.so)
==108495==    by 0x491978F: (below main) (in
/usr/lib64/power9/libc-2.32.9000.so)
==108495==  If you believe this happened as a result of a stack
==108495==  overflow in your program's main thread (unlikely but
==108495==  possible), you can try to increase the size of the
==108495==  main thread stack using the --main-stacksize= flag.
==108495==  The main thread stack size used in this run was 8388608.
==108495== 
==108495== HEAP SUMMARY:
==108495==     in use at exit: 0 bytes in 0 blocks
==108495==   total heap usage: 1 allocs, 1 frees, 5 bytes allocated
==108495== 
==108495== All heap blocks were freed -- no leaks are possible
==108495== 
==108495== For lists of detected and suppressed errors, rerun with: -s
==108495== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
./vg-in-place: line 31: 108495 Segmentation fault      (core dumped)
VALGRIND_LIB="$vgbasedir/.in_place" VALGRIND_LIB_INNER="$vgbasedir/.in_place"
"$vgbasedir/coregrind/valgrind" "$@"

make regtest also shows various failures:

== 638 tests, 44 stderr failures, 14 stdout failures, 0 stderrB failures, 0
stdoutB failures, 3 post failures ==
memcheck/tests/buflen_check              (stderr)
memcheck/tests/bug340392                 (stderr)
memcheck/tests/erringfds                 (stdout)
memcheck/tests/erringfds                 (stderr)
memcheck/tests/file_locking              (stderr)
memcheck/tests/leak_cpp_interior         (stderr)
memcheck/tests/linux/memfd               (stderr)
memcheck/tests/linux/rfcomm              (stderr)
memcheck/tests/linux/sys-execveat        (stderr)
memcheck/tests/linux/sys-openat          (stderr)
memcheck/tests/linux/sys-preadv_pwritev  (stderr)
memcheck/tests/linux/timerfd-syscall     (stderr)
memcheck/tests/null_socket               (stdout)
memcheck/tests/post-syscall              (stderr)
memcheck/tests/sigkill                   (stderr)
memcheck/tests/supp_unknown              (stderr)
memcheck/tests/writev1                   (stderr)
drd/tests/sem_open                       (stderr)
drd/tests/sem_open2                      (stderr)
drd/tests/sem_open3                      (stderr)
drd/tests/sem_open_traced                (stderr)
drd/tests/std_list                       (stderr)
drd/tests/swapcontext                    (stderr)
massif/tests/deep-D                      (post)
massif/tests/new-cpp                     (post)
massif/tests/overloaded-new              (post)
none/tests/coolo_sigaction               (stdout)
none/tests/coolo_sigaction               (stderr)
none/tests/empty-exe                     (stderr)
none/tests/linux/mremap                  (stderr)
none/tests/linux/mremap2                 (stdout)
none/tests/linux/mremap2                 (stderr)
none/tests/map_unaligned                 (stderr)
none/tests/nocwd                         (stdout)
none/tests/nocwd                         (stderr)
none/tests/pth_cancel2                   (stderr)
none/tests/rlimit64_nofile               (stderr)
none/tests/rlimit_nofile                 (stderr)
none/tests/scripts/bug231357             (stdout)
none/tests/scripts/bug231357             (stderr)
none/tests/scripts/nointerp1             (stdout)
none/tests/scripts/nointerp1             (stderr)
none/tests/scripts/nointerp2             (stdout)
none/tests/scripts/nointerp2             (stderr)
none/tests/scripts/nointerp3             (stdout)
none/tests/scripts/nointerp3             (stderr)
none/tests/scripts/nointerp4             (stderr)
none/tests/scripts/nointerp5             (stderr)
none/tests/scripts/relative1             (stdout)
none/tests/scripts/relative1             (stderr)
none/tests/scripts/relative2             (stdout)
none/tests/scripts/relative2             (stderr)
none/tests/scripts/shell                 (stdout)
none/tests/scripts/shell                 (stderr)
none/tests/scripts/shell_valid1          (stderr)
none/tests/scripts/shell_valid4          (stdout)
none/tests/scripts/shell_valid4          (stderr)
none/tests/scripts/shell_zerolength      (stderr)
none/tests/syscall-restart1              (stderr)
none/tests/syscall-restart2              (stderr)
none/tests/threadederrno                 (stdout)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to