This is an archive of the discontinued LLVM Phabricator instance.

[lsan] ppc64: dynamically pick address range for allocator
ClosedPublic

Authored by MaskRay on Mar 8 2022, 3:01 PM.

Details

Summary

For ppc64 PIE, it seems that [0xa00000000000,0xc00000000000) may be occupied
which will lead to a segfault in certain kernel configurations
(clang-ppc64le-rhel). Use the !kUsingConstantSpaceBeg code path like Fuchsia.

Diff Detail

Event Timeline

MaskRay created this revision.Mar 8 2022, 3:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2022, 3:01 PM
Herald added a subscriber: shchenz. · View Herald Transcript
MaskRay requested review of this revision.Mar 8 2022, 3:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2022, 3:01 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

This certainly fixes all the lsan issues on Ubuntu 18.04, leaving only one failure in the CRT test:
CRT-powerpc64le-linux :: dso_handle.cpp

I'll try to see what that's all about.

This certainly fixes all the lsan issues on Ubuntu 18.04,

Thanks for testing and investigating! If you accept this patch, I'll push it.

leaving only one failure in the CRT test:
CRT-powerpc64le-linux :: dso_handle.cpp

I'll try to see what that's all about.

Puzzled by this failure :( My ppc64 machine works with the test.

jsji accepted this revision.Mar 11 2022, 7:35 PM

LGTM, asan also uses dynamic allocation, so the performance impact should be acceptable.

This will also increase the kAllocatorSize to 4T, but I guess it is to align with all other platforms, and we should be OK even with RHEL 7.6 (kernel 3.10.0).
Thanks for fixing.

This revision is now accepted and ready to land.Mar 11 2022, 7:35 PM

Thanks! This is for -fsanitize=leak which is a very uncommon option (most people just use asan). I think the constant address can probably save one or two instructions in malloc like functions, which really helps little.
Aligning the VM space with other targets improving consistency.

This revision was landed with ongoing or failed builds.Mar 11 2022, 8:16 PM
This revision was automatically updated to reflect the committed changes.