do not remove stopped blocks from stack twice #1330
Merged
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.
In cpu-exec.c, in the before-block-exec callback for a block, the callstack_instr plugin removes the block from the stack if it is the block that a return instruction returns to. The problem is if the flag to say the block is interrupted is set between this point and when the block prologue is executed, the block will be Stopped, and then when the block is run for real after dealing with the interruption, then the block is removed from the callstack again (if it is there). This doesn't happen a lot (our test case had to run about 200 times before we saw it, and of course it happened once during regression testing which prompted a search for a problem).
This problem and a related problem were fixed once before, by two different groups, and the merge together caused a problem which it appears was resolved (in 2020) by removing too much of one of the original solution.