Compiling fuzzer

electricworry worryelectric at
Wed Jul 15 19:11:21 CEST 2020

On Wed, 15 Jul 2020 at 17:29, Alan DeKok <aland at> wrote:
> On Jul 15, 2020, at 11:36 AM, electricworry <worryelectric at> wrote:
> >
> > I'm trying to build FreeRADIUS with the fuzzers, but I'm running into
> > some problems. Can anyone please point out what I'm doing wrong?
>   v3 doesn't build with a fuzzer.  Only "master" branch has fuzzer support.

Thanks. Indeed, I am on the master branch, fully up to date.

> > First up I appended "CFLAGS += -fsanitize=fuzzer" to
> > before running ./configure.
>   That shouldn't be necessary.  In the "master" branch, see src/bin/  You can just follow the instructions in that file.

So, following the instructions in src/bin/, I am to modify (so that necessitates running ./configure first) by appending
the required CFLAGS, then build. My steps are:

    make distclean
    ./configure CC=clang
    echo "CFLAGS += -fsanitize=fuzzer" >>
    make all

That fails at the point of building src/lib/util/dbuff_tests.c, which
is why I was then looking at the fuzzer-no-link flag:

    LINK build/lib/
    CC src/lib/util/dbuff_tests.c
    /usr/bin/ld: build/objs/src/lib/util/dbuff_tests.o: in function
undefined reference to `__sancov_lowest_stack'
undefined reference to `__sancov_lowest_stack'
undefined reference to `__sanitizer_cov_trace_const_cmp4'
undefined reference to `__sanitizer_cov_trace_const_cmp4'
    <snip />

I am using Linux Mint 20 and clang is version 10. The instructions in
src/bin/ don't seem to be foolproof in my case,

More information about the Freeradius-Devel mailing list