Linux Test Project
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Michael Menasherov via ltp" <ltp@lists.linux.it>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4 1/4] futex_wait06: Add EFAULT error coverage test
Date: Tue, 19 May 2026 14:44:53 +0000	[thread overview]
Message-ID: <6a0c7766.10c0728e.160297.c17e@mx.google.com> (raw)
In-Reply-To: <20260507111809.28934-2-mmenashe@redhat.com>

Hi Michael,

> +	SAFE_MUNMAP(bad, getpagesize());
> +
> +	testcases[0] = (struct testcase){
> +		.desc = "uaddr points to unmapped memory",
> +		.uaddr = bad,
> +		.timeout = NULL,
> +	};
> +	testcases[1] = (struct testcase){
> +		.desc = "timeout points to unmapped memory",
> +		.uaddr = &futex,
> +		.timeout = bad,
> +	};

This is not the standard approach. Test cases should be defined at
compile-time with a `uaddr` double pointer pointing to `&bad`.

static struct testcase {
  const char *desc;
  futex_t **uaddr;
  void *timeout;
} testcases[] = {
  {
		.desc = "uaddr points to unmapped memory",
  	.uaddr = &bad,
  	.timeout = NULL,
  },

 ..
};

And in the `setup()` we will only need to initialize `bad` memory
pointer.

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

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

  parent reply	other threads:[~2026-05-19 14:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 11:18 [LTP] [PATCH v4 0/4] futex: Add error coverage tests for wait, wake and cmp_requeue Michael Menasherov via ltp
2026-05-07 11:18 ` [LTP] [PATCH v4 1/4] futex_wait06: Add EFAULT error coverage test Michael Menasherov via ltp
2026-05-07 12:01   ` [LTP] " linuxtestproject.agent
2026-05-13  8:35     ` Michael Menasherov via ltp
2026-05-18 18:23       ` Michael Menasherov via ltp
2026-05-19  8:25         ` Andrea Cervesato via ltp
2026-05-19 14:44   ` Andrea Cervesato via ltp [this message]
2026-05-07 11:18 ` [LTP] [PATCH v4 2/4] futex_wait07: Add EINTR " Michael Menasherov via ltp
2026-05-19 14:47   ` Andrea Cervesato via ltp
2026-05-07 11:18 ` [LTP] [PATCH v4 3/4] futex_wake05: Add EFAULT " Michael Menasherov via ltp
2026-05-19 14:48   ` Andrea Cervesato via ltp
2026-05-07 11:18 ` [LTP] [PATCH v4 4/4] futex_cmp_requeue03: " Michael Menasherov via ltp
2026-05-18 18:25   ` Michael Menasherov via ltp
2026-05-19 14:49   ` Andrea Cervesato via ltp

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=6a0c7766.10c0728e.160297.c17e@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.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