DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.63k stars 557 forks source link

record_filter flips trace_entry_t records #6798

Open edeiana opened 4 months ago

edeiana commented 4 months ago

When running record_filter without any filter, the resulting trace file has some trace_entry_t records flipped, while we expect them to be the same. Specifically, TRACE_TYPE_ENCODING and TRACE_TYPE_MARKER.TRACE_MARKER_TYPE_BRANCH_TARGET are flipped in the output trace.

To reproduce, run the record_filter without any filter:

drrun -t drcachesim -simulator_type record_filter -indir trace_in -outdir trace_out

Then, convert the input trace and output trace to human-readable format (https://dynamorio.org/page_debug_memtrace.html#autotoc_md136):

zcat path/to/trace.memtrace.zip | od -A x -t x2 -w12 | awk '{printf "%s | %s %s %s%s%s%s\n", $1, $2, $3, $7, $6, $5, $4}' &> hex_trace.txt

And inspect the hex_trace.txt files by generating a diff.