[libcxx-commits] [PATCH] D154140: [libc++] Add .fuzz.cpp tests and move the fuzzing tests to the normal locations

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 10 08:48:13 PDT 2023


ldionne added a comment.

Pretty much LGTM after applying feedback.



================
Comment at: libcxx/utils/ci/run-buildbot:342
 ;;
 #
 # Various build configurations
----------------
Let's add `- "**/crash-"` to the artifacts paths in `buildkite-pipeline.yml`. Also we probably want to use a different crash file pattern like `libcxx-fuzz-crash-XXXXXXXXXXXXXXXXX` if that's possible.


================
Comment at: libcxx/utils/libcxx/test/dsl.py:208
 
+def compileAndRunSucceeds(config, program, args=None, additional_build_args=None):
+    try:
----------------
ldionne wrote:
> This also means you're missing tests for this function.
Let's add a docstring explaining what this does.


================
Comment at: libcxx/utils/libcxx/test/dsl.py:208-213
+def compileAndRunSucceeds(config, program, args=None, additional_build_args=None):
+    try:
+        runSucceeds(config, program, args, additional_build_args)
+    except ConfigurationCompilationError:
+        return False
+    return True
----------------
This also means you're missing tests for this function.


================
Comment at: libcxx/utils/libcxx/test/format.py:379
+                "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} %{link_flags} -fsanitize=fuzzer -o %t.exe",
+                "%dbg(EXECUTED AS) %{exec} %t.exe -max_total_time=10",
+            ]
----------------
Let's also add a timeout for each function to execute, that way we won't blow up if calling e.g. `std::regex` with some crazy input leads to an infinite loop.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154140



More information about the libcxx-commits mailing list