DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.57k stars 550 forks source link

[drmemtrace analyzer] Incorrect end timestamp and instr counts in shard-final interval #6793

Closed abhinav92003 closed 2 months ago

abhinav92003 commented 2 months ago

The shard-final interval seems to be created with incorrect end instr count and end timestamp. This is likely because the analyzer framework worker processes all assigned shards before invoking the shard exit event which then creates the final interval for the shard.

abhinav92003 commented 2 months ago

This seems to affect traces that are missing a thread exit event (https://github.com/DynamoRIO/dynamorio/issues/6444, which was fixed in Nov 2023).

Due to the missing thread exit event, the fallback parallel_shard_exit at the very end (after all shards assigned to the worker are processed) is invoked: https://github.com/DynamoRIO/dynamorio/blob/6fb84c6ef4b31bd40120db9107be455545d0204e/clients/drcachesim/analyzer.cpp#L696

For other traces, the existing implementation already invokes parallel_shard_exit at the right time (immediately when the thread exit is seen, or at the end of core-sharded trace).