Skip to content

Conversation

M-Moawad
Copy link
Contributor

The stackprot test currently depends on compiler-generated stack frame layouts, which can vary between toolchains and optimization levels. This makes the overflow check fragile and may cause unintended faults.

Add a small guard buffer in alternate_thread so the intentional overflow is always contained within the thread stack. This ensures the test behaves consistently across toolchains, architectures, and optimization settings.

Fixes: #95060

The stackprot test currently depends on compiler-generated stack frame
layouts, which can vary between toolchains and optimization levels.
This makes the overflow check fragile and may cause unintended faults.

Add a small guard buffer in alternate_thread so the intentional overflow
is always contained within the thread stack. This ensures the test
behaves consistently across toolchains, architectures, and optimization
settings.

Signed-off-by: Mohamed Moawad <[email protected]>
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests/kernel/mem_protect/stackprot: test_create_alt_thread fails on ARC nsim_em due to MPU exception at thread stack boundary
3 participants