x86: add read-before-write check at runtime#1259
Merged
OlegHahm merged 1 commit intoRIOT-OS:masterfrom Jun 22, 2014
Kijewski:x86-heap-check
Merged
x86: add read-before-write check at runtime#1259OlegHahm merged 1 commit intoRIOT-OS:masterfrom Kijewski:x86-heap-check
OlegHahm merged 1 commit intoRIOT-OS:masterfrom
Kijewski:x86-heap-check
Conversation
Finding read-before-writes statically is quite difficult. In native we can use valgrind, but on boards without an MMU we are out of luck. x86 has an MMU, let's use it. If `-DDEBUG_READ_BEFORE_WRITE` was set, then pages on the heap get initialized upon first use. If the page was read before written, then a debug message with the virtual and physical address of the memory location is printed, as well as the address of the offending instruction.
Contributor
Author
|
Interestingly enough there is such an error in tlsf.c:181: block_set_size(), when called in tlsf_add_pool(). |
Member
|
ACK and go. |
OlegHahm
added a commit
that referenced
this pull request
Jun 22, 2014
x86: add read-before-write check at runtime
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.
Finding read-before-writes statically is quite difficult. In native we
can use valgrind, but on boards without an MMU we are out of luck.
x86 has an MMU, let's use it.
If
-DDEBUG_READ_BEFORE_WRITEwas set, then pages on the heap getinitialized upon first use. If the page was read before written, then a
debug message with the virtual and physical address of the memory
location is printed, as well as the address of the offending instruction.