Fix: Remote protocol target communications initialisation #1629
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.
Detailed description
This PR seeks to address a crash-inducing bug reported by ALTracer on Discord. Under certain conditions during failed communications with a target over the remote protocol,
dp->error()
is called and the remote protocol layer in the firmware was improperly initialising the faked DP structure it uses, resulting in an attempted call through a NULL function pointer.This patch addresses this problem for both JTAG and SWD over remote protocol + documents that structure a bit to help prevent future problems.
Tested by ALTracer against the STM32MP157 with which this bug was found and triggered.
This bug has existed in the firmware since about 3 years ago and does affect v1.7, v1.8 and v1.9 - we may wish to backport it at least to v1.9 because of this.
Your checklist for this pull request
make PROBE_HOST=native
)make PROBE_HOST=hosted
)Closing issues