Displaying 3 results from an estimated 3 matches for "mapped_file_region".
2016 Nov 17
3
UB in MemoryBufferMMapFile
...fferMMapFile we mmap `Len` bytes and then call this with
`BufEnd = Start + Len`:
from lib/Support/MemoryBuffer.cpp:210:
> MemoryBufferMMapFile(bool RequiresNullTerminator, int FD, uint64_t Len,
> uint64_t Offset, std::error_code &EC)
> : MFR(FD, sys::fs::mapped_file_region::readonly,
> getLegalMapSize(Len, Offset), getLegalMapOffset(Offset), EC) {
> if (!EC) {
> const char *Start = getStart(Len, Offset);
> init(Start, Start + Len, RequiresNullTerminator);
> }
> }
This is UB, since we're reading one past an allo...
2017 Nov 09
10
Experiment on how to improve our temporary file handing.
Currently a power failure or other hard crash can cause lld leave a temporary
file around. The same is true for other llvm tools.
As an example, put a breakpoint in Writer.cpp:236 ("writeBuildId()") and
restart the run a few times. You will get
t.tmp43a735a t.tmp4deeabb t.tmp9bacdd3 t.tmpe4115c4 t.tmpeb01fff
The same would happen if there was a fatal error between the
2016 Nov 17
2
UB in MemoryBufferMMapFile
...his with
>> `BufEnd = Start + Len`:
>>
>> from lib/Support/MemoryBuffer.cpp:210:
>>> MemoryBufferMMapFile(bool RequiresNullTerminator, int FD, uint64_t Len,
>>> uint64_t Offset, std::error_code &EC)
>>> : MFR(FD, sys::fs::mapped_file_region::readonly,
>>> getLegalMapSize(Len, Offset), getLegalMapOffset(Offset), EC) {
>>> if (!EC) {
>>> const char *Start = getStart(Len, Offset);
>>> init(Start, Start + Len, RequiresNullTerminator);
>>> }
>>> }
>>
&...