From 5dedb808acf84712daf7dee3cf8137d4e34b4b78 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Wed, 17 Jun 2015 00:08:02 +0100 Subject: [PATCH] Add more logging output for dlopen. Investigation of build bot failure which I can not reproduce locally. Bug: 21854739 Change-Id: I4584bb10ad44e4bcf8232c060e40b36ff924ffa2 --- runtime/gc/heap.cc | 1 + runtime/oat_file.cc | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 14fa74072..0cdd3c3e8 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -503,6 +503,7 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max bool no_gap = MemMap::CheckNoGaps(GetImageSpace()->GetMemMap(), non_moving_space_->GetMemMap()); if (!no_gap) { + PrintFileToLog("/proc/self/maps", LogSeverity::ERROR); MemMap::DumpMaps(LOG(ERROR), true); LOG(FATAL) << "There's a gap between the image space and the non-moving space"; } diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc index 55a2fbb00..e426eb310 100644 --- a/runtime/oat_file.cc +++ b/runtime/oat_file.cc @@ -286,16 +286,22 @@ bool OatFile::Dlopen(const std::string& elf_filename, uint8_t* requested_base, if (info->dlpi_phdr[i].p_type == PT_LOAD) { auto vaddr = reinterpret_cast(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr); MemMap::MapDummy(info->dlpi_name, vaddr, info->dlpi_phdr[i].p_memsz); + context->found = true; } } } return 0; } std::string so_name; - } context; - context.so_name = elf_filename; + bool found; + } context = { elf_filename, false }; dl_iterate_phdr(dl_iterate_context::callback, &context); + if (!context.found) { + PrintFileToLog("/proc/self/maps", LogSeverity::WARNING); + LOG(ERROR) << "File " << elf_filename << " loaded with dlopen but can not find its mmaps."; + } + return Setup(abs_dex_location, error_msg); #endif // __APPLE__ } -- 2.11.0