samples: pi: fix stack overflow

This was silently corrupting memory on x86-64.
Enable CONFIG_TEST so that this is detected properly,
and increase the stack size appropriately.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2020-02-20 16:06:30 -08:00 committed by Anas Nashif
commit e23102f5dc
2 changed files with 5 additions and 1 deletions

View file

@ -3,3 +3,6 @@ CONFIG_MAIN_THREAD_PRIORITY=11
# Enable SMP
CONFIG_SMP=y
# Enable assertions, stack overflow checking, etc
CONFIG_TEST=y

View file

@ -17,7 +17,8 @@
#define DIGITS_NUM 240
#define LENGTH ((DIGITS_NUM / 4) * 14)
#define STACK_SIZE (LENGTH * sizeof(int) + 512)
#define STACK_SIZE ((LENGTH * sizeof(int) + 512) + \
CONFIG_TEST_EXTRA_STACKSIZE)
#ifdef CONFIG_SMP
#define CORES_NUM CONFIG_MP_NUM_CPUS