[Toybox] asan is your friend

enh enh at google.com
Mon Jul 18 16:49:45 PDT 2022


On Sat, Jul 16, 2022 at 12:14 AM Rob Landley <rob at landley.net> wrote:

> On 7/15/22 21:24, enh via Toybox wrote:
> > i saw you complaining about memory errors on your blog, talking about
> writing
> > your own infrastructure... why not just `export ASAN=1`?
>
> Ray Gardner emailed me identifying the line on wednesday (quote_filename()
> returns garbage so free(quoted_file) breaks).
>

yeah, that's what asan said. my point was, for the low low cost of just
putting `export ASAN=1` in your .bashrc, you wouldn't ever have to even
ask. the increase in compile time is pretty small, and for things the size
of toybox tests, the runtime cost is fine too. (my makefiles for my
personal hobby projects don't even have a non-asan option.)


> My complaint was more "Ze <strike>goggles</a> test suite tests, ze do
> nothink!"
> because the bug WASN'T in my current tree, it was in the previously
> checked in
> stuff that had passed the test suite before being checked in.
>

aye, but that's an orthogonal problem. and the nice thing about running
asan builds all the time is that you catch a bunch of stuff by accident.
that's _why_ it's so great. (you don't even need a corruption/UAF bad
enough that the "production" code would even crash... you can find subtle
stuff with easy cases.)


> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20220718/0fd2e504/attachment-0001.htm>


More information about the Toybox mailing list