DynamoRIO / DynamoRIO/dynamorio

drmemtrace non-inlined trace-delay instruction counting is racy

Open
#5,030 0 comments 0 reactions 0 assignees View on GitHub
Component-DrMemtrace OpSys-ARM OpSys-x86
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 18h
Merged PRs (30d)
30

Description

drmemtrace's -trace_after_instrs feature for 32-bit x86 and 32-bit arm does not inlined the counter increment and has a clean call that does a simple increment of a global variable that is not marked as std::atomic or anything. There is no comment about this: I could imagine deliberately living with the races perhaps on x86, but on weaker-memory-model arm it feels like it's possible to be waay off for small values with just a few threads.

We could stick a std::atomic on the global, or take the effort to inline for these 32-bit arches. If we're going to lose accuracy we may as well do the per-thread counting from #5026.

Contributor guide

Open the contributing guide

Research direction

Locate drmemtrace's -trace_after_instrs implementation for 32-bit x86 and 32-bit ARM, then inspect the clean call and global counter described in the issue. Compare the possible atomic, inlined, or per-thread approaches, including the direction referenced by #5026. Done means the counter no longer has the reported race and counting behavior is validated for these architectures.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
devtools, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.