This is an archive of the discontinued LLVM Phabricator instance.

[msan] Don't hardcode 4kiB page size in msan_test.cc.
ClosedPublic

Authored by koriakin on Apr 18 2016, 9:11 AM.

Details

Summary

This breaks the valloc test on PowerPC, which has 64kiB pages. Since
getting page size portably is nontrivial, and there's already a function
for that in __sanitizer, just use it. Unfortunately, sanitizer_common.h
conflicts with the interface headers inclucded by msan_test.cc (and a few
of its own macros), so we have to declare it manually.

Diff Detail

Repository
rL LLVM

Event Timeline

koriakin retitled this revision from to [msan] Don't hardcode 4kiB page size in msan_test.cc..
koriakin updated this object.
koriakin added reviewers: eugenis, samsonov, kcc.
koriakin set the repository for this revision to rL LLVM.
koriakin added a project: Restricted Project.
koriakin added a subscriber: llvm-commits.
eugenis accepted this revision.Apr 18 2016, 1:32 PM
eugenis edited edge metadata.

LGTM

This revision is now accepted and ready to land.Apr 18 2016, 1:32 PM
This revision was automatically updated to reflect the committed changes.

Unfortunately, this fails if this code is built as a shared library.
__sanitizer::* symbols are not exported by MSan.
It looks like sysconf(_SC_PAGESIZE) should work on all supported platforms. I'll make the change.

fixed in r266910