Fix automotive & snake demo halting after 512 compartment faults#88
Merged
AlexJones0 merged 1 commit intolowRISC:mainfrom Apr 15, 2026
Merged
Fix automotive & snake demo halting after 512 compartment faults#88AlexJones0 merged 1 commit intolowRISC:mainfrom
AlexJones0 merged 1 commit intolowRISC:mainfrom
Conversation
See the comments (and provided links) for more info about this switcher limitation/interface. Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
engdoreis
approved these changes
Apr 15, 2026
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.
Fix the bug in the automotive demo (and the same issue in the Snake demo, though practically this will never appear).
See the comments (and provided links) for more info about this switcher limitation/interface. As can be seen, this is documented in the include header for the CHERIoT RTOS core switcher, but as far as I could tell from a quick skim this gotcha doesn't seem to be noted anywhere in the public-facing docs or the programmer's guide.
As noted in that documentation, we need to set a flag inside the error handler and then reset the switcher's
errorHandlerCountattribute on the trusted stack frame from within our compartment, which we can do through aswitcher_handler_invocation_count_resetlibcall for. If we do this inside the handler we will instead get an integer overflow which will be interpreted by the switcher as a double fault.