public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/3] Report clone04 failure on musl
@ 2023-09-25 15:13 Petr Vorel
  2023-09-25 15:13 ` [LTP] [PATCH 1/3] lib/tst_test.c: docparse/testinfo.pl: Add support for musl git fixes Petr Vorel
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Petr Vorel @ 2023-09-25 15:13 UTC (permalink / raw)
  To: ltp; +Cc: Richard Palethorpe

This required to add musl-git support into lib.

Petr Vorel (3):
  lib/tst_test.c: docparse/testinfo.pl: Add support for musl git fixes
  clone04: Add musl-git tag
  lib/tst_test.c: Print failure hints also for TBROK

 docparse/testinfo.pl                      | 3 ++-
 lib/tst_test.c                            | 8 +++++++-
 testcases/kernel/syscalls/clone/clone04.c | 5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)

-- 
2.40.1


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP] [PATCH 1/3] lib/tst_test.c: docparse/testinfo.pl: Add support for musl git fixes
  2023-09-25 15:13 [LTP] [PATCH 0/3] Report clone04 failure on musl Petr Vorel
@ 2023-09-25 15:13 ` Petr Vorel
  2023-09-25 15:13 ` [LTP] [PATCH 2/3] clone04: Add musl-git tag Petr Vorel
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2023-09-25 15:13 UTC (permalink / raw)
  To: ltp; +Cc: Richard Palethorpe

Similar to other git repos (linux-git, linux-stable-git, glibc-git) we
need also to have support for musl fixes in tags (musl-git).

Link: https://github.com/linux-test-project/ltp/issues/1081
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 docparse/testinfo.pl | 3 ++-
 lib/tst_test.c       | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/docparse/testinfo.pl b/docparse/testinfo.pl
index 67e435d79..78433c40a 100755
--- a/docparse/testinfo.pl
+++ b/docparse/testinfo.pl
@@ -13,12 +13,13 @@ use File::Basename qw(dirname);
 use constant OUTDIR => dirname(abs_path($0));
 
 # tags which expect git tree, also need constant for URL
-our @TAGS_GIT = ("linux-git", "linux-stable-git", "glibc-git");
+our @TAGS_GIT = ("linux-git", "linux-stable-git", "glibc-git", "musl-git");
 
 # tags should map these in lib/tst_test.c
 use constant LINUX_GIT_URL => "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=";
 use constant LINUX_STABLE_GIT_URL => "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=";
 use constant GLIBC_GIT_URL => "https://sourceware.org/git/?p=glibc.git;a=commit;h=";
+use constant MUSL_GIT_URL => "https://git.musl-libc.org/cgit/musl/commit/src/linux/clone.c?id=";
 use constant CVE_DB_URL => "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-";
 
 sub load_json
diff --git a/lib/tst_test.c b/lib/tst_test.c
index e2c195645..179f697b7 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -45,6 +45,7 @@ const char *TCID __attribute__((weak));
 #define LINUX_GIT_URL "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id="
 #define LINUX_STABLE_GIT_URL "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id="
 #define GLIBC_GIT_URL "https://sourceware.org/git/?p=glibc.git;a=commit;h="
+#define MUSL_GIT_URL "https://git.musl-libc.org/cgit/musl/commit/src/linux/clone.c?id="
 #define CVE_DB_URL "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-"
 
 #define DEFAULT_TIMEOUT 30
@@ -592,6 +593,8 @@ static void print_test_tags(void)
 			fprintf(stderr, LINUX_STABLE_GIT_URL "%s\n", tags[i].value);
 		else if (!strcmp(tags[i].name, "glibc-git"))
 			fprintf(stderr, GLIBC_GIT_URL "%s\n", tags[i].value);
+		else if (!strcmp(tags[i].name, "musl-git"))
+			fprintf(stderr, MUSL_GIT_URL "%s\n", tags[i].value);
 		else
 			fprintf(stderr, "%s: %s\n", tags[i].name, tags[i].value);
 	}
@@ -855,6 +858,7 @@ static void print_failure_hints(void)
 	print_failure_hint("linux-stable-git", "missing stable kernel fixes",
 					   LINUX_STABLE_GIT_URL);
 	print_failure_hint("glibc-git", "missing glibc fixes", GLIBC_GIT_URL);
+	print_failure_hint("musl-git", "missing musl fixes", MUSL_GIT_URL);
 	print_failure_hint("CVE", "vulnerable to CVE(s)", CVE_DB_URL);
 	print_failure_hint("known-fail", "hit by known kernel failures", NULL);
 }
-- 
2.40.1


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [LTP] [PATCH 2/3] clone04: Add musl-git tag
  2023-09-25 15:13 [LTP] [PATCH 0/3] Report clone04 failure on musl Petr Vorel
  2023-09-25 15:13 ` [LTP] [PATCH 1/3] lib/tst_test.c: docparse/testinfo.pl: Add support for musl git fixes Petr Vorel
@ 2023-09-25 15:13 ` Petr Vorel
  2023-09-25 15:13 ` [LTP] [RFC][PATCH 3/3] lib/tst_test.c: Print failure hints also for TBROK Petr Vorel
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2023-09-25 15:13 UTC (permalink / raw)
  To: ltp; +Cc: Richard Palethorpe

clone04 test fails on musl due to producing a child process with
inconsistent state. The clone() function has been effectively unusable
since it was added, recently musl got fix. Mark this fix.

Fixes: #1081
Reported-by: Richard Palethorpe <rpalethorpe@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/clone/clone04.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testcases/kernel/syscalls/clone/clone04.c b/testcases/kernel/syscalls/clone/clone04.c
index 7af4fedd3..74347e2b4 100644
--- a/testcases/kernel/syscalls/clone/clone04.c
+++ b/testcases/kernel/syscalls/clone/clone04.c
@@ -2,6 +2,7 @@
 /*
  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
  * Copyright (c) 2012 Wanlong Gao <gaowanlong@cn.fujitsu.com>
+ * Copyright (c) Linux Test Project, 2003-2023
  */
 
 /*\
@@ -44,4 +45,8 @@ static void verify_clone(unsigned int nr)
 static struct tst_test test = {
 	.tcnt = ARRAY_SIZE(tcases),
 	.test = verify_clone,
+	.tags = (const struct tst_tag[]) {
+		{"musl-git", "fa4a8abd06a4"},
+		{}
+	},
 };
-- 
2.40.1


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [LTP] [RFC][PATCH 3/3] lib/tst_test.c: Print failure hints also for TBROK
  2023-09-25 15:13 [LTP] [PATCH 0/3] Report clone04 failure on musl Petr Vorel
  2023-09-25 15:13 ` [LTP] [PATCH 1/3] lib/tst_test.c: docparse/testinfo.pl: Add support for musl git fixes Petr Vorel
  2023-09-25 15:13 ` [LTP] [PATCH 2/3] clone04: Add musl-git tag Petr Vorel
@ 2023-09-25 15:13 ` Petr Vorel
  2023-09-25 15:29 ` [LTP] [PATCH 0/3] Report clone04 failure on musl Marius Kittler
  2023-09-26  8:21 ` Cyril Hrubis
  4 siblings, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2023-09-25 15:13 UTC (permalink / raw)
  To: ltp; +Cc: Richard Palethorpe

Some kernel/libc bugs are not causing TFAIL, but also TBROK,
e.g. clone04 failure on musl, which does:
tst_test.c:1632: TBROK: Test killed by SIGSEGV!

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_test.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 179f697b7..0dec00be4 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -880,8 +880,10 @@ static void do_exit(int ret)
 		if (results->warnings)
 			ret |= TWARN;
 
-		if (results->broken)
+		if (results->broken) {
 			ret |= TBROK;
+			print_failure_hints();
+		}
 
 		fprintf(stderr, "\nSummary:\n");
 		fprintf(stderr, "passed   %d\n", results->passed);
-- 
2.40.1


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH 0/3] Report clone04 failure on musl
  2023-09-25 15:13 [LTP] [PATCH 0/3] Report clone04 failure on musl Petr Vorel
                   ` (2 preceding siblings ...)
  2023-09-25 15:13 ` [LTP] [RFC][PATCH 3/3] lib/tst_test.c: Print failure hints also for TBROK Petr Vorel
@ 2023-09-25 15:29 ` Marius Kittler
  2023-09-26  8:21 ` Cyril Hrubis
  4 siblings, 0 replies; 7+ messages in thread
From: Marius Kittler @ 2023-09-25 15:29 UTC (permalink / raw)
  To: ltp

Am Montag, 25. September 2023, 17:13:16 CEST schrieb Petr Vorel:
> This required to add musl-git support into lib.
> 
> Petr Vorel (3):
>   lib/tst_test.c: docparse/testinfo.pl: Add support for musl git fixes
>   clone04: Add musl-git tag
>   lib/tst_test.c: Print failure hints also for TBROK
> 
>  docparse/testinfo.pl                      | 3 ++-
>  lib/tst_test.c                            | 8 +++++++-
>  testcases/kernel/syscalls/clone/clone04.c | 5 +++++
>  3 files changed, 14 insertions(+), 2 deletions(-)

Reviewed-by: Marius Kittler <mkittler@suse.de>

Looks good to me.




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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH 0/3] Report clone04 failure on musl
  2023-09-25 15:13 [LTP] [PATCH 0/3] Report clone04 failure on musl Petr Vorel
                   ` (3 preceding siblings ...)
  2023-09-25 15:29 ` [LTP] [PATCH 0/3] Report clone04 failure on musl Marius Kittler
@ 2023-09-26  8:21 ` Cyril Hrubis
  2023-09-27  5:28   ` Petr Vorel
  4 siblings, 1 reply; 7+ messages in thread
From: Cyril Hrubis @ 2023-09-26  8:21 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Richard Palethorpe, ltp

Hi!
Looks good to me.

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

I suppose that this is pre-release fix and should go in now.

-- 
Cyril Hrubis
chrubis@suse.cz

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH 0/3] Report clone04 failure on musl
  2023-09-26  8:21 ` Cyril Hrubis
@ 2023-09-27  5:28   ` Petr Vorel
  0 siblings, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2023-09-27  5:28 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: Richard Palethorpe, ltp

Hi all,

thanks for your review, merged.

Kind regards,
Petr

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-09-27  5:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-25 15:13 [LTP] [PATCH 0/3] Report clone04 failure on musl Petr Vorel
2023-09-25 15:13 ` [LTP] [PATCH 1/3] lib/tst_test.c: docparse/testinfo.pl: Add support for musl git fixes Petr Vorel
2023-09-25 15:13 ` [LTP] [PATCH 2/3] clone04: Add musl-git tag Petr Vorel
2023-09-25 15:13 ` [LTP] [RFC][PATCH 3/3] lib/tst_test.c: Print failure hints also for TBROK Petr Vorel
2023-09-25 15:29 ` [LTP] [PATCH 0/3] Report clone04 failure on musl Marius Kittler
2023-09-26  8:21 ` Cyril Hrubis
2023-09-27  5:28   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox