-
Notifications
You must be signed in to change notification settings - Fork 45
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
Improve Cython coverage #98
Conversation
Simulate failures to find the heap and BSS as well as failures to correctly resolve the heap address in order to exercise our error handling code. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
72d982f
to
60fa201
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #98 +/- ##
==========================================
+ Coverage 89.46% 90.34% +0.88%
==========================================
Files 46 47 +1
Lines 5419 5480 +61
Branches 845 863 +18
==========================================
+ Hits 4848 4951 +103
+ Misses 571 529 -42
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Ensure that `@intercept_runtime_errors` actually does intercept `RuntimeError`, and exercise all paths in `_check_interpreter_shutdown`. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Since we never configure the level of `LOGGER`, it's always `logging.NOTSET`, and no log level is ever lower than `NOTSET`, so this early return is never taken. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Nothing ever calls `copy_memory_from_address` with `blocking=True`, so we can safely remove this code path and unconditionally use the nonblocking version. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
`map_info.python` is annotated as a non-optional `VirtualMap`, and `parse_maps_file_for_binary` will never set it to `None`, so this conditional never triggers. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
In order to pass the `errno` returned from the failed `ptrace` call to `std::system_error`, we need to save it in a temporary to stop it from being overwritten by the calls we make in `detachFromProcess`. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
These values don't match the actual declaration in `process.h`. Since Cython doesn't use or need to know the values, just remove them, to avoid misleading future readers. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
This also raises code coverage. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
This should never happen unless we've badly screwed something up or memory has been trashed (as variable names ought to always be valid Unicode strings), but we can both improve coverage and improve the failure mode by explicitly specifying an error handling method. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
There is no path where `getThreadFromInterpreterState` can return an unset shared pointer, so this conditional will never fire. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
60fa201
to
23a7767
Compare
@pablogsal I'd like your review here specifically, since I did make some changes to the implementation (deleting some code I believe to be dead, and restructuring some code to be easier to exercise). I've attempted to roughly arrange the commits from least controversial to most. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reviewed every commit individually and the change itself as a whole and executed everything locally and coud not find anything I don't like. Excellent job!
This PR gets all but one line of
_pystack.pyx
covered by our test suite.I'm leaning towards believing that line is dead code, but I'm not yet confident enough to remove it...