This is an archive of the discontinued LLVM Phabricator instance.

[LibFuzzer] Split the fuzzer-oom.test into two tests.
ClosedPublic

Authored by delcypher on Jun 3 2016, 11:35 AM.

Details

Summary

[LibFuzzer] Split the fuzzer-oom.test into two tests.

This is necessary because the existing fuzzer-oom.test was Linux
specific due to its use of __sanitizer_print_memory_profile() which
is only available on Linux right now and so the test would fail on OSX.

The two tests are selectively disable by adding a new feature (linux
or darwin) which is set based on the host platform.

Diff Detail

Repository
rL LLVM

Event Timeline

delcypher updated this revision to Diff 59587.Jun 3 2016, 11:35 AM
delcypher retitled this revision from to [LibFuzzer] Fix fuzzer-oom.test on OSX..
delcypher updated this object.
delcypher added reviewers: kcc, aizatsky.
delcypher added subscribers: llvm-commits, kcc, aizatsky and 3 others.
aizatsky accepted this revision.Jun 3 2016, 1:27 PM
aizatsky edited edge metadata.
This revision is now accepted and ready to land.Jun 3 2016, 1:27 PM
kcc edited edge metadata.Jun 3 2016, 1:40 PM

Interesting solution!
But wrong. :(
Essentially, you are now not testing that the heap profile is printed, but that libFuzzer successfully bypasses the test.
Instead of this, I suggest to make two copies of test/fuzzer-oom.test.
One will remain as is and require linux.
Another one will work on darwing too, but will not check for "Live Heap Allocations:"

In D20977#448818, @kcc wrote:

Interesting solution!
But wrong. :(

I had a feeling you'd say that. This patch does feel like a massive hack.

Essentially, you are now not testing that the heap profile is printed, but that libFuzzer successfully bypasses the test.
Instead of this, I suggest to make two copies of test/fuzzer-oom.test.
One will remain as is and require linux.
Another one will work on darwing too, but will not check for "Live Heap Allocations:"

That's essentially what I mentioned in the patch summary (`In the future if we want to better test information about the live
heap allocations..`) as something we should do so I'm happy to make the change you suggest.

delcypher updated this revision to Diff 59804.Jun 6 2016, 4:45 PM
delcypher retitled this revision from [LibFuzzer] Fix fuzzer-oom.test on OSX. to [LibFuzzer] Split the fuzzer-oom.test into two tests..
delcypher updated this object.
delcypher edited edge metadata.

Rework patch. Maybe I should use XFAIL rather than REQUIRES here?

delcypher updated this object.Jun 6 2016, 4:47 PM
kcc added inline comments.Jun 6 2016, 6:04 PM
lib/Fuzzer/test/fuzzer-oom-darwin.test
1 ↗(On Diff #59804)

Why does this require darwin?

delcypher added inline comments.Jun 6 2016, 6:13 PM
lib/Fuzzer/test/fuzzer-oom-darwin.test
1 ↗(On Diff #59804)

Technically it doesn't but my assumption is this would be the test for darwin (e.g. OSX). Do you want me to remove the REQUIRES: darwin line and remove darwin from the name of the test?

kcc added inline comments.Jun 6 2016, 6:19 PM
lib/Fuzzer/test/fuzzer-oom-darwin.test
1 ↗(On Diff #59804)

Yes, and yes.
And remove linux from the other test's name (call it e.g. "oom-wit-profile")

lib/Fuzzer/test/lit.cfg
31 ↗(On Diff #59804)

And you will not need parts about darwin here

delcypher added a subscriber: beanz.Jun 6 2016, 6:19 PM
delcypher removed a subscriber: beanz.
delcypher updated this revision to Diff 59825.Jun 6 2016, 10:15 PM
  • Renames tests
  • Remove 'darwin' from feature list
kcc accepted this revision.Jun 7 2016, 11:06 AM
kcc edited edge metadata.

LGTM

This revision was automatically updated to reflect the committed changes.