Skip to content

Commit 5b590fa

Browse files
YuguoWHnashif
authored andcommitted
tests: threads: fix kernel/thread_stack test
Fix the broken logic in the kernel/thread_stack test The modified test should do direct read & write from estimated stack pointer to highest address in the stack buffer. Previously this test was start from lowest address in the stack which would trigger exception of hardware stack checking scheme violation on ARC boards and other targets with hardware stack overflow detection. Signed-off-by: Yuguo Zou <[email protected]>
1 parent eca98e3 commit 5b590fa

File tree

1 file changed

+1
-1
lines changed
  • tests/kernel/threads/thread_stack/src

1 file changed

+1
-1
lines changed

tests/kernel/threads/thread_stack/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ void stack_buffer_scenarios(void)
160160
*
161161
* First test does direct read & write starting at the estimated
162162
* stack pointer up to the highest addresses in the buffer
163+
* Starting from &val which is close enough to stack pointer
163164
*/
164-
val = *stack_start;
165165
stack_ptr = &val;
166166
for (pos = stack_ptr; pos < stack_end; pos++) {
167167
/* pos is volatile so this doesn't get optimized out */

0 commit comments

Comments
 (0)