-
Notifications
You must be signed in to change notification settings - Fork 566
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
drmemtrace: Incorrect kernel xfer marker for signals received at end of wrapped function #5784
Labels
Comments
abhinav92003
added a commit
that referenced
this issue
Dec 14, 2022
Fixes two false positives in the drcachesim invariant checker code. Skips the pre-signal instr check when returning from signals that arrived before any other instr in the trace, or before any other instr since the last signal kernel xfer. Adds tests that fail without this fix. Fixes: #5784
abhinav92003
added a commit
that referenced
this issue
Dec 15, 2022
Fixes two false positives in the drmemtrace invariant checker code. Skips the pre-signal instr check when returning from signals that arrived before any other instr in the trace, or before any other instr since the last kernel xfer (nested signals without any intervening instr). In both these cases we don't have any pre-signal instr whose pc we can compare with the post-signal instr. Note that we still do not handle the back-to-back signals case where the second signal arrives just after the first one returns, without any intervening instruction. Added a comment for that. Adds tests that fail without this fix. Fixes: #5784
The issue reported in the first comment is actually not resolved yet. #5788 fixes a different type of "Signal handler return point incorrect" error. |
abhinav92003
added a commit
that referenced
this issue
Mar 7, 2023
Adds a new drwrap API, drwrap_replace_if_retaddr_sentinel, that allows mitigation of a transparency violation under the DRWRAP_REPLACE_RETADDR drwrap strategy where the return address on the stack is replaced with the address of the internal replace_retaddr_sentinel() routine. This API modified the passed-in value to the actual return address of the wrapped function if the passed-in value is replace_retaddr_sentinel() itself. Fixes the value of the marker written by the kernel xfer event in drmemtrace by using the new drwrap_replace_if_retaddr_sentinel() API on the mcontext PC before writing it out to the trace. This caused many invariant errors of type 'Signal handler return point incorrect' in traces collected on proprietary apps. Verified on a large proprietary app that this error due to drwrap is fixed now, whereas there were a few hundred instances before. Fixes: #5784
abhinav92003
added a commit
that referenced
this issue
Mar 7, 2023
Adds a new drwrap API, drwrap_get_retaddr_if_sentinel(), that allows mitigation of a transparency violation under the DRWRAP_REPLACE_RETADDR drwrap strategy where the return address on the stack is replaced with the address of the internal replace_retaddr_sentinel() routine. This API modifies the passed-in value to the actual return address of the inner-most nested wrapped function if the passed-in value is replace_retaddr_sentinel() itself. Fixes the value of the marker written by the kernel xfer event in drmemtrace by using the new drwrap_get_retaddr_if_sentinel() API on the mcontext PC before writing it out to the trace. Before, this caused many invariant errors of type 'Signal handler return point incorrect' in traces collected on proprietary apps. Verified on a large proprietary app that this error due to drwrap is fixed now, whereas there were a few hundred instances before. Fixes: #5784
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A proprietary app hit the "Signal handler return point incorrect" invariant error. This happens for signals received at the end of a function that was wrapped with drwrap.
view
output before the error at23871501
:-no_record_replace_retaddr
resolves this, but we should fix it for-record_replace_retaddr
too.The text was updated successfully, but these errors were encountered: