-
Notifications
You must be signed in to change notification settings - Fork 7.5k
x86 stack check fail w/posix-lib & newlib #13701
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
Comments
@galak why was this merged although it is known to be failing? Now all CI jobs are failing because of this. |
My bad, wasn't thinking about the CI impact to everything else. Is there someone who can look at the x86 issue. |
The error message is correct; this is a stack overflow in _main_thread. |
@galak I've unpeeled this enough to see what is going on. For this test, CONFIG_STDOUT_CONSOLE=y, which causes TC_PRINT() and related macros to map to libc printf() instead of the kernel's printk(). Newlib's printf() uses tons of stack space, even more than minimal libc, and LOTS more than printk(), and we are blowing stack in _ztest_run_test_suite() before the test can even run. For some reason, CONFIG_STDOUT_CONSOLE is defaulting to Y when newlib is enabled:
I think the right thing to do is always enable CONFIG_STDOUT_CONSOLE, but get rid of this policy which is redirecting testcase output to printf just because it is turned on. |
The intent of this Kconfig is to allow libc stdout functions like printf() to send their output to the active console driver instead of discarding it. This somehow evolved into preferring to use printf() instead of printk() for all test case output if enabled. Libc printf() implementation for both minimal libc and newlib use considerably more stack space than printk(), with nothing gained by using them. Remove all instances where we are conditionally sending test case output based on this config, enable it by default, and adjust a few tests that disabled this because they were blowing stack. printk() and vprintk() now work as expected for unit_testing targets, they are just wrappers for host printf(). Fixes: zephyrproject-rtos#13701 Signed-off-by: Andrew Boie <[email protected]>
The intent of this Kconfig is to allow libc stdout functions like printf() to send their output to the active console driver instead of discarding it. This somehow evolved into preferring to use printf() instead of printk() for all test case output if enabled. Libc printf() implementation for both minimal libc and newlib use considerably more stack space than printk(), with nothing gained by using them. Remove all instances where we are conditionally sending test case output based on this config, enable it by default, and adjust a few tests that disabled this because they were blowing stack. printk() and vprintk() now work as expected for unit_testing targets, they are just wrappers for host printf(). Fixes: #13701 Signed-off-by: Andrew Boie <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
When trying to run the posix tests w/newlib as enabled by PR #13685
./scripts/sanitycheck -T tests/posix/ -p qemu_x86
qemu_x86 tests/posix/common/portability.posix.newlib FAILED: handler_crash
We get:
SDK 0.9.5:
SDK 0.10.0:
The text was updated successfully, but these errors were encountered: