Skip to contentSkip to conversation

Report clone04 failure on musl

PATCH In review Petr Vorel 3 participants 7 messages Sep 25, 2023 – Sep 27, 2023 Library code

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

cover Report clone04 failure on musl

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(-)
Signature · 5 lines
2.40.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#1 lore raw

PATCH 1/3 lib/tst_test.c: docparse/testinfo.pl: Add support for musl git fixes

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).

---
 docparse/testinfo.pl | 3 ++-
 lib/tst_test.c       | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)
docparse/testinfo.pl +2 -1
index 67e435d79..78433c40a 100755
@@ -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
lib/tst_test.c +4 -0
index e2c195645..179f697b7 100644
@@ -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);
 }
Signature · 5 lines
2.40.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#2 lore raw

PATCH 2/3 clone04: Add musl-git tag

In reply to Petr Vorel

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.

---
 testcases/kernel/syscalls/clone/clone04.c | 5 +++++
 1 file changed, 5 insertions(+)
testcases/kernel/syscalls/clone/clone04.c +5 -0
index 7af4fedd3..74347e2b4 100644
@@ -2,6 +2,7 @@
 /*
  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
  * Copyright (c) 2012 Wanlong Gao <[email protected]>
+ * 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"},
+		{}
+	},
 };
Signature · 5 lines
2.40.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw

RFC PATCH 3/3 lib/tst_test.c: Print failure hints also for TBROK

In reply to Petr Vorel

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!

---
 lib/tst_test.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/tst_test.c +3 -1
index 179f697b7..0dec00be4 100644
@@ -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);
Signature · 5 lines
2.40.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on the v1 series
#4 lore raw
In reply to Petr Vorel

Am Montag, 25. September 2023, 17:13:16 CEST schrieb Petr Vorel:

Quoted 11 lines

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(-)

Looks good to me.

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#6 lore raw

Hi all,

thanks for your review, merged.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp