Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lxc] turn off AFL for now #5685

Merged
merged 1 commit into from
Apr 30, 2021
Merged

Conversation

evverx
Copy link
Contributor

@evverx evverx commented Apr 28, 2021

[lxc] turn off AFL for now

It seems LXC is failing to compile with AFL with

../../src/lxc/storage -pthread -O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -stdlib=libc++ -Wl,--as-needed -Wl,--gc-sections -Wl,-z -Wl,relro -Wl,-z -Wl,now -pie -Wl,-fuse-ld=gold -o fuzz-lxc-define-load fuzz_lxc_define_load-fuzz-lxc-define-load.o  ../lxc/.libs/liblxc.a /usr/lib/libFuzzingEngine.a -lpthread -pthread
Step #32: /usr/bin/ld: /usr/lib/libFuzzingEngine.a(aflpp_driver.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
Step #32: /usr/lib/libFuzzingEngine.a: error adding symbols: Bad value
Step #32: clang-12: [0;1;31merror: [0m[1mlinker command failed with exit code 1 (use -v to see invocation)[0m
Step #32: make[3]: *** [fuzz-lxc-config-read] Error 1

Apparently aflpp tends to misdetect compiler/linker features 30% (70%?)
of the time: #4280 (comment)

@evverx
Copy link
Contributor Author

evverx commented Apr 28, 2021

I'm not sure why it works locally and here. I'll wait for the next build at https://oss-fuzz-build-logs.storage.googleapis.com/index.html#lxc to fail before turning it off.

@evverx evverx marked this pull request as ready for review April 29, 2021 00:15
@evverx
Copy link
Contributor Author

evverx commented Apr 29, 2021

Looks like -FPIE and -pie (which the fuzzers are built with) aren't compatible with aflpp (which apparently is compiled without PIC on OSS-Fuzz). Though it seems hongfuzz is built with PIC. Also, I noticed that some projects use stopgaps like

# we also need to disable building as PIE because libFuzzingEngine.a
# does not appear to be compiled as PIC
sed -i 's/AC_CC_PIE//' configure.ac

to make it work.

@jonathanmetzman @inferno-chromium I wonder why the static libraries are built this way?

@evverx evverx marked this pull request as draft April 29, 2021 13:01
@evverx
Copy link
Contributor Author

evverx commented Apr 29, 2021

What's weird though is that according to https://oss-fuzz-build-logs.storage.googleapis.com/log-0e5fb2ff-cdf5-4a77-a1f0-1b4a533fbe6a.txt the latest build didn't fail and https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33792 was closed somehow.

I've opened lxc/lxc#3815 but it seems it would make sense to just wait to see whether it's a glitch of some kind or not.

It seems LXC is failing to compile with AFL with
```
../../src/lxc/storage -pthread -O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -stdlib=libc++ -Wl,--as-needed -Wl,--gc-sections -Wl,-z -Wl,relro -Wl,-z -Wl,now -pie -Wl,-fuse-ld=gold -o fuzz-lxc-define-load fuzz_lxc_define_load-fuzz-lxc-define-load.o  ../lxc/.libs/liblxc.a /usr/lib/libFuzzingEngine.a -lpthread -pthread
Step google#32: /usr/bin/ld: /usr/lib/libFuzzingEngine.a(aflpp_driver.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
Step google#32: /usr/lib/libFuzzingEngine.a: error adding symbols: Bad value
Step google#32: clang-12: [0;1;31merror: [0m[1mlinker command failed with exit code 1 (use -v to see invocation)[0m
Step google#32: make[3]: *** [fuzz-lxc-config-read] Error 1
```

Apparently aflpp tends to misdetect compiler/linker features 30% (70%?)
of the time: google#4280 (comment)
@evverx
Copy link
Contributor Author

evverx commented Apr 30, 2021

@jonathanmetzman @inferno-chromium could you please merge it?

@evverx evverx marked this pull request as ready for review April 30, 2021 03:32
@inferno-chromium inferno-chromium merged commit 181b357 into google:master Apr 30, 2021
evverx added a commit to evverx/oss-fuzz that referenced this pull request Apr 30, 2021
This reverts commit 181b357.

The issue was fixed in google#5691
inferno-chromium pushed a commit that referenced this pull request Apr 30, 2021
This reverts commit 181b357.

The issue was fixed in #5691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants