Skip to content

x86: add read-before-write check at runtime#1259

Merged
OlegHahm merged 1 commit intoRIOT-OS:masterfrom
Kijewski:x86-heap-check
Jun 22, 2014
Merged

x86: add read-before-write check at runtime#1259
OlegHahm merged 1 commit intoRIOT-OS:masterfrom
Kijewski:x86-heap-check

Conversation

@Kijewski
Copy link
Copy Markdown
Contributor

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.

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.
@Kijewski Kijewski added the x86 label May 31, 2014
@Kijewski
Copy link
Copy Markdown
Contributor Author

Interestingly enough there is such an error in tlsf.c:181: block_set_size(), when called in tlsf_add_pool().

@OlegHahm
Copy link
Copy Markdown
Member

ACK and go.

OlegHahm added a commit that referenced this pull request Jun 22, 2014
x86: add read-before-write check at runtime
@OlegHahm OlegHahm merged commit fde1c10 into RIOT-OS:master Jun 22, 2014
@Kijewski Kijewski deleted the x86-heap-check branch June 23, 2014 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants