diff options
author | Thurston Dang <thurston@google.com> | 2024-07-11 08:25:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-11 08:25:41 -0700 |
commit | bbb90feb8742b4a83c4bbfbbbdf0f9735939d184 (patch) | |
tree | afdba8cff9d766f32b2935b09f2e3fa448037153 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | |
parent | c0261351136e4a826be697e5ebb5fa638abe7485 (diff) | |
download | llvm-bbb90feb8742b4a83c4bbfbbbdf0f9735939d184.zip llvm-bbb90feb8742b4a83c4bbfbbbdf0f9735939d184.tar.gz llvm-bbb90feb8742b4a83c4bbfbbbdf0f9735939d184.tar.bz2 |
[tsan] Fix ASLR edge case, and improve diagnostics (#97125)
In extremely rare cases (estimated 1 in 3 million), minor allocations
that happen after the memory layout was checked in
InitializePlatformEarly() [1] may result in the memory layout
unexpectedly being incompatible in InitializePlatform(). We fix this by
adding another memory layout check (and opportunity to re-exec without
ASLR) in InitializePlatform().
To improve future debuggability, this patch also dumps the process map
if the memory layout is unexpectedly incompatible.
[1]
```
__sanitizer::InitializePlatformEarly();
__tsan::InitializePlatformEarly();
#if !SANITIZER_GO
InitializeAllocator(); // <-- ~8MB mmap'ed
ReplaceSystemMalloc();
#endif
if (common_flags()->detect_deadlocks)
ctx->dd = DDetector::Create(flags()); // <-- ~4MB mmap'ed
Processor *proc = ProcCreate(); // <-- ~1MB mmap'ed
ProcWire(proc, thr);
InitializeInterceptors(); <-- ~3MB mmap'ed
InitializePlatform();
```
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
0 files changed, 0 insertions, 0 deletions