[libc-commits] [PATCH] D74091: [libc] Lay out framework for fuzzing libc functions.

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Feb 6 12:15:19 PST 2020


abrachet added inline comments.


================
Comment at: libc/fuzzing/string/strcpy_fuzz.cpp:25-27
+  if (strcmp(dest, src) != 0) {
+    abort();
+  }
----------------
PaulkaToast wrote:
> abrachet wrote:
> > Is this not `assert(strcmp(dest, src))` because you think `NDEBUG` might be defined for this file?
> oss-fuzz compiles with optimization -o3 enabled. Does NDEBUG get defined with that level of optimization? If it does then assert will not crash the fuzzer as expected. 
@sivachandra said to avoid `abort`, so that would mean avoid `assert` too, we could change this `abort` to `__builtin_trap`.

FWIW https://godbolt.org/z/khdC4E


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74091/new/

https://reviews.llvm.org/D74091





More information about the libc-commits mailing list