diff mbox series

[v2,2/2] selftests/nolibc: prevent coredumps during test execution

Message ID 20230526-nolibc-test-no-dump-v2-2-a66500bf73fc@weissschuh.net
State Accepted
Commit 9a75575b81b5639f7ca82c9701fb199401fd6471
Headers show
Series [v2,1/2] tools/nolibc: add support for prctl() | expand

Commit Message

Thomas Weißschuh May 26, 2023, 7:51 a.m. UTC
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 <linux@weissschuh.net>
---
 tools/testing/selftests/nolibc/nolibc-test.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 95ff2867a91d..3296e8567fa5 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;