[PATCH] D20943: [LibFuzzer] Declare and use sanitizer functions in `fuzzer::ExternalFunctions`

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 11:18:45 PDT 2016


kcc added inline comments.

================
Comment at: lib/Fuzzer/FuzzerExtFunctions.h:21
@@ +20,3 @@
+  // Initialize function pointers. Functions that are not available will be set
+  // to nullptr.  Do not call this constructor  before ``main()`` has been
+  // entered.
----------------
Why you can't call this before main()? 
Just curious.

================
Comment at: lib/Fuzzer/test/FuzzerUnittest.cpp:430
@@ +429,3 @@
+  // Make sure we free to avoid LSan firing.
+  std::unique_ptr<ExternalFunctions> t(new ExternalFunctions());
+  fuzzer::EF = t.get();
----------------
Are you sure you need to do that? 
Have you seen an lsan report of you don't?


When you do 
  global_var = new ... 
there is no leak from lsan POV because the memory is reachable. 


http://reviews.llvm.org/D20943





More information about the llvm-commits mailing list