This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizers] [Bug 24151] Generalize type of offset in internal_mmap
ClosedPublic

Authored by mohit.bhakkad on Jul 29 2015, 3:53 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

mohit.bhakkad retitled this revision from to [Sanitizers] [Bug 24151] Generalize type of offset in internal_mmap .
mohit.bhakkad updated this object.
mohit.bhakkad added reviewers: kcc, dsanders.
mohit.bhakkad set the repository for this revision to rL LLVM.

choosing a more apt data type

dsanders edited edge metadata.Jul 30 2015, 5:36 AM
dsanders added a subscriber: hans.

Added Hans since this patch fixes the remaining asan failure in the 3.7 release.

kcc accepted this revision.Jul 30 2015, 9:46 AM
kcc edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jul 30 2015, 9:46 AM

The x86 build failed with:

projects/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc:318: undefined reference to `__sanitizer::MapWritableFileToMemory(void*, unsigned long, int, unsigned long)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

OFF_T is unsigned long long on this host.

I've therefore changed the definition in sanitizer_common.h to fix the build. Also, in anticipation of the windows build failing on the same issue I've changed the one in sanitizer_win.cc too.

I'm currently running check-all and I intend to commit on Mohit's behalf if that passes.

Hans+Kostya: Is this ok to merge to the release branch once it's committed?

hans added a comment.Jul 30 2015, 1:44 PM

I'm currently running check-all and I intend to commit on Mohit's behalf if that passes.

Hans+Kostya: Is this ok to merge to the release branch once it's committed?

If everything works an Kostya is happy, I'm ok with merging.

kcc added a comment.Jul 30 2015, 1:51 PM

Yep, feel free to merge if the tests pass.

This revision was automatically updated to reflect the committed changes.

Great. Committed in r243686.

I had to make one more trivial change to make the tests pass. buildgo.sh failed because the printf's have a format/type mismatch. There's no portable way to print OFF_T so I'm casting to long long and using %lld