(fyi, whenever i say "asan" [or hwasan], i mean _clang's_ unrelated implementation. afaik none of the google asan team have touched the gcc implementation in years, and i don't know what state that's in. whereas if you have issues with clang+asan, i can pass those on to the authors :-) )
On Sat, Dec 24, 2022 at 6:48 AM Rob Landley <[email protected]> wrote: > I was trying to figure out why "ASAN=1 make test_sh" failed on the very > first > test, and I traced it down to the memory leak detector going "you're > letting > exit free memory for you!" (yes, I know?) and then wasting another hour > digging > through the build plumbing trying to figure out why the > ASAN_OPTIONS=detect_leaks=0 that scripts/portability.sh is exporting in > the ASAN > case wasn't making it through to the final call to gcc *.o and... > > It is. The problem is that the gcc in devuan beowulf is ignoring it. This > doesn't show up in most of the other toybox cases because xexit() calls > _xexit() > which calls _exit(). I.E. we never return through the libc plumbing error > path, > we do our own cleanup and call the syscall ourselves. But in sh.c, > exit_main() > is calling libc's exit() so in this ONE case if you explicitly "exit" from > the > shell, ASAN's leak detector runs. > > I've worked around it for now by sticking > > const char *__asan_default_options() { return "detect_leaks=0"; } > > into main.c which made it stop doing that, but WOW this is janky > infrastructure. > > Rob > _______________________________________________ > Toybox mailing list > [email protected] > http://lists.landley.net/listinfo.cgi/toybox-landley.net >
_______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
