DynamoRIO / dynamorio

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

i#6508 context switches: Adjust and add invariant checks #6743

Closed abhinav92003 closed 3 months ago

abhinav92003 commented 3 months ago

Adjusts and adds some invariant checks for kernel context switch traces. Specifically: adjusts the PC discontinuity check around the start and end of the context switch trace; adds invariant checks to disallow nested context switch traces and trace-end without trace-start.

Adds some unit tests for kernel context switch traces. Updates the mock_switch_sequences.x64.zip file to add a thread exit before the footer for both the context switch sequences in it. Adds a test that runs the invariant checker on this zip file, which now passes.

Also fixes a bug in invariant error counting which should happen with -no_abort_on_invariant_error.

Issue: #6508