Re: [PATCH 3/6] selftests/mm : fix test_prctl_fork_exec failure

From: Dev Jain
Date: Mon Jun 16 2025 - 12:32:12 EST



On 16/06/25 9:36 pm, Aboorva Devarajan wrote:
From: Donet Tom <donettom@xxxxxxxxxxxxx>

execv argument is an array of pointers to null-terminated strings.
In this patch we added NULL in the execv argument to fix the test
failure.

Just a comment, how did this test suddenly start failing now? Also is a
fixes tag required? Clearly I am missing something.

Signed-off-by: Donet Tom <donettom@xxxxxxxxxxxxx>
Signed-off-by: Aboorva Devarajan <aboorvad@xxxxxxxxxxxxx>
---
tools/testing/selftests/mm/ksm_functional_tests.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/ksm_functional_tests.c b/tools/testing/selftests/mm/ksm_functional_tests.c
index d7d3c22c077a..6ea50272a0ba 100644
--- a/tools/testing/selftests/mm/ksm_functional_tests.c
+++ b/tools/testing/selftests/mm/ksm_functional_tests.c
@@ -579,7 +579,7 @@ static void test_prctl_fork_exec(void)
return;
} else if (child_pid == 0) {
char *prg_name = "./ksm_functional_tests";
- char *argv_for_program[] = { prg_name, FORK_EXEC_CHILD_PRG_NAME };
+ char *argv_for_program[] = { prg_name, FORK_EXEC_CHILD_PRG_NAME, NULL };
execv(prg_name, argv_for_program);
return;