summaryrefslogtreecommitdiff
path: root/common_modules/module_lib/src
diff options
context:
space:
mode:
authorFrédéric Desbiens <[email protected]>2026-09-15 16:24:58 -0400
committerGitHub <[email protected]>2026-09-15 16:24:58 -0400
commit30b3d22adceb10221de7ac3b4c4fd7ebcd3117e1 (patch)
tree39bc2cb5f232d6010f7b7f3e8f15e03aa8056390 /common_modules/module_lib/src
parent201cc046092a8751cdf88cc8614b7cf4a7595838 (diff)
Restored the random stack fill value cleared during thread creation (#732)
Fixes #723 With `TX_ENABLE_STACK_CHECKING` and `TX_ENABLE_RANDOM_NUMBER_STACK_FILLING` both enabled, `_tx_thread_create` picked a random byte, stored it in `tx_thread_stack_fill_value`, filled the stack with it -- and then cleared the whole control block with `TX_MEMSET`. The stack held the pattern while the control block claimed zero, so `TX_THREAD_STACK_CHECK` and `_tx_thread_stack_analyze` compared against the wrong value for the entire life of the thread. The value is now computed into a local and written back after the clear. The clear stays where it is, because the module manager's error checking walks the created list before the control block may be touched. Fixed in `common/src/tx_thread_create.c`, `common_smp/src/tx_thread_create.c` and `txm_module_manager_thread_create.c`, where it additionally left a user-mode module thread's kernel stack filled with zeros. `threadx_thread_stack_fill_value_test` creates sixteen unstarted threads and checks each control block against the pattern in its stack, tolerating a random zero byte without letting that hide the defect. Added to both suites: `ERROR #3` on `dev` in `stack_checking_rand_fill_build`, green with the fix. Five tx configurations at 104 tests, five SMP at 117, and all three sources clean under `-Wall -Wextra` across every combination of the four stack-filling switches. Assisted-by: Copilot (Opus 5) <[email protected]>
Diffstat (limited to 'common_modules/module_lib/src')
0 files changed, 0 insertions, 0 deletions