From: Thomas Weißschuh Date: Fri, 26 May 2023 07:51:20 +0000 (+0200) Subject: selftests/nolibc: prevent coredumps during test execution X-Git-Tag: v6.5-rc1~208^2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a75575b81b5639f7ca82c9701fb199401fd6471;p=thirdparty%2Flinux.git selftests/nolibc: prevent coredumps during test execution The child process forked during stackprotector tests intentionally gets killed with SIGABRT. By default this will trigger writing a coredump. The writing of the coredump can spam the systems coredump machinery and take some time. Timings for the full run of nolibc-test: Before: 200ms After: 20ms This is on a desktop x86 system with systemd-coredumpd enabled. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 6db788603a348..84a1b02eb6f9d 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -831,6 +831,7 @@ static int run_protection(int min, int max) close(STDOUT_FILENO); close(STDERR_FILENO); + prctl(PR_SET_DUMPABLE, 0, 0, 0, 0); smash_stack(); return 1;