273: *** postcmd failed (3): Trace invariant failure in T3104 at ref # 99016 (0
273: instrs since timestamp 13351308211805717): An unfiltered thread should have
273: at least 1 instruction
It looks like a general bug: the check doesn't consider unfetched or prefetches, which are copied into previnstr.
The exit-early case in this test probably made it more likely: need a no-fetch instr right before thread exit.
This showed up in my new test in PR #6598 but it seems a general issue that could show up anywhere with a detach or other non-syscall exit:
https://github.com/DynamoRIO/dynamorio/actions/runs/7749549688/job/21134306402?pr=6598
It looks like a general bug: the check doesn't consider unfetched or prefetches, which are copied into previnstr. The exit-early case in this test probably made it more likely: need a no-fetch instr right before thread exit.