DynamoRIO / DynamoRIO/drmemory

provide multiple options for trading off concurrent intra-word initial write fidelity with memory and performance

Open
#271 3 comments 0 reactions 0 assignees View on GitHub
Migrated Priority-Medium Type-Feature
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on January 14, 2011 16:38:34_

packing 2 shadow bits together results in a race if two threads access
adjacent bytes within the same word. this would only be a problem if the
bytes are unintialized and the two threads both write to them: one could
end up remaining uninitialized, leading to false positives

ways to eliminate the race:
a) lock around multi-op for sub-word access in multi-threaded app ("lock
bts" and "lock btr": pretty expensive)
b) byte-to-byte shadowing
c) thread serialization
d) hybrid mapping? but would need sub-word info for majority of memory?

I plan to implement a series of choices for multi-threaded:

1) byte-to-byte: no races but 4x as much memory; suitable for 64-bit and
many 32-bit apps.
byte-to-byte should give some perf improvements too.
dynamic byte-to-byte, switch to 2-bit synch if run out of mem?
2) byte-to-2-bits with synch (probably thread serialization):
no races but slow; suitable for those 32-bit apps that care about both
races and memory
3) byte-to-2-bits with no synch: my current impl, suitable for apps that
want to save memory but aren't worried about potential false negatives
from concurrent intra-word initial writes

for byte-to-byte register shadows need more TLS: should do DR TLS stuff
first so no resource limits on Windows

_Original issue: http://code.google.com/p/drmemory/issues/detail?id=271_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.