-
Notifications
You must be signed in to change notification settings - Fork 588
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
Some ASan-related fixes #2892
Some ASan-related fixes #2892
Conversation
The timeout was my bad, this looks ready to go (pending review, of course ;) |
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.
Edit: it is about the test/64bit_child: determine bitness at compile-time
patch.
This iteration was added in #2784 to make tests be skipped
for a "-Dforce32bit=true" build running at a 64-bit kernel.
This change is intended to detect bitness of rr.
- 64-bit rr with 64-bit test at 64-bit linux --> librrpage.so --> test can be run
- 64-bit rr with 32-bit test at 64-bit linux --> librrpage_32.so --> test needs to be run
- 32-bit rr with 32-bit test at 64-bit linux --> librrpage.so --> test should be skipped
- 32-bit rr with 32-bit test at 32-bit linux --> librrpage.so --> test can be run (but bash would be 32-bit therefore no 64-bit child)
But I guess this would now set rr_is_32bit = 1
for the 64bit_child-32 test with a 64-bit rr too?
(I hope I remembered it correctly, I should have added a comment about this.)
Oh, okay... yeah, I see the issue (Restating it for the sake of future me: the purpose of My first attempt at changing the test involved having rr expose a new environment variable ( (btw, thanks for the review!) |
I guess that's it, exactly.
If I understand right, looking for librrpage.so would no longer work, because it got renamed in the other patch to linux-vdso.so.1? |
How's that look @bernhardu? |
To test it, I removed the "verify_asan_link_order=0" patch from my But I cannot judge if that approach in general is desired by the project ... @rocallahan ? |
No, since those tests are non-ASan binaries that As I said before, getting ASan working properly when the ASan binary has been |
Sorry for the delay, now I think I got it. I just wonder if something like "linux-vdso-rr.so.1" would be sufficient, to make it distinguishable? |
My thought was that running the test suite with an ASan-instrumented rr would effectively be the test for rr ASan support. However, that assumes ASan builds will be used a lot in future runs, which is not necessarily the case. I think having the test runner script build the binary would break test suite installation and possibly end up putting build artefacts outside the build tree; that said, the alternatives (complicating the build for a single test or just not testing it) are not exactly ideal either... Sorry, I don't really have any useful feedback there.
Hmm, this is probably a matter of taste: I don't really see the need to make it distinguishable (other than some sort of just-in-case measure, lest it be handy for some future hack), meanwhile making it indistinguishable is a just-in-case measure for some future version of ASan (or some other piece of software) that checks more of the SONAME when searching for the vDSO. I've only a mild preference for the latter, so I'm not too fussed either way. |
Yes, I was just testing an option to have a test in the regular rr test run. I am not really happy with it but thought this might be less invasive as complicating CMakeLists.txt by adding a single asan enabled test ...
I saw now e.g. gdb in Debian has a patch to detect it, so it might be better to just use plain "linux-vdso.so.1". Back to the patch "rrpage: use Linux vDSO soname", just if someone wants to test. Splitting off the smaller patches into separate pull requests could probably simplify discussion and make merging more likely. |
@rocallahan Have you some comments on this PR? What would be needed to progress here? |
These changes look fine. I assume tests pass with them? |
Sorry for the delay. I guess in that case, @Bob131 would you mind rebasing this PR on top of current tip? |
Ah, yes, I'm sorry about that; I hadn't realised the activity was on my
PR rather than bernhardu's.
I'm pretty sure I would have run the test suite before submitting the
PR, but I might just check again rebased atop master.
|
The test binary for 64bit_child determines the bitness of the process by searching the memory map for either 'librrpage.so' or 'librrpage_32.so'. This commit makes the test independent of the SONAME of librrpage by instead searching for librrpreload.
AddressSanitizer complains if it isn't the first shared object in the link map besides the vDSO. It checks for the vDSO by testing whether the DT_SONAME of the object starts with 'linux-'. With the introduction of librrpage, this check no longer passes and causes ASan-instrumented programs to abort when being recorded by rr. This patch alters the linker arguments used for producing the librrpage dummy vDSO such that its SONAME is 'linux-vdso.so.1'.
The CMake test property TIMEOUT has higher priority than the user-supplied --timeout switch. The exceptionally long default setting (1000 seconds) can make tests that aren't entirely controlled by test-monitor very painful to run. This commit instead sets CTEST_TEST_TIMEOUT, allowing the user to override the timeout at test run time.
Okay, tests pass; should be good to go. Thanks! |
Thanks! |
A couple of commits somewhat related to #2890. I've submitted it as a draft since there was one test timeout that I want to investigate but I didn't want to wait until tomorrow to follow up on #2890.
I would appreciate some extra scrutiny around the
64bit_child
test, since I'm not familiar with the details of how the kernel decides task arch-ness.