Summary: | something broken between gcc-6, afl and asan (ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Agostino Sarubbo <ago> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | hanno, joakim.tjernlund, sandbox, slyfox |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | all tests |
I've seen such errors in a different situation, but I don't know the exact cause. But from what I can see you're using afl-[compiler] with -fsanitize=address. That's not the recommended way of doing things. If you want to build stuff with afl+asan you usually set AFL_USE_ASAN=1 in the environment and let afl do the rest. It knows best how to pass its cflags. I get the same result with: ~ # CC="afl-gcc" CXX="afl-g++" AFL_USE_ASAN="1" emerge cabextract i imagine ASAN is fighting with sandbox. does it work w/FEATURES=-sandbox (and all the other ones turned off) ? FEATURES="-sandbox" does not resolve the problem. FEATURES="-usersandbox" (without specify anything about sandbox) resolves the problem. I can reproduce this now. It is not related to afl at all, it happens also with "pure" asan. Spanky: Can you comment in detail on the sandbox fighting problems? Is that fixable? Would be unfortunate if we couldn't do asan builds by default any more with portage. Finally I found this bug, did fight ASAN all day. Any progress? sandbox does LD_PRELOAD and would prefer being first in the list of LD_PRELOADs to override open() and friends without missing overrides done by other LD_PRELOADS used by build systems (libtool usually does it in src_test() and many others). asan expects the same semantics: load first and track all memory references. I don't think there is an easy generic fix without breaking or crippling functionality of one of two libraries. Two together can't be used. You would have to disable sandbox or asan. |
Created attachment 468028 [details] all tests I'm CC'ing all maintainers because I didn't understand where the fault is. To better view all steps I'm putting my tests as attachment. Does anyone have an idea?