-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trace ending mid-rseq is truncated by raw2trace #6444
Comments
Adds an invariant check that each thread has an exit record in a drmemtrace. Adds a unit test. The new check failed on nearly every existing unit test, requiring adding thread exits. That in turn triggered exit checks on missing headers and filetypes. I ended up having to edit every test case. As part of this I standardized the tid constants used. Issue: #6444
If the thread trace ends mid-rseq-region, dump the buffer instead of losing not only the rseq sequence so far but also the thread exit record. Adds a unit test. Also tested on a real trace with this issue. Fixes #6444
For the thread exit invariant check, it is failing for two tests on win64 as below. Having trouble figure this out but it may be related to the exit-all-threads on NtTerminateProcess: other-thread exits. For now I'm going to disable the check for Windows online with a comment. https://github.com/DynamoRIO/dynamorio/actions/runs/6830155161/job/18577608422?pr=6445
|
If the thread trace ends mid-rseq-region, dump the buffer instead of losing not only the rseq sequence so far but also the thread exit record. Adds a unit test. Also tested on a real trace with this issue. Fixes #6444
Adds an invariant check that each thread has an exit record in a drmemtrace. Adds a path for the analyzer to call process_shard_exit() when there is no exit record. Manually tested this on a real truncated trace. Adds a unit test. The new check failed on nearly every existing unit test, requiring adding thread exits. That in turn triggered exit checks on missing headers and filetypes. I ended up having to edit every test case. As part of this I standardized the tid constants used. Issue: #6444
Augments the mid-rseq-trace-exit case to handle the rseq final instr being reached but not passed. Adds a test case. Issue: #6444
Augments the mid-rseq-trace-exit case to handle the rseq final instr being reached but not passed. Adds a test case. Issue: #6444
Augments the mid-rseq-trace-exit case to handle the rseq final instr being reached but not passed. Adds a test case. Issue: #6444
Skips generating the final interval snapshot for thread-shards that are missing the thread exit entry, during trace interval analysis in the drmemtrace analyzer framework. Such final intervals currently have incorrect data (the cumulative instr count, instr count delta, and end timestamp). Instead of generating incorrect data we skip such a final interval and print a non-fatal error message. This issue is seen on interval analysis of only the traces affected by i#6444. That issue has already been fixed many months ago, and does not affect newer traces. This fix is to allow trace interval analysis of those older traces. Due to i#6444, some threads were missing thread exit entries because tracing ended in an rseq region. For such traces, the i#6444 fix already added an analyzer workaround that ensures that process_shard_exit is called despite the missing thread exit event. Here we modify that workaround to skip processing the final interval when the workaround had to be invoked; this is required because the worker's trace stream would have moved on to other shards (if there were others assigned to the worker) and therefore cannot anymore provide the state (instr count, timestamp when the shard ended) required for generation of the final interval snapshot for that shard. Note that for the shard that was the last shard in the worker's stream, we can still continue to generate the final interval snapshot, because the worker's trace stream is still good to generate state for that shard. Adds modified version of existing interval analysis unit tests to verify the workaround. Also fixes a log which may not print the correct stream name if the error was in a different shard than the current one (because of the same reason we're seeing the primary issue). Issue: #6444 Fixes: #6793
The missing thread exit in #6444 (comment) may be the same as #6733 which we see on Linux every so often and have never been able to figure out. |
I encountered a trace with a truncated file: no thread exit at the end.
It ends with a write after PC 0x1141e187:
Re-running raw2trace: that PC is a ways up in the log, followed by a long rseq sequence (it has a loop) which doesn't reach its end: it has a timestap and thread exit appearing as the thread exited mid-rseq-region it seems. So apparently we do not output the rseq buffer in this case.
Two action items:
The text was updated successfully, but these errors were encountered: