Repository navigation
Conversation
Thread reset rebuilds a module thread's entry frame from tx_thread_module_stack_start, _end and _size, but _txm_module_manager_thread_create recorded those fields only when TXM_MODULE_MEMORY_PROTECTION is non-zero. The Cortex-A7 module ports define it as zero when TXM_MODULE_MEMORY_PROTECTION_ENABLED is removed, so resetting any module thread on such a build placed the frame 76 bytes below a null stack end, at 0xFFFFFFB4. Every other module port defines the constant as non-zero and is not affected. Thread create now records the module stack fields for every module thread. Guarding the restore in reset was rejected because it would keep a second code path and leave those threads invisible to the stack overlap check in thread create. On Cortex-A7 builds without MMU support, that check now refuses a module stack overlapping another module thread's stack with TX_PTR_ERROR, as on the other ports. A new host test runs thread create and reset against the Cortex-A7 port headers, as shipped and with MMU support compiled out. Without the fix the second build fails 6 of 14 expectations, with a reset frame end of 0; with it, 15/15 module manager host tests pass in each of the five non-MISRA configurations. The QEMU module harness passed 4/4 on Cortex-M3 and Cortex-M4, with and without pointer context. Not run on Cortex-A7 hardware. Assisted-by: Claude Code (Opus 5.5) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thread reset rebuilds a module thread's entry frame from tx_thread_module_stack_start, _end and _size, but _txm_module_manager_thread_create recorded those fields only when TXM_MODULE_MEMORY_PROTECTION is non-zero. The Cortex-A7 module ports define it as zero when TXM_MODULE_MEMORY_PROTECTION_ENABLED is removed, so resetting any module thread on such a build placed the frame 76 bytes below a null stack end, at 0xFFFFFFB4. Every other module port defines the constant as non-zero and is not affected.
Thread create now records the module stack fields for every module thread. Guarding the restore in reset was rejected because it would keep a second code path and leave those threads invisible to the stack overlap check in thread create. On Cortex-A7 builds without MMU support, that check now refuses a module stack overlapping another module thread's stack with TX_PTR_ERROR, as on the other ports.
A new host test runs thread create and reset against the Cortex-A7 port headers, as shipped and with MMU support compiled out. Without the fix the second build fails 6 of 14 expectations, with a reset frame end of 0; with it, 15/15 module manager host tests pass in each of the five non-MISRA configurations. The QEMU module harness passed 4/4 on Cortex-M3 and Cortex-M4, with and without pointer context. Not run on Cortex-A7 hardware.