From 952834e2799d559d66d6fe22d63651fda9d5f681 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Mon, 22 Jul 2024 13:43:07 -0400 Subject: [PATCH] tests: fix valgrind FP We're seeing an fp from valgrind with this stack trace on ubuntu-18-arm64 plus a warning about an unhandled syscall. ``` 11: [INFO]: ==10880== Invalid write of size 8 11: [INFO]: ==10880== at 0x17BDD0: cdiff_apply (cdiff.rs:576) 11: [INFO]: ==10880== by 0x17354F: rundiff (sigtool.c:1970) 11: [INFO]: ==10880== by 0x17354F: main (sigtool.c:3796) 11: [INFO]: ==10880== Address 0x1ffeffea40 is on thread 1's stack 11: [INFO]: ==10880== 128 bytes below stack pointer 11: [INFO]: ==10880== 11: [INFO]: { 11: [INFO]: 11: [INFO]: Memcheck:Addr8 11: [INFO]: fun:cdiff_apply 11: [INFO]: fun:rundiff 11: [INFO]: fun:main 11: [INFO]: } 11: [INFO]: --10880-- WARNING: unhandled arm64-linux syscall: 291 11: [INFO]: ==10880== at 0x573A4D4: syscall (syscall.S:39) 11: [INFO]: ==10880== by 0x3A8183: statx (weak.rs:176) 11: [INFO]: ==10880== by 0x3A8183: std::sys::pal::unix::fs::try_statx (fs.rs:196) 11: [INFO]: ==10880== by 0x386227: file_attr (fs.rs:1189) 11: [INFO]: ==10880== by 0x386227: std::fs::File::metadata (fs.rs:588) 11: [INFO]: ==10880== by 0x17BF2B: read_dsig (cdiff.rs:1080) 11: [INFO]: ==10880== by 0x17BF2B: cdiff_apply (cdiff.rs:619) 11: [INFO]: ==10880== by 0x17BF2B: cdiff_apply (cdiff.rs:590) 11: [INFO]: ==10880== by 0x17354F: rundiff (sigtool.c:1970) 11: [INFO]: ==10880== by 0x17354F: main (sigtool.c:3796) 11: [INFO]: --10880-- You may be able to write your own handler. 11: [INFO]: --10880-- Read the file README_MISSING_SYSCALL_OR_IOCTL. 11: [INFO]: --10880-- Nevertheless we consider this a bug. Please report 11: [INFO]: --10880-- it at http://valgrind.org/support/bug_reports.html. ``` We already have multiple variants of suppressions to ignore these `statx` false positives. In this case, for some reason valgrind isn't getting the full call stack and is just blaming `cdiff_apply`. Add a blanket suppression for `cdiff_apply` to make the tests pass. --- unit_tests/valgrind.supp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unit_tests/valgrind.supp b/unit_tests/valgrind.supp index 1222870043..2d8e7cd33a 100644 --- a/unit_tests/valgrind.supp +++ b/unit_tests/valgrind.supp @@ -365,6 +365,12 @@ fun:statx ... } +{ + + Memcheck:Addr8 + fun:cdiff_apply + ... +} { Memcheck:Cond