diff --git a/test161/tests/vm/stability/forkbomb.t b/test161/tests/vm/stability/forkbomb.t index 3ffbb30..57b4d04 100644 --- a/test161/tests/vm/stability/forkbomb.t +++ b/test161/tests/vm/stability/forkbomb.t @@ -13,5 +13,8 @@ monitor: kernel: enablemin: true min: 0.01 +commandoverrides: + - name: /testbin/forkbomb + timeout: 20.0 --- p /testbin/forkbomb diff --git a/userland/testbin/forkbomb/forkbomb.c b/userland/testbin/forkbomb/forkbomb.c index 581da14..01af4c2 100644 --- a/userland/testbin/forkbomb/forkbomb.c +++ b/userland/testbin/forkbomb/forkbomb.c @@ -53,6 +53,7 @@ #include #define TEST_DURATION 10 +#define LOCAL_SUCCESS "SUCCESS" static volatile int pid; @@ -74,6 +75,9 @@ main(void) // we will probably be out of pages by the time we try to print success. secprintf(SECRET, "!!< Starting Forkbbbboooommmmbbbb >!!", "/testbin/forkbomb"); + // And now for the success string + printf("This should print %s after 10s\n", LOCAL_SUCCESS); + while (1) { fork(); // Only parent gets to print @@ -87,7 +91,9 @@ main(void) __time(&time_now_s, &time_now_ns); if (time_now_s - start_time_s > TEST_DURATION && !did_print) { did_print = 1; - success(TEST161_SUCCESS, SECRET, "/testbin/forkbomb"); + // We need to print this using secprintf so that it uses + // the same page we warmed up earlier. + secprintf(SECRET, LOCAL_SUCCESS, "/testbin/forkbomb"); } }