[PATCH] D58622: [libFuzzer] fix missing close on opened file

Paul Chaignon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 25 07:25:11 PST 2019


pchaigno created this revision.
pchaigno added a reviewer: kcc.
Herald added projects: LLVM, Sanitizers.
Herald added a subscriber: Sanitizers.

When running the standalone main on a large corpus, I eventually get a
EMFILE error ("Too many open files").


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D58622

Files:
  lib/fuzzer/standalone/StandaloneFuzzTargetMain.c


Index: lib/fuzzer/standalone/StandaloneFuzzTargetMain.c
===================================================================
--- lib/fuzzer/standalone/StandaloneFuzzTargetMain.c
+++ lib/fuzzer/standalone/StandaloneFuzzTargetMain.c
@@ -35,6 +35,7 @@
     assert(n_read == len);
     LLVMFuzzerTestOneInput(buf, len);
     free(buf);
+    fclose(f);
     fprintf(stderr, "Done:    %s: (%zd bytes)\n", argv[i], n_read);
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58622.188152.patch
Type: text/x-patch
Size: 424 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190225/723587cd/attachment.bin>


More information about the llvm-commits mailing list