[Toybox] Debugging of the mkpasswd.c ASAN error (It's glibc's fault)

Rob Landley rob at landley.net
Mon Mar 4 18:25:50 PST 2024


On 3/4/24 20:09, Oliver Webb wrote:
> Okay, so ASAN is doing _something_ that replaces the call to crypt with something else, and since we only do
> -lcrypt "as-needed" it does... something. Which means that crypt isn't really being called.
> This is a WEIRD bug, why is ASAN replacing the symbol for crypt so we don't have to -lcrypt to get it...
> 
> The answer is to declare -lcrypt (-Wl,--as-needed doesn't work). While somehow keeping compatibility with musl
> (which doesn't split libcrypt and libc). More porability.sh stuff, We'd need a mechanism to detect a glibc build tho

No, we need to acknowledge that a recently glibc broke crypt (violating posix)
and provide our own crypt() implementation in lib/ because gnu sucks.

Working on it...

Rob


More information about the Toybox mailing list