From ab41d3ab9948e067c49d9d3cc66e527e289d681c Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Fri, 26 Apr 2024 09:37:55 +0200 Subject: [PATCH] Revert "tests/kernel/threads: Augment abort_from_isr test to detect FMW" This reverts commit 3ef282be6c5d71514ca555e1a99eb3db2dc8eb6f. This PR introduced 2 regressions in main CI: 71977 & 71978 Let's revert it by now to get main's CI passing again. Signed-off-by: Alberto Escolar Piedras --- .../src/test_threads_cancel_abort.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c b/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c index b99347a404..aad8842a11 100644 --- a/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c +++ b/tests/kernel/threads/thread_apis/src/test_threads_cancel_abort.c @@ -166,11 +166,6 @@ static void offload_func(const void *param) k_thread_abort(t); - /* Thread memory is unused now, validate that we can clobber it. */ - if (!IS_ENABLED(CONFIG_ARCH_POSIX)) { - memset(t, 0, sizeof(*t)); - } - /* k_thread_abort() in an isr shouldn't affect the ISR's execution */ isr_finished = true; } @@ -206,19 +201,6 @@ ZTEST(threads_lifecycle, test_abort_from_isr) k_thread_join(&tdata, K_FOREVER); zassert_true(isr_finished, "ISR did not complete"); - /* Thread struct was cleared after the abort, make sure it is - * still clear (i.e. that the arch layer didn't write to it - * during interrupt exit). Doesn't work on posix, which needs - * the thread struct for its swap code. - */ - uint8_t *p = (uint8_t *)&tdata; - - if (!IS_ENABLED(CONFIG_ARCH_POSIX)) { - for (int i = 0; i < sizeof(tdata); i++) { - zassert_true(p[i] == 0, "Free memory write to aborted thread"); - } - } - /* Notice: Recover back the offload_sem: This is use for releasing * offload_sem which might be held when thread aborts itself in ISR * context, it will cause irq_offload cannot be used again. @@ -266,5 +248,6 @@ ZTEST(threads_lifecycle, test_abort_from_isr_not_self) /* Simulate taking an interrupt which kills spwan thread */ irq_offload(offload_func, (void *)tid); + k_thread_join(&tdata, K_FOREVER); zassert_true(isr_finished, "ISR did not complete"); }