[compiler-rt] [sanitizer_symbolizer] Use correct format strings for uptr (PR #89815)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 24 13:46:52 PDT 2024
================
@@ -118,8 +119,11 @@ static void RenderMmaps(InternalScopedString *buffer,
// module.base_address == dlpi_addr
// range.beg == dlpi_addr + p_vaddr
// relative address == p_vaddr == range.beg - module.base_address
- buffer->AppendF(kFormatMmap, range.beg, range.end - range.beg, moduleId,
- accessBuffer.data(), range.beg - module.base_address());
+ buffer->AppendF(
+ kFormatMmap, reinterpret_cast<void *>(range.beg),
+ static_cast<unsigned int>(range.end - range.beg),
----------------
vitalybuka wrote:
it's unlucky sanitizer convension, but uptr is equivalend to size_t.
`static_cast<unsigned int>(range.end - range.beg),` is uptr so size format `%z` should be used
So can you try to "{{{mmap:%p:0x%zx:load:%zu:%s:0x%zx}}}";
https://github.com/llvm/llvm-project/pull/89815
More information about the llvm-commits
mailing list