Joe McDonnell has uploaded this change for review. ( 
https://gerrit.cloudera.org/25431


Change subject: IMPALA-15764: Patch breakpad to merge mappings separated by 
alignment gaps
......................................................................

IMPALA-15764: Patch breakpad to merge mappings separated by alignment gaps

Minidumps from Redhat 9 ARM binaries linked with mold could not be
symbolized. minidump_stackwalk showed two modules for impalad
(0x200000-0x3af6fff and 0x3b06000-0x883ffff), and most frames were
unresolved or resolved to the wrong function.

mold (like lld) emits separate PT_LOAD segments for read-only data and
code. On aarch64 the segments are aligned to the 64KB max page size,
even when the kernel uses 4KB pages, so /proc/<pid>/maps has an
unmapped hole between them:
  00200000-03af7000 r--p 00000000 ... impalad
  03b06000-08840000 r-xp 038f6000 ... impalad
LinuxDumper::EnumerateMappings() only merges mappings of the same file
into one module if they are exactly adjacent, so it created two
modules. dump_syms produces one module relative to the first segment,
so the symbol lookups used the wrong base. This does not happen on
x86_64, where the max page size is 4KB and the segments are adjacent,
or with gold, which puts everything in a single R E segment.

This patch allows a gap of less than 2MB between the mappings being
merged. The other conditions (same name, same or compatible exec flag)
are unchanged. /proc/<pid>/maps is sorted by address, so nothing else
can be mapped in the gap.

Testing:
 - On Redhat 9.8 aarch64, linked impalad with mold and the patched
   libbreakpad_client.a, sent SIGUSR1 to produce a minidump, and
   resolved it with minidump_stackwalk. impalad is a single module and
   all impalad frames are symbolized. Without the patch, the same
   binary produces two modules.

Change-Id: Ifb1f4e155cf5921b911b9977d9da103c7e266470
Assisted-by: Claude Sonnet 5.5 (Claude Code)
---
M buildall.sh
A 
source/breakpad/breakpad-2c736308b5a4c7a8371fa3a3e434f551eddd17c9-patches/0003-Merge-mappings-separated-by-segment-alignment-gaps.patch
2 files changed, 28 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.cloudera.org:29418/native-toolchain 
refs/changes/31/25431/1
--
To view, visit https://gerrit.cloudera.org/25431
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: native-toolchain
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb1f4e155cf5921b911b9977d9da103c7e266470
Gerrit-Change-Number: 25431
Gerrit-PatchSet: 1
Gerrit-Owner: Joe McDonnell <[email protected]>

Reply via email to