From: "Thomas Weißschuh" <thomas@t-8ch.de>
To: Zhangjin Wu <falcon@tinylab.org>
Cc: w@1wt.eu, arnd@arndb.de, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v1 3/8] selftests/nolibc: select_null: fix up for big endian powerpc64
Date: Wed, 19 Jul 2023 00:17:00 +0200 [thread overview]
Message-ID: <be205fbd-31c2-4066-bfb1-65b9d0cb57c2@t-8ch.de> (raw)
In-Reply-To: <56e91281fde98fb3b2e34986d96870d76ebc3238.1689713175.git.falcon@tinylab.org>
As this would be a generic bugfix it should be at the front of the
series, but...
On 2023-07-19 05:13:01+0800, Zhangjin Wu wrote:
> The following error reported while running nolibc-test on the big endian
> 64-bit PowerPC kernel compiled with powerpc64le-linux-gnu-gcc in Ubuntu
> 20.04.
>
> 56 select_nullinit[1]: illegal instruction (4) at 100042a8 nip 100042a8 lr 100042a8 code 1 in init[10000000+10000]
> init[1]: code: 7c6307b4 7c234840 4081f580 7c6300d0 907d0000 3860ffff 4bfff570 3ca2fffe
> init[1]: code: 38800038 38a5d547 7fc3f378 4bffcd65 <1000038c> 38c10060 38a00000 38800000
>
> Let's explicitly initialize all of the timeval members to zero.
>
> Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
> ---
> tools/testing/selftests/nolibc/nolibc-test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
> index 03b1d30f5507..ec2c7774522e 100644
> --- a/tools/testing/selftests/nolibc/nolibc-test.c
> +++ b/tools/testing/selftests/nolibc/nolibc-test.c
> @@ -858,7 +858,7 @@ int run_syscall(int min, int max)
> CASE_TEST(read_badf); EXPECT_SYSER(1, read(-1, &tmp, 1), -1, EBADF); break;
> CASE_TEST(rmdir_blah); EXPECT_SYSER(1, rmdir("/blah"), -1, ENOENT); break;
> CASE_TEST(sched_yield); EXPECT_SYSZR(1, sched_yield()); break;
> - CASE_TEST(select_null); EXPECT_SYSZR(1, ({ struct timeval tv = { 0 }; select(0, NULL, NULL, NULL, &tv); })); break;
> + CASE_TEST(select_null); EXPECT_SYSZR(1, ({ struct timeval tv = { 0, 0 }; select(0, NULL, NULL, NULL, &tv); })); break;
This doesn't really make sense.
Firstly, "{ 0 }" zeroes the whole structure.
Also the warning talks about "illegal instruction" while this structure
is data and should never be executed as code.
Is this failure reproducible?
Maybe the error is actually in the syscall wrapper?
I'll also take a look tomorrow.
> CASE_TEST(select_stdout); EXPECT_SYSNE(1, ({ fd_set fds; FD_ZERO(&fds); FD_SET(1, &fds); select(2, NULL, &fds, NULL, NULL); }), -1); break;
> CASE_TEST(select_fault); EXPECT_SYSER(1, select(1, (void *)1, NULL, NULL, 0), -1, EFAULT); break;
> CASE_TEST(stat_blah); EXPECT_SYSER(1, stat("/proc/self/blah", &stat_buf), -1, ENOENT); break;
> --
> 2.25.1
>
next prev parent reply other threads:[~2023-07-18 22:17 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 21:09 [PATCH v1 0/8] tools/nolibc: add 32/64-bit powerpc support Zhangjin Wu
2023-07-18 21:10 ` [PATCH v1 1/8] tools/nolibc: add support for powerpc Zhangjin Wu
2023-07-23 7:32 ` Thomas Weißschuh
2023-07-23 8:15 ` Willy Tarreau
2023-07-25 5:44 ` Zhangjin Wu
2023-07-25 6:29 ` Willy Tarreau
2023-07-25 11:02 ` Zhangjin Wu
2023-07-25 14:45 ` Ammar Faizi
2023-07-25 17:04 ` Zhangjin Wu
2023-07-25 18:23 ` Ammar Faizi
2023-07-25 20:23 ` Zhangjin Wu
2023-07-25 18:27 ` Willy Tarreau
2023-07-25 20:52 ` Zhangjin Wu
2023-07-25 6:14 ` Zhangjin Wu
2023-07-18 21:11 ` [PATCH v1 2/8] tools/nolibc: add support for powerpc64 Zhangjin Wu
2023-07-18 21:13 ` [PATCH v1 3/8] selftests/nolibc: select_null: fix up for big endian powerpc64 Zhangjin Wu
2023-07-18 22:17 ` Thomas Weißschuh [this message]
2023-07-18 23:56 ` Zhangjin Wu
2023-07-19 4:33 ` Willy Tarreau
2023-07-19 6:49 ` Zhangjin Wu
2023-07-19 20:25 ` Willy Tarreau
2023-07-20 6:11 ` Thomas Weißschuh
2023-07-18 21:14 ` [PATCH v1 4/8] selftests/nolibc: add extra config file customize support Zhangjin Wu
2023-07-22 12:00 ` Willy Tarreau
2023-07-25 14:30 ` Zhangjin Wu
2023-07-29 7:45 ` Willy Tarreau
2023-07-29 9:43 ` Zhangjin Wu
2023-07-18 21:15 ` [PATCH v1 5/8] selftests/nolibc: add XARCH and ARCH mapping support Zhangjin Wu
2023-07-22 12:03 ` Willy Tarreau
2023-07-18 21:16 ` [PATCH v1 6/8] selftests/nolibc: add test support for powerpc Zhangjin Wu
2023-07-18 21:17 ` [PATCH v1 7/8] selftests/nolibc: add test support for powerpc64le Zhangjin Wu
2023-07-22 12:07 ` Willy Tarreau
2023-07-18 21:18 ` [PATCH v1 8/8] selftests/nolibc: add test support for powerpc64 Zhangjin Wu
2023-07-22 12:10 ` Willy Tarreau
2023-07-25 5:50 ` Zhangjin Wu
2023-07-25 6:02 ` Willy Tarreau
2023-07-23 7:47 ` [PATCH v1 0/8] tools/nolibc: add 32/64-bit powerpc support Thomas Weißschuh
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=be205fbd-31c2-4066-bfb1-65b9d0cb57c2@t-8ch.de \
--to=thomas@t-8ch.de \
--cc=arnd@arndb.de \
--cc=falcon@tinylab.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=w@1wt.eu \
/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