DynamoRIO / DynamoRIO/dynamorio

drmemtrace offline assumes blocks always complete which is broken by asynch thread relocation

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

Description

drmemtrace's offline instrumentation records one entry at the top of a block and assumes every instruction in that block will then execute. If we have an asynchronous thread relocation (from a synchronous flush, or a reset, or a detach) that finds a safe spot in the middle of the block (any app instr will do; xref a to-be-filed issue on expanding safe spots for client instru; clean calls will do despite their xl8 shortcomings #4912), we'll have not only that promise of all instructions but for a load or store drmemtrace will have recorded its address yet it may not actually execute. Then upon relocation, if it's not detach, the tail block will execute the load/store and duplicate the address. raw2trace will be very confused as it will expect all memrefs in the interrupted block.

One solution could be for DR to provide an event on thread relocation. The client can't tell from the state restore event whether relocation will happen: maybe that could be expanded.

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.