From: Martin Cermak via ltp <ltp@lists.linux.it>
To: Petr Vorel <pvorel@suse.cz>
Cc: valgrind-developers@lists.sourceforge.net,
Mark Wielaard <mark@klomp.org>,
ltp@lists.linux.it
Subject: Re: [LTP] [Valgrind-developers] Suggested fix for the mremap03 syscall testcase
Date: Thu, 15 Oct 2026 11:01:41 +0200 [thread overview]
Message-ID: <atCVc5kQoGx5spgk@toolbx> (raw)
In-Reply-To: <20261015083851.GA290292@pevik>
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.
Martin
On Thu 2026-10-15 10:38 , Petr Vorel wrote:
> Hi Martin, Andrea,
>
> > Hi Martin,
>
> > you are right. That’s a bug we didn’t spot during the test rewrite. Thanks.
>
> Good catch, Martin, you're of course right => turned into proper patch and
> merged.
>
> valgrind ./mremap03
> tst_test.c:1895: TINFO: Overall timeout per run is 0h 00m 30s
> --292799-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting
> --292799-- si_code=1; Faulting address: 0x8; sp: 0x1002ef2cc0
>
> valgrind: the 'impossible' happened:
> Killed by fatal signal
>
> host stacktrace:
> ==292799== at 0x580AE3D3: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
> ==292799== by 0x580A7ED9: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
> ==292799== by 0x580A387A: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
> ==292799== by 0x580A58A6: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
> ==292799== by 0x58115088: ??? (in /usr/libexec/valgrind/memcheck-amd64-linux)
>
> BTW testcase after fix still fails, but that's I suppose just expected valgrind
> behavior on mmap(PROT_NONE), right?
>
> valgrind ./mremap03
> ==292941== Memcheck, a memory error detector
> ==292941== Copyright (C) 2002-2026, and GNU GPL'd, by Julian Seward et al.
> ==292941== Using Valgrind-3.27.1 and LibVEX; rerun with -h for copyright info
> ==292941== Command: ./mremap03
> ==292941==
> tst_test.c:2061: TINFO: LTP version: 20260930-20-gd494a8e1c9
> ...
> 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)
>
> Kind regards,
> Petr
>
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2026-10-15 9:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 12:20 [LTP] Suggested fix for the mremap03 syscall testcase Martin Cermak via ltp
2026-10-14 16:42 ` [LTP] Fix " linuxtestproject.agent
2026-10-14 18:32 ` [LTP] Suggested fix for " Andrea Cervesato via ltp
2026-10-15 8:38 ` [LTP] [Valgrind-developers] " Petr Vorel
2026-10-15 9:01 ` Martin Cermak via ltp [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=atCVc5kQoGx5spgk@toolbx \
--to=ltp@lists.linux.it \
--cc=mark@klomp.org \
--cc=mcermak@redhat.com \
--cc=pvorel@suse.cz \
--cc=valgrind-developers@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox