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

Fix test failures on SLOB / tiny #416

Merged
merged 2 commits into from
Jul 19, 2024
Merged

Fix test failures on SLOB / tiny #416

merged 2 commits into from
Jul 19, 2024

Conversation

brenns10
Copy link
Contributor

I also added a -f option to the setup.py because I wanted to run the tests locally and noticed I had no easy way to say "just run the tiny tests". I didn't bother trying to add any logic to make -f and -F conflict... it's a developer tool after all.

@brenns10
Copy link
Contributor Author

Oh, boy, also, Fixes #415, which I did not include in a commit message, but that's probably ok.

@brenns10
Copy link
Contributor Author

brenns10 commented Jul 18, 2024

A manual test run on my fork with the "test-all-kernel-flavors" option set: (but not all python versions)
https://github.com/brenns10/drgn/actions/runs/9983302801

@brenns10
Copy link
Contributor Author

This implementation doesn't run all kernel flavors on push to main (like we do with all Python versions). It only does it for the tests after vmtest build, and when a PR has the tag set.

@brenns10
Copy link
Contributor Author

Oh fun, no space left on device! Looks like we'll need to avoid pre-fetching all kernels and we'll need a way to delete them after testing, for CI only:
https://github.com/brenns10/drgn/actions/runs/9983302801

@osandov
Copy link
Owner

osandov commented Jul 18, 2024

Would you mind splitting the setup.py and CI changes into a separate PR? I'll take a closer look tomorrow, thanks again!

@brenns10
Copy link
Contributor Author

Yeah that seems wise. I'll split them up in the morning!

Copy link
Owner

@osandov osandov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than one comment, thanks!

start_addr = pfn_to_virt(prog["min_low_pfn"]).value_()
end_addr = (pfn_to_virt(prog["max_low_pfn"]) + prog["PAGE_SIZE"]).value_()
return start_addr <= addr < end_addr
except NotImplementedError:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't bother catching this exception. The helper should fail hard if virtual address translation isn't supported like the other mm helpers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like this helper's callers to fail on this as well, or should I push that exception handler up to each of the three callers?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it the way it currently is: _identify_kernel_address() should catch it, but the SLAB helpers should fail.

In the Fixes commit, as part of the refactor, the
_identify_kernel_address() function started open-coding the
get_slab_object_info() function. Unfortunately, this resulted in the
function failing when CONFIG_SLOB was enabled, since the AttributeError
for accessing "slab.slab_cache" was not caught.

Open-coding was done to avoid the duplicate bounds check for
in_direct_map. In fact, in_direct_map seems like a useful helper itself,
and by factoring it out of _find_containing_slab() and into its callers,
we can simplify things a bit. Since _find_containing_slab() can handle
SLOB, this fixes the test failure too.

Fixes: 48e0c51 ("helper.common.memory: recognize vmap addresses in identify_address()")

Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
The test for print_annotated_memory() shouldn't assert anything when
CONFIG_SLOB is enabled, because we can't find slab objects. However, the
test shouldn't be skipped entirely, because print_annotated_memory()
should run without error in this case. Skip the assertion only.

Fixes: c771728 ("helpers.common.memory: add print_annotated_memory() helper")

Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
@osandov osandov changed the title Fix test failures on SLOB / tiny, plus let Github actions test all flavors Fix test failures on SLOB / tiny Jul 19, 2024
@osandov osandov merged commit 7e8c5d7 into osandov:main Jul 19, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants