This is a hacky rebase of #1433 to add valgrind coverage on armhf for gcc and clang.
However, as explained in #1856, it doesn't work, due to Source and destination overlap in memcpy.
45 | @@ -45,6 +46,13 @@ if [ -n "${CC+x}" ]; then 46 | # The MSVC compiler "cl" doesn't understand "-v" 47 | $CC -v || true 48 | fi 49 | +if [ -n "${VALGRIND_EXTRA_PACKAGES+x}" ]; then 50 | + # Install an architecture-specific Valgrind build when the job requests it. 51 | + # This is used for armhf memcheck jobs on arm64 runners. 52 | + # shellcheck disable=SC2086 53 | + DEBIAN_FRONTEND=noninteractive apt-get update && \ 54 | + DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y $VALGRIND_EXTRA_PACKAGES
If someone picks this up, installation of valgrind:armhf should probably need to move into the dockerfile.
GH will delete the CI log in 90 days, but for reference it was:
tests.log
==3547== Memcheck, a memory error detector
==3547== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==3547== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
==3547== Command: ./tests
==3547==
Tests running silently. Use '-log=1' to enable detailed logging
iterations = 2
jobs = 0. Sequential execution.
random seed = 77a8af5c6aa48b86649537af97686fac
Skipping run_sha256_known_output_tests 1000000 (iteration count too low)
==3547== Source and destination overlap in memcpy(0xfeec0288, 0xfeec0288, 148)
==3547== at 0x4881658: memcpy (vg_replace_strmem.c:1150)
==3547== by 0x131C0F: secp256k1_gej_add_var (group_impl.h:541)
==3547== by 0x136B13: test_ge (tests.c:4027)
==3547== by 0x13737D: run_ge (tests.c:4250)
==3547== by 0x109981: run_sequential (unit_test.c:275)
==3547== by 0x109981: tf_run (unit_test.c:464)
==3547== by 0x109981: main (tests.c:8081)
==3547==
However, as explained in #1856, it doesn't work, due to Source and destination overlap in memcpy.
Closing for now, let's continue discussion in the issue.