Move to a stack-overflow-resilient error handler #48
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.
The TCP/IP stack cannot currently recover from a crash due to a stack overflow in the TCP/IP compartment. This is due to a limitation of the implementation of the switcher, which cannot trigger the error handler on stack overflow. Further, the current implementation of the error handler runs at the point in the stack where the compartment crashed. This implies that the error handler runs on a potentially very small stack, making it possible that it will itself crash due to a stack overflow. This limitation is documented in #31.
This commit addresses these limitations using David's recently-merged stackless error handler mechanism: CHERIoT-Platform/cheriot-rtos#301.
We also address a bug in the reset, which happens when an error handler on a user thread triggers a crash of the IP thread. In this case, previously improperly tested, we fail to release a lock, resulting in a failure of the reset.
More information in each commit.