Fuzzing: compile the whole libespeak with -fsanitize=fuzzer-no-link
-fsanitize=fuzzer-no-link makes it workable to build a library with fuzzing
enabled, and let the fuzzing test program explicitly trigger the fuzzing.
This allows fuzzing to trace cmp instructions to guide the fuzzing to
improve results.
* Add: fuzzer files and modifications in config & compil
* add configure.ac change
* add minimize-corpus.sh
* add fuzzing directory and readme
* add to check if CC support libfuzzer
* Make workflow dump the crash POC
* Add debugging information
* Run fuzzing only once a week for now
Co-authored-by: kmamadoudram <[email protected]>
Co-authored-by: yocvito <[email protected]>
Co-authored-by: Samuel Thibault <[email protected]>
These are global arrays reused several times. When using them msan and
valgrind thus believe they are always initialized, which reduces their
capacity to detect uninitialized values. We can however explicitly tell them
when they are reused, and thus to be considered as uninitialized.
espeak source code uses signed integer wrapping (e.g. wavephase in
wavegen.c's Wavegen). It happens that this is undefined behavior, so a
compiler would be free optimize away various situations... Fortunately gcc
has an -fwrapv option to make signed integer wrapping defined.
Options would be needed for other compilers.
It is perhaps more autoconfy to have AM_CONDITIONAL evaluate a variable
rather than call it with what are essentially constants representing
either true or false. It might be even more autoconfy to use
AC_CHECK_PROG here instead; I don't know if there's a good reason why
that wasn't already done here.
Show in configure summary when gradle is not found
Previously, if configure determined that gradle could not be found, the
summary at the end of the configure output would nevertheless print the
name or path of the nonexistent gradle executable that it tried to find.
Now it clears that variable.
Previously, the configure script would only successfully determine that
gradle exists if the user specified an absolute path to the executable.
It would fail if the user specified only an executable name or if the
default value of "gradle" were used. Now it should succeed in either
situation.
without this fix (assuming it does, what the original author intended to check for), the configure script spits out an error:
checking for ndk-build no
checking for gradle no
${_source}/configure: line 13806: 0: command not found
checking if zsp-gcc supports C99 without any flags yes
checking if zsp-gcc supports C99 with the -std=c99 flag yes
that's because the condition in AM_CONDITIONAL is expected to be a valid shell expression for an if-statement, not just plain value:
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gradle" >&5
printf %s "checking for gradle... " >&6; }
if test -e ${GRADLE} ; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${GRADLE}" >&5
printf "%s\n" "${GRADLE}" >&6; }
if 1; then
HAVE_GRADLE_TRUE=
HAVE_GRADLE_FALSE='#'
else
HAVE_GRADLE_TRUE='#'
HAVE_GRADLE_FALSE=
fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if 0; then
HAVE_GRADLE_TRUE=
HAVE_GRADLE_FALSE='#'
else
HAVE_GRADLE_TRUE='#'
HAVE_GRADLE_FALSE=
fi
fi
FreeBSD requires __BSD_VISIBLE to be set to expose M_PI and mkstemp() in the
system includes. This is normally set when _ANSI_SOURCE, _C99_SOURCE, or
_C11_SOURCE are undefined. I don't want to dig into what the compiler is
setting, so I'm just setting it in the configure script.
/bin/sh ./libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -fPIC -fvisibility=hidden -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"/usr/local/share/espeak-ng-data\" -DLIBESPEAK_NG_EXPORT -Isrc/include -Isrc/include/compat -I src/ucd-tools/src/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -Wno-endif-labels -g -O2 -std=c99 -MT src/libespeak-ng/src_libespeak_ng_la-wavegen.lo -MD -MP -MF src/libespeak-ng/.deps/src_libespeak_ng_la-wavegen.Tpo -c -o src/libespeak-ng/src_libespeak_ng_la-wavegen.lo `test -f 'src/libespeak-ng/wavegen.c' || echo './'`src/libespeak-ng/wavegen.c
libtool: compile: cc -DHAVE_CONFIG_H -I. -fPIC -fvisibility=hidden -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"/usr/local/share/espeak-ng-data\" -DLIBESPEAK_NG_EXPORT -Isrc/include -Isrc/include/compat -I src/ucd-tools/src/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -Wno-endif-labels -g -O2 -std=c99 -MT src/libespeak-ng/src_libespeak_ng_la-wavegen.lo -MD -MP -MF src/libespeak-ng/.deps/src_libespeak_ng_la-wavegen.Tpo -c src/libespeak-ng/wavegen.c -fPIC -DPIC -o src/libespeak-ng/.libs/src_libespeak_ng_la-wavegen.o
src/libespeak-ng/wavegen.c:355:24: error: use of undeclared identifier 'M_PI'
x = 127*(1.0 - cos((M_PI*2)*ix/wavemult_max));
^
src/libespeak-ng/wavegen.c:623:16: error: use of undeclared identifier 'M_PI'
minus_pi_t = -M_PI / samplerate;
^
2 errors generated.
gmake[1]: *** [Makefile:1690: src/libespeak-ng/src_libespeak_ng_la-wavegen.lo] Error 1