Re: [LTP] [PATCH v2] getcpu: Add testcase for EFAULT

Petr Vorel
2024-07-29T22:57:19Z

Hi Ma, Cyril,

...
> +static void run(void)
> +{
> + unsigned int cpu_id, node_id = 0;
> +
> + TST_EXP_FAIL(getcpu(tst_get_bad_addr(NULL), &node_id), EFAULT);
I'm not sure why, but I get SIGSEGV due tst_get_bad_addr(NULL) on various
kernels (SLES 5.14.21, Tumbleweed 6.5.1, 6.10, Debian 6.9, ...).

But the test works on SLES 4.4.180.

Kind regards,
Petr

> + TST_EXP_FAIL(getcpu(&cpu_id, tst_get_bad_addr(NULL)), EFAULT);
> +}
> +
> +static struct tst_test test = {
> + .test_all = run,
> +};