Extends the trace_invariants test from #2638 (closed) to ensure there's no discontinuity in control flow not indicated by a branch or a kernel xfer marker.
Adds an online trace_invariants test.
Switches the trace_invariants test to run pthreads.ptsig on UNIX, which is marked un-FLAKY, to test both threads and signals, and on winxfer on Windows.
Fixes several issues found by this new test:
- Adds TRACE_TYPE_INSTR_SYSENTER to mark the PC discontinuity from OP_sysenter.
- Adds proper handling of a mid-bb fault in offline trace conversion by looking ahead after each memref to see whether there's a marker.
- #2011 (closed) follow-up: fixes the zero-iter code from 2772b0bd which it turns out only worked for offline traces. For online, the top-of-bb instr is jecxz, so the instr type and size were wrong.
- Fixes pipe write splitting to avoid separating an instr from its bundle entries.
- Avoids a marker for a thread init kernel xfer event on Windows.
Fixes #2708 (closed)