Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 613606 - 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)
Summary: something broken between gcc-6, afl and asan (ASan runtime does not come firs...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-23 09:17 UTC by Agostino Sarubbo
Modified: 2019-12-29 11:43 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
all tests (asan,2.02 KB, text/x-matlab)
2017-03-23 09:17 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2017-03-23 09:17:50 UTC
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?
Comment 1 Hanno Böck gentoo-dev 2017-03-23 09:21:40 UTC
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.
Comment 2 Agostino Sarubbo gentoo-dev 2017-03-23 10:08:44 UTC
I get the same result with:

~ # CC="afl-gcc" CXX="afl-g++" AFL_USE_ASAN="1" emerge cabextract
Comment 3 SpanKY gentoo-dev 2017-03-24 06:16:32 UTC
i imagine ASAN is fighting with sandbox.  does it work w/FEATURES=-sandbox (and all the other ones turned off) ?
Comment 4 Agostino Sarubbo gentoo-dev 2017-03-24 08:14:27 UTC
FEATURES="-sandbox" does not resolve the problem.

FEATURES="-usersandbox" (without specify anything about sandbox) resolves the problem.
Comment 5 Hanno Böck gentoo-dev 2017-04-20 17:21:12 UTC
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.
Comment 6 Joakim Tjernlund 2018-06-27 17:51:12 UTC
Finally I found this bug, did fight ASAN all day.
Any progress?
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2018-06-27 19:41:14 UTC
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.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-29 11:43:35 UTC
Two together can't be used. You would have to disable sandbox or asan.