Linux Test Project
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: linuxtestproject.agent@gmail.com
Cc: ltp@lists.linux.it
Subject: Re: [LTP] thp04: Fix PTRACE mode for CONFIG_PROC_MEM_FORCE_PTRACE=y
Date: Thu, 02 Jul 2026 08:58:25 +0000	[thread overview]
Message-ID: <6a462831.25509765.22e979.4fe7@mx.google.com> (raw)
In-Reply-To: <20260701122826.4115-1-linuxtestproject.agent@gmail.com>

Hi Jan,

> The patch drops lapi/mmap.h but the test still uses MADV_HUGEPAGE (in
> alloc_zero_page) and MADV_DONTNEED (multiple call sites). The fallback
> defines for these constants live in lapi/mmap.h. On toolchains where
> <sys/mman.h> does not provide them, this will fail to compile.

This is correct. Please always use lapi/mmap.h instead of the
sys/mman.h. In this way we are sure to fallback to an existing
value and LTP compiles in any machine that doesn't have those
definitions.

> 
> > +static void run_proc_mem_ptrace_race(void)
> > +{
> > +	/* After 1000 iterations, let tracee exit cleanly */
> > +	SAFE_PTRACE(PTRACE_CONT, tracee_pid, NULL, NULL);
> > +	SAFE_WAITPID(tracee_pid, &status, 0);
> 
> After run_proc_mem_ptrace_race() returns, the tracee has been reaped.
> If the framework re-invokes run() (e.g. via -i 2), the next call to
> SAFE_OPEN("/proc/<pid>/mem") will hit ENOENT and abort with TBROK.
> 
> The PROC_MEM_ALWAYS path survives re-invocation because
> tst_fzsync_run_a() returns false immediately when runtime expires. The
> ptrace path could either re-spawn the tracee in run(), or guard with
> an early return when tracee_pid is no longer alive.

This is also correct. Always run the test with `-i` as well.
Also, take a look at tst_reap_children(), because it looks like
we are duplicating the same functionality with SAFE_WAITPID() here.

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-07-02  8:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 11:12 [LTP] [PATCH v3] thp04: Fix PTRACE mode for CONFIG_PROC_MEM_FORCE_PTRACE=y Jan Polensky
2026-07-01 12:28 ` [LTP] " linuxtestproject.agent
2026-07-02  8:58   ` Andrea Cervesato via ltp [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-06-12 17:17 [LTP] [PATCH v2 1/1] " Jan Polensky
2026-06-12 19:21 ` [LTP] " linuxtestproject.agent
2026-07-01 10:27   ` Jan Polensky

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=6a462831.25509765.22e979.4fe7@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=linuxtestproject.agent@gmail.com \
    /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