[LTP] [Valgrind-developers] Suggested fix for the mremap03 syscall testcase
Petr Vorel
pvorel@suse.cz
Fri Oct 16 11:06:23 CEST 2026
Hi Martin,
> Hi Petr,
> with patched testcase, valgrind doesn't crash any more, at least
> my fresh upstream version of valgrind doesn't:
> $ git log -1 --oneline testcases/kernel/syscalls/mremap/mremap03.c
> 3ddcfa8c3 (HEAD -> master) Fix the mremap03 syscall testcase
> $ valgrind --version
> valgrind-3.28.0.GIT
> $ valgrind testcases/kernel/syscalls/mremap/mremap03
> ==1419973== Memcheck, a memory error detector
> ==1419973== Copyright (C) 2002-2026, and GNU GPL'd, by Julian Seward et al.
> ==1419973== Using Valgrind-3.28.0.GIT and LibVEX; rerun with -h for copyright info
> ==1419973== Command: testcases/kernel/syscalls/mremap/mremap03
> ==1419973==
> tst_test.c:2061: TINFO: LTP version: 20260930-20-g3ddcfa8c3
> tst_test.c:2064: TINFO: Tested kernel: 7.2.7-200.fc44.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Sep 21 18:25:57 UTC 2026 x86_64
> tst_kconfig.c:73: TINFO: Couldn't locate kernel config!
> tst_test.c:1895: TINFO: Overall timeout per run is 0h 00m 30s
> mremap03.c:42: TFAIL: mremap(bad_addr, memsize, newsize, MREMAP_MAYMOVE) expected EFAULT: EINVAL (22)
> ==1419992==
> ==1419992== HEAP SUMMARY:
> ==1419992== in use at exit: 0 bytes in 0 blocks
> ==1419992== total heap usage: 13 allocs, 13 frees, 7,647 bytes allocated
> ==1419992==
> ==1419992== All heap blocks were freed -- no leaks are possible
> ==1419992==
> ==1419992== For lists of detected and suppressed errors, rerun with: -s
> ==1419992== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> Summary:
> passed 0
> failed 1
> broken 0
> skipped 0
> warnings 0
> ==1419973==
> ==1419973== HEAP SUMMARY:
> ==1419973== in use at exit: 0 bytes in 0 blocks
> ==1419973== total heap usage: 6 allocs, 6 frees, 4,488 bytes allocated
> ==1419973==
> ==1419973== All heap blocks were freed -- no leaks are possible
> ==1419973==
> ==1419973== For lists of detected and suppressed errors, rerun with: -s
> ==1419973== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> $
> But that doesn't mean things are perfect. The main problem is
> that under valgrind the testcase behaves differently compared to
> a run without valgrind. Looking into it. Thanks for the merge.
I see, there is more work needed :). Anyway, false positive is much better than
test crash and we are happy to have test regression fixed.
Thank you!
Kind regards,
Petr
More information about the ltp
mailing list