[Toybox] ASan freaks out when using tsort in multicall binaries

Rob Landley rob at landley.net
Thu Oct 5 22:36:56 PDT 2023


On 10/5/23 22:50, Oliver Webb via Toybox wrote:> I ran "VERBOSE=allnopass make
tests" to see exactly what was still broken.

Note that all of them pass for me.

> (du has some symlink issues,

On what filesystem?

> tar has a long filename issue,

Hadn't seen that one, I'm aware of a sparse file issue on some filesystems.
(That hit on microsoft github.)

> sed fails the performance test even though it can process a megabyte of data in less then 20s,

On what hardware?

> and the test passes on "make test_sed", 

Does it still happen with the most recent commit to timeout? (Did it just
_start_ happening with the most recent commit to timeout?) Because the big
difference between the two is using your host $PATH for the commands other than
sed. The "make tests" setup puts all the toybox commands at the start of the
$PATH and uses them to test each other.

Again, it passed for me.

> mkpasswd segfaults due to a null pointer sometimes, etc)

I haven't seen this (what distro/compiler/libc/filesystem are you testing on),
but I mentioned I just redid the lib/password.c plumbing and need to re-audit
that list of commands before next release.

> To my surprise, Every test from tsort failed, along with some messages from
> a "AddressSanitizer".

Sigh, I moved the initializations between the two nested loops and the local
variable declarations enough times I apparently dropped the plen initialization.

Try commit 47946f241a4e.

> Compiling a multicall binary and running tsort (sometimes) 
> shows this message on boot:

Yeah, uninitialized variable it doesn't warn about. My bad. (And ASAN doesn't
catch the ones where it _is_ initialized to zero because this is the first call
on clean stack. Presumably there's some stack poisoning option somewhere...)

Rob


More information about the Toybox mailing list