-
Notifications
You must be signed in to change notification settings - Fork 997
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
Unable to run sanitized executables on ppc64le Ubuntu and SLES #933
Comments
Does this work with clang? |
I can confirm that on SLE12 with GCC 7. Let me try to debug that. |
So root of the problem is that
And on CentOS 7 it has 46bits:
While on SLE12 it has 48 bits and looks as follows:
And issue is that allocator has defined range:
and kAllocatorSpace + kAllocatorSize does not fit in any of shadow regions, thus Solution is to set
This works, but extension of VA space to 48 will again break that. Kostya is it acceptable fix? |
I don't mind, as long as someone from IBM reviews this upstream. |
I tried both 0x120000000000ULL and ~(uptr)0 as values for kAllocatorSpace and tested on 4 different powerpc64 systems with various kernel levels and only ~(uptr)0 worked on all of them. I tried this with llvm, too, and it was similar. |
Ok, let's switch powerpc64 to the dynamic shadow base then ( |
Are there some suggested performance tests to run for asan? |
For public consumption I usually run Spec 2006, it's good enough for this kind of measurement. |
(check not just for the CPU overhead, but also for code size) |
I confirm that
fixed all the failing powerpc64 asan tests for me on a box where they have been failing before. |
I have nothing against switching to dynamic shadow. I'm just curious @BillSeurer what's difference in between the machines? Can you mention what's VM size and how does memory ranges look like:
Thanks. |
OK, I will check spec2006 then. |
power7 BE machine: power8 BE machine: power8 LE machine: power8 LE machine: |
I'm afraid there is no constant value that can work everywhere (at least not if we want to go it into HighMem chunk). Because the 47-bit VA needs at least 0x120000000000, and 44-bit VA needs at most 0xe0000000000 (and even that would be too high, because there is also stack in there). And LowMem is too small in the 44-bit VA space, it is exactly the 2TB we need, but there would be no space for the executable etc. |
That would mean would have to sacrifice 44-bit VA seen on the power7 machine. It's running quite old Linux kernel. How long will you support the RHEL 6.9 version @jakubjelinek? |
Until 2024. |
I see. There are another questions that I see:
|
Isn't that exactly what ~(uptr) 0 does?
|
Sounds good, if @BillSeurer will not see any significant slow down, then let's install the patch. |
Ugh. Some of the spec2006 tests trigger asan errors when I tried it. I am going to see if there are a few that run OK and just use those. |
Some SPEC2k6 sources are indeed invalid, see e.g. http://gcc.gnu.org/PR53073 |
See also: https://github.com/google/sanitizers/wiki/AddressSanitizerRunningSpecBenchmarks |
The total run time for all the successful spec2006 tests was almost identical with the kAllocatorSpace = ~(uptr)0 change as without it. I could dive into the details but I think this is good enough for our purposes. |
If it's good for you it's good for me, thanks for checking! |
Should I create a phabricator review? Or has anybody else done that? |
In order for this to work in llvm you may also need to change the value |
Yes, please. |
Never mind. I just tried some llvm test runs and the allocator patch above works fine by itself without any other changes. |
Review request created: |
Fixes issue: google/sanitizers#933 Differential Revision: https://reviews.llvm.org/D45950 llvm-svn=330650
https://reviews.llvm.org/D45950 landed. I think this can be closed. |
all executables built with asan fail to start on ppc64le machines.
simplest program to reproduce:
build:
gcc-5 -fsanitize=address main.cpp -o test
run:
environments tested:
compilers tested:
gcc-5, gcc-6, gcc-7
The text was updated successfully, but these errors were encountered: