-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test:mimxrt10xx_evk:tests/kernel/mem_protect/stackprot: get unexpected Stacking error #25348
Comments
This is due to a stack overflow in the main thread, for IMX platforms, @andrewboie, I am not sure if this is strictly related to the STACK_CANARIES feature which is enabled in this test. If I set MAIN_STACK_SIZE to 1024, this will pass. But I only see this problem with the iMX platforms, so I am not sure what the best way is to increase main stack size here: do it for iMX platforms, in general, or do it for this test only (but for any platform). FYI @MaureenHelm |
BTW, the failed assertion you see in the log (which should never happen, despite any stacking errors in the test) is covered in #25612 |
@ioannisg Stack canaries increase stack usage, due to the need to push the sentinel values on every stack frame. So if the test was near the limit, enabling canaries would push it over the limit. Do we understand yet why this is just failing on mimxrt1060_evk and not any of our emulated targets? |
This seems to run fine on all QEMU-based Arm targets. |
It also runs fine on @erwango, can you run this test on one of your M7 boards? |
passes on sam_e70_xplained (Cortex-M7 Processor)
|
Right @jfischer-phytec-iot , I tested it, as well, on SAM E70.
@andrewboie just a note; in this test, main thread stack overflows on several imx SoCs, not only mimxrt1060. Also, we do increase MAIN_STACK_SIZE configuration when we do COVERAGE_GCOV, or even directly in BOARDS' defconfigs (e.g. for several vendor boards, and including some ARM Qemu targets), so that's why the test is passing in qemu targets; it runs with higher-than-the-default main thread stack size. We are not consistent at all with respect to main thread stack size in our targets. My point is: if we all agree that Stack Canaries do have an effect on stack usage, then it is better to increase the Main Thread Stack size in this particular test, rather than increasing the default Main Stack Size for all iMX platforms. This setting will increase the ram usage of the test and might, eventually, require the test to be filtered-out for some platforms with little SRAM: but I think we can live with this. Currently the test builds on 236 board targets in the tree. When I increase Main Stack size to 2048, the test still builds successfully on all of these boards. It's good coverage, IMO. |
yes
thanks @jfischer-phytec-iot |
This is known -- stack canaries work by pushing the extra sentinel value onto every stack frame. |
I suggest we accept #25617 as the fix for this bug report and allow it to close. |
Describe the bug
when coduction the tests/kernel/mem_protect/stackprot case in RT series board e.g mimxrt1060_evk, there is a MPU FAULT at the end of test.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
test ends cleanly.
Impact
MPU
Screenshots or console output
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: