[PATCH] D63671: [llvm-profdata] Avoid keeping reference to every files

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 11:54:23 PDT 2019


wmi added a comment.

>From my last reply "I assumed the input files are small since we want to have small testcase. If the input files are small, the buffer won't be allocated through mmap but through new (From getOpenFileImpl in lib/Support/MemoryBuffer.cpp)".

Do you think we can construct a testcase with small inputs so the buffer could be writable?

> Plus, we munmap the file when we destroy the object at the end of the loop, so accessing again the data would result in a segfault already...

If that is the case, why you didn't see SEGV when you remove the code to replace string reference from file data buffer to FunctionNames set for call targets? I think munmap area could possibly be remapped when reading in the next file?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63671





More information about the llvm-commits mailing list