This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Fix Out of Memory tests to work on 32 bits.
ClosedPublic

Authored by mpividori on Jan 13 2017, 3:04 PM.

Details

Summary

Hi,
I add 2 changes to make the tests work on 32 bits and on 64 bits. I change the size allocated to 0x20000000 and add the flag: -rss_limit_mb=300.
Otherwise the output for 32 bits and 64 bits is different.
For 64 bits the value 0xff000000 doesn't exceed kMaxAllowedMallocSize.
For 32 bits, kMaxAllowedMallocSize is set to 0xc0000000 , so the call to Allocate() will fail earlier printing WARNING: AddressSanitizer failed to allocate ... , and wont't call malloc hooks.
So, we need to consider a size smaller than 2GB (so malloc doesn't fail on 32bits) and greater that the value provided by -rss_limit_mb. Because of that I use: 0x20000000.

Diff Detail

Repository
rL LLVM

Event Timeline

mpividori updated this revision to Diff 84392.Jan 13 2017, 3:04 PM
mpividori retitled this revision from to [libFuzzer] Fix Out of Memory tests to work on 32 bits..
mpividori updated this object.
mpividori added reviewers: kcc, zturner.
mpividori set the repository for this revision to rL LLVM.
mpividori added a subscriber: llvm-commits.
kcc accepted this revision.Jan 17 2017, 12:59 PM

LGTM

This revision is now accepted and ready to land.Jan 17 2017, 12:59 PM
This revision was automatically updated to reflect the committed changes.