aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorJoshua Peraza <jperaza@chromium.org>2019-06-11 11:48:14 -0700
committerJoshua Peraza <jperaza@chromium.org>2019-06-11 19:04:02 +0000
commitc2467077b93523c9ab2b8a7548145201dc891328 (patch)
tree190c20f1a8628593db1aac0065852189828a32bf /Makefile.am
parentlinux: fix broken tests (diff)
downloadbreakpad-c2467077b93523c9ab2b8a7548145201dc891328.tar.xz
Enable truncation of module ranges
ELF modules are loaded in memory in several, possibly discontiguous, segments. If the holes between segments are large enough, other things, possibly other ELF modules may be mapped in that space. Crashpad records the range of modules as the base address of the lowest mapped segment to the high address of the highest mapped segment. This means that when one module is mapped into a hole in another, it appears to the Breakpad processor as overlapping modules. Module ranges are relevant to the Breakpad processor during stackwalking for identifying which module a particular program counter belongs to (i.e. mapping the address to a module's text segment). This patch addresses this issue of overlapping modules by truncating the range of the module with the lower base address. A typical module's text segment is the first loaded segment which would leave the text segment range unaffected. Module producers can restrict the size of holes in their ELF modules with the flag "-Wl,-z,max-page-size=4096", preventing other modules from being mapped in their address range. Properly contemplating ELF module address ranges would require extensions to the minidump format to encode any holes. crbug.com/crashpad/298 This patch also renames the concept of "shrinking down" (which truncated the upper of two overlapping ranges) to "truncate upper". Change-Id: I4599201f1e43918db036c390961f8b39e3af1849 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1646932 Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am23
1 files changed, 17 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am
index 649db2f3..8d806473 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -389,7 +389,8 @@ check_PROGRAMS += \
src/processor/pathname_stripper_unittest \
src/processor/postfix_evaluator_unittest \
src/processor/proc_maps_linux_unittest \
- src/processor/range_map_shrink_down_unittest \
+ src/processor/range_map_truncate_lower_unittest \
+ src/processor/range_map_truncate_upper_unittest \
src/processor/range_map_unittest \
src/processor/stackwalker_amd64_unittest \
src/processor/stackwalker_arm_unittest \
@@ -1049,14 +1050,24 @@ src_processor_postfix_evaluator_unittest_LDADD = \
src/processor/pathname_stripper.o \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_range_map_shrink_down_unittest_SOURCES = \
- src/processor/range_map_shrink_down_unittest.cc
-src_processor_range_map_shrink_down_unittest_LDADD = \
- src/processor/logging.o \
+src_processor_range_map_truncate_lower_unittest_SOURCES = \
+ src/processor/range_map_truncate_lower_unittest.cc
+src_processor_range_map_truncate_lower_unittest_LDADD = \
+ src/processor/logging.o \
+ src/processor/pathname_stripper.o \
+ $(TEST_LIBS) \
+ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+src_processor_range_map_truncate_lower_unittest_CPPFLAGS = \
+ $(AM_CPPFLAGS) $(TEST_CFLAGS)
+
+src_processor_range_map_truncate_upper_unittest_SOURCES = \
+ src/processor/range_map_truncate_upper_unittest.cc
+src_processor_range_map_truncate_upper_unittest_LDADD = \
+ src/processor/logging.o \
src/processor/pathname_stripper.o \
$(TEST_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_range_map_shrink_down_unittest_CPPFLAGS = \
+src_processor_range_map_truncate_upper_unittest_CPPFLAGS = \
$(AM_CPPFLAGS) $(TEST_CFLAGS)
src_processor_range_map_unittest_SOURCES = \