llvm-project/lldb/source/Plugins/ObjectFile/PECOFF
Greg Clayton 736888c84b Avoid crashing by not mmap'ing files on network mounted file systems.
This is implemented by making a new FileSystem function:

bool
FileSystem::IsLocal(const FileSpec &spec)

Then using this in a new function:

DataBufferSP
FileSpec::MemoryMapFileContentsIfLocal(off_t file_offset, size_t file_size) const;

This function only mmaps data if the file is a local file since that means we can reliably page in data. We were experiencing crashes where people would use debug info files on network mounted file systems and that mount would go away and cause the next access to a page that wasn't paged in to crash LLDB. 

We now avoid this by just copying the data into a heap buffer and keeping a permanent copy to avoid the crash. Updated all previous users of FileSpec::MemoryMapFileContentsIfLocal() in ObjectFile subclasses over to use the new FileSpec::MemoryMapFileContentsIfLocal() function.

<rdar://problem/19470249>

llvm-svn: 230283
2015-02-23 23:47:09 +00:00
..
CMakeLists.txt Convert to UNIX line endings. 2013-09-25 10:37:32 +00:00
Makefile Added a missing file from a previous checkin. 2011-10-11 20:23:29 +00:00
ObjectFilePECOFF.cpp Avoid crashing by not mmap'ing files on network mounted file systems. 2015-02-23 23:47:09 +00:00
ObjectFilePECOFF.h Silence a warning saying "typedef requires a name" from clang. 2014-07-29 23:23:58 +00:00