This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] [NFC] Generalize DSO tests to work even when files are moved.
ClosedPublic

Authored by george.karpenkov on May 23 2018, 3:17 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

morehouse accepted this revision.May 23 2018, 8:03 PM
This revision is now accepted and ready to land.May 23 2018, 8:03 PM
This revision was automatically updated to reflect the committed changes.
Herald added subscribers: Restricted Project, llvm-commits. · View Herald TranscriptMay 24 2018, 5:00 PM
vitalybuka reopened this revision.May 25 2018, 12:23 AM

Reverted in r333257

This revision is now accepted and ready to land.May 25 2018, 12:23 AM
george.karpenkov requested review of this revision.May 25 2018, 10:29 AM

Reverted in r333257

I'm glad the bot went back to green, but I'm super confused: how can one .test file affect another? If it does, there's another problem here.

vitalybuka added a comment.EditedMay 25 2018, 10:52 AM

Only these were red.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/15597/steps/check-fuzzer/logs/stdio

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Testing Time: 25.10s
********************
Failing Tests (2):
    LLVMFuzzer :: dso.test
    LLVMFuzzer :: dump_coverage.test

Let me know if you need help with debugging. I can reproduce it locally.

@vitalybuka thanks, I can now reproduce on my Linux machine as well. Looking into this.

@vitalybuka Turns out the simple trick I was using for Darwin did not work for the Linux linker, and more invasive changes were required.
What do you think? I don't see a way to do this without introducing extra substitutions, even though they are ugly.
I don't really mind the ugliness in testing configuration scripts here.

@vitalybuka Turns out the simple trick I was using for Darwin did not work for the Linux linker, and more invasive changes were required.
What do you think? I don't see a way to do this without introducing extra substitutions, even though they are ugly.
I don't really mind the ugliness in testing configuration scripts here.

From patch title I don't understand what are you trying to solve.
Why do we need to move files?

Why do we need to move files?

For testing on devices.

If you look at other tests in compiler-rt, they all use a similar combination of expansions to get dynamic libraries on devices working.
Here the problem was that since there were TWO dynamic libraries, the usual flags did not work.
(On Linux, linking in libblah.so requires a flag -lblah, so appending a postfix after both libblah.so and after libblah does not work, since liblah.so1 != libblah1.so)

@vitalybuka What do you think? I guess a more generalized framework could be developed to reduce code duplication, but I'm really not sure whether it's worth it.

@vitalybuka What do you think? I guess a more generalized framework could be developed to reduce code duplication, but I'm really not sure whether it's worth it.

I see.
Maybe we can create a patch with replacements like "%xdynamiclib_filename" -> "%xdynamiclib_filename1"
Then we will just wrap lit.common.cfg changes into the loop (1...2 for now :-) )?

vitalybuka accepted this revision.Jun 14 2018, 12:59 AM
vitalybuka added inline comments.
test/fuzzer/dso.test
2 ↗(On Diff #151294)

can you use 1 and 2 to make it look nicer?

This revision is now accepted and ready to land.Jun 14 2018, 12:59 AM
test/fuzzer/dso.test
2 ↗(On Diff #151294)

OK

This revision was automatically updated to reflect the committed changes.