Skip to content
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

Invariant checker should handle signal arriving between the call/jmp and the function entry #6288

Closed
ivankyluk opened this issue Aug 30, 2023 · 0 comments · Fixed by #6292
Closed
Assignees

Comments

@ivankyluk
Copy link
Contributor

Invariant checker doesn't handle the case when a signal arrives between call/jmp and the function entry when it checks for function marker. For example:

172899745: T408787 ifetch 2 byte(s) @ 0x00007fc608bc71c7 0f 05 syscall -> %rcx %r11
172899746: T408787 <marker: timestamp 13310991841737435>
172899747: T408787 <marker: tid 408787 on core 23>
172899748: T408787 <marker: syscall xfer from 0x7fc608bc71c9>
172899749: T408787 <marker: timestamp 13310991841737533>
172899750: T408787 <marker: tid 408787 on core 23>
172899751: T408787 <marker: function #12>
172899752: T408787 <marker: function return value 0x7fc486120e70>

Function markers at ref 172899751 and 172899752 will be flagged as "Function marker should be after a branch" errors

@ivankyluk ivankyluk self-assigned this Aug 30, 2023
@ivankyluk ivankyluk changed the title Invariant checker should handle signal arriving between the call/jmp and the function entry when for func marker check Invariant checker should handle signal arriving between the call/jmp and the function entry Sep 1, 2023
github-merge-queue bot pushed a commit that referenced this issue Sep 7, 2023
…#6292)

When a signal arrives after a branch to a function, function markers are
inserted after the corresponding syscall xfer marker.

There are a few corner cases which need to be handled:
1. Function markers in the beginning of a trace before any instructions.
2. syscall xfer markers without the corresponding kernel xfer markers.
This case happens when a trace is started in the middle of a signal
handler, or nested signals.

In order to avoid false positives, the check for function markers after
a branch assumes markers are place correctly in these cases.

Fixes #6288
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant