2012-06-07 01:25:03 +02:00
|
|
|
/*
|
2013-12-12 21:21:20 +01:00
|
|
|
* Copyright (C) 2012-2014 The Android Open Source Project
|
2012-06-07 01:25:03 +02:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2014-06-10 20:53:08 +02:00
|
|
|
#define LOG_TAG "DEBUG"
|
|
|
|
|
2017-08-29 22:08:32 +02:00
|
|
|
#include "libdebuggerd/tombstone.h"
|
|
|
|
|
2013-12-18 17:44:24 +01:00
|
|
|
#include <dirent.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <signal.h>
|
2012-06-07 01:25:03 +02:00
|
|
|
#include <stddef.h>
|
2013-12-18 17:44:24 +01:00
|
|
|
#include <stdio.h>
|
2012-06-07 01:25:03 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/ptrace.h>
|
|
|
|
#include <sys/stat.h>
|
2016-09-29 00:54:45 +02:00
|
|
|
#include <time.h>
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2015-05-16 02:30:21 +02:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
|
2017-03-16 07:23:22 +01:00
|
|
|
#include <android-base/file.h>
|
2017-08-21 23:31:17 +02:00
|
|
|
#include <android-base/logging.h>
|
2017-10-10 22:30:57 +02:00
|
|
|
#include <android-base/properties.h>
|
2015-12-05 07:00:26 +01:00
|
|
|
#include <android-base/stringprintf.h>
|
2017-08-21 23:31:17 +02:00
|
|
|
#include <android-base/strings.h>
|
2017-03-16 07:23:22 +01:00
|
|
|
#include <android-base/unique_fd.h>
|
|
|
|
#include <android/log.h>
|
2016-09-29 00:54:45 +02:00
|
|
|
#include <backtrace/Backtrace.h>
|
|
|
|
#include <backtrace/BacktraceMap.h>
|
2016-10-17 23:28:00 +02:00
|
|
|
#include <log/log.h>
|
2014-05-14 21:37:22 +02:00
|
|
|
#include <log/logprint.h>
|
2016-09-29 00:54:45 +02:00
|
|
|
#include <private/android_filesystem_config.h>
|
2017-08-21 23:31:17 +02:00
|
|
|
#include <unwindstack/Memory.h>
|
|
|
|
#include <unwindstack/Regs.h>
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2017-08-29 22:08:32 +02:00
|
|
|
// Needed to get DEBUGGER_SIGNAL.
|
2016-10-19 03:17:52 +02:00
|
|
|
#include "debuggerd/handler.h"
|
2012-07-19 15:38:06 +02:00
|
|
|
|
2017-08-29 22:08:32 +02:00
|
|
|
#include "libdebuggerd/backtrace.h"
|
|
|
|
#include "libdebuggerd/elf_utils.h"
|
|
|
|
#include "libdebuggerd/open_files_list.h"
|
2017-08-21 23:31:17 +02:00
|
|
|
#include "libdebuggerd/utility.h"
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2017-10-10 22:30:57 +02:00
|
|
|
using android::base::GetBoolProperty;
|
|
|
|
using android::base::GetProperty;
|
2017-02-02 01:59:15 +01:00
|
|
|
using android::base::StringPrintf;
|
2017-08-21 23:31:17 +02:00
|
|
|
using android::base::unique_fd;
|
2017-02-02 01:59:15 +01:00
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
using unwindstack::Memory;
|
|
|
|
using unwindstack::Regs;
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2018-02-15 18:18:21 +01:00
|
|
|
using namespace std::literals::string_literals;
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
#define STACK_WORDS 16
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2014-06-03 00:02:20 +02:00
|
|
|
static void dump_header_info(log_t* log) {
|
2017-10-10 22:30:57 +02:00
|
|
|
auto fingerprint = GetProperty("ro.build.fingerprint", "unknown");
|
|
|
|
auto revision = GetProperty("ro.revision", "unknown");
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2017-10-10 22:30:57 +02:00
|
|
|
_LOG(log, logtype::HEADER, "Build fingerprint: '%s'\n", fingerprint.c_str());
|
|
|
|
_LOG(log, logtype::HEADER, "Revision: '%s'\n", revision.c_str());
|
2014-06-10 20:53:08 +02:00
|
|
|
_LOG(log, logtype::HEADER, "ABI: '%s'\n", ABI_STRING);
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
static void dump_probable_cause(log_t* log, const siginfo_t* si) {
|
2017-02-02 01:59:15 +01:00
|
|
|
std::string cause;
|
2017-08-21 23:31:17 +02:00
|
|
|
if (si->si_signo == SIGSEGV && si->si_code == SEGV_MAPERR) {
|
|
|
|
if (si->si_addr < reinterpret_cast<void*>(4096)) {
|
2017-02-02 01:59:15 +01:00
|
|
|
cause = StringPrintf("null pointer dereference");
|
2017-08-21 23:31:17 +02:00
|
|
|
} else if (si->si_addr == reinterpret_cast<void*>(0xffff0ffc)) {
|
2017-02-02 01:59:15 +01:00
|
|
|
cause = "call to kuser_helper_version";
|
2017-08-21 23:31:17 +02:00
|
|
|
} else if (si->si_addr == reinterpret_cast<void*>(0xffff0fe0)) {
|
2017-02-02 01:59:15 +01:00
|
|
|
cause = "call to kuser_get_tls";
|
2017-08-21 23:31:17 +02:00
|
|
|
} else if (si->si_addr == reinterpret_cast<void*>(0xffff0fc0)) {
|
2017-02-02 01:59:15 +01:00
|
|
|
cause = "call to kuser_cmpxchg";
|
2017-08-21 23:31:17 +02:00
|
|
|
} else if (si->si_addr == reinterpret_cast<void*>(0xffff0fa0)) {
|
2017-02-02 01:59:15 +01:00
|
|
|
cause = "call to kuser_memory_barrier";
|
2017-08-21 23:31:17 +02:00
|
|
|
} else if (si->si_addr == reinterpret_cast<void*>(0xffff0f60)) {
|
2017-02-02 01:59:15 +01:00
|
|
|
cause = "call to kuser_cmpxchg64";
|
|
|
|
}
|
2017-08-21 23:31:17 +02:00
|
|
|
} else if (si->si_signo == SIGSYS && si->si_code == SYS_SECCOMP) {
|
|
|
|
cause = StringPrintf("seccomp prevented call to disallowed %s system call %d", ABI_STRING,
|
|
|
|
si->si_syscall);
|
2017-02-02 01:59:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!cause.empty()) _LOG(log, logtype::HEADER, "Cause: %s\n", cause.c_str());
|
|
|
|
}
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
static void dump_signal_info(log_t* log, const siginfo_t* si) {
|
2014-04-26 01:05:34 +02:00
|
|
|
char addr_desc[32]; // ", fault addr 0x1234"
|
2017-08-21 23:31:17 +02:00
|
|
|
if (signal_has_si_addr(si->si_signo, si->si_code)) {
|
|
|
|
snprintf(addr_desc, sizeof(addr_desc), "%p", si->si_addr);
|
2014-01-11 01:33:16 +01:00
|
|
|
} else {
|
2014-04-26 01:05:34 +02:00
|
|
|
snprintf(addr_desc, sizeof(addr_desc), "--------");
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2014-04-26 01:05:34 +02:00
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
_LOG(log, logtype::HEADER, "signal %d (%s), code %d (%s), fault addr %s\n", si->si_signo,
|
|
|
|
get_signame(si->si_signo), si->si_code, get_sigcode(si->si_signo, si->si_code), addr_desc);
|
2017-02-02 01:59:15 +01:00
|
|
|
|
|
|
|
dump_probable_cause(log, si);
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
static void dump_thread_info(log_t* log, const ThreadInfo& thread_info) {
|
2014-07-25 21:25:48 +02:00
|
|
|
// Blacklist logd, logd.reader, logd.writer, logd.auditd, logd.control ...
|
2017-03-16 07:23:22 +01:00
|
|
|
// TODO: Why is this controlled by thread name?
|
2017-08-21 23:31:17 +02:00
|
|
|
if (thread_info.thread_name == "logd" ||
|
|
|
|
android::base::StartsWith(thread_info.thread_name, "logd.")) {
|
2014-07-25 21:25:48 +02:00
|
|
|
log->should_retrieve_logcat = false;
|
|
|
|
}
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
_LOG(log, logtype::HEADER, "pid: %d, tid: %d, name: %s >>> %s <<<\n", thread_info.pid,
|
|
|
|
thread_info.tid, thread_info.thread_name.c_str(), thread_info.process_name.c_str());
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
static void dump_stack_segment(log_t* log, BacktraceMap* backtrace_map, Memory* process_memory,
|
2018-01-18 20:15:49 +01:00
|
|
|
uint64_t* sp, size_t words, int label) {
|
2015-02-27 22:39:47 +01:00
|
|
|
// Read the data all at once.
|
|
|
|
word_t stack_data[words];
|
2017-08-21 23:31:17 +02:00
|
|
|
|
|
|
|
// TODO: Do we need to word align this for crashes caused by a misaligned sp?
|
|
|
|
// The process_vm_readv implementation of Memory should handle this appropriately?
|
|
|
|
size_t bytes_read = process_memory->Read(*sp, stack_data, sizeof(word_t) * words);
|
2015-02-27 22:39:47 +01:00
|
|
|
words = bytes_read / sizeof(word_t);
|
|
|
|
std::string line;
|
2014-01-11 01:33:16 +01:00
|
|
|
for (size_t i = 0; i < words; i++) {
|
2015-02-27 22:39:47 +01:00
|
|
|
line = " ";
|
|
|
|
if (i == 0 && label >= 0) {
|
|
|
|
// Print the label once.
|
2017-02-02 01:59:15 +01:00
|
|
|
line += StringPrintf("#%02d ", label);
|
2015-02-27 22:39:47 +01:00
|
|
|
} else {
|
|
|
|
line += " ";
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2018-01-20 09:59:11 +01:00
|
|
|
line += StringPrintf("%" PRIPTR " %" PRIPTR, *sp, static_cast<uint64_t>(stack_data[i]));
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2015-02-06 22:22:01 +01:00
|
|
|
backtrace_map_t map;
|
2017-08-21 23:31:17 +02:00
|
|
|
backtrace_map->FillIn(stack_data[i], &map);
|
2018-02-15 18:18:21 +01:00
|
|
|
std::string map_name{map.Name()};
|
|
|
|
if (BacktraceMap::IsValid(map) && !map_name.empty()) {
|
|
|
|
line += " " + map_name;
|
2018-01-18 20:15:49 +01:00
|
|
|
uint64_t offset = 0;
|
2017-08-21 23:31:17 +02:00
|
|
|
std::string func_name = backtrace_map->GetFunctionName(stack_data[i], &offset);
|
2015-02-27 22:39:47 +01:00
|
|
|
if (!func_name.empty()) {
|
|
|
|
line += " (" + func_name;
|
2014-01-11 01:33:16 +01:00
|
|
|
if (offset) {
|
2018-01-18 20:15:49 +01:00
|
|
|
line += StringPrintf("+%" PRIu64, offset);
|
2013-10-02 21:26:48 +02:00
|
|
|
}
|
2015-02-27 22:39:47 +01:00
|
|
|
line += ')';
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
2015-02-27 22:39:47 +01:00
|
|
|
_LOG(log, logtype::STACK, "%s\n", line.c_str());
|
2014-01-11 01:33:16 +01:00
|
|
|
|
2013-11-21 20:17:20 +01:00
|
|
|
*sp += sizeof(word_t);
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
static void dump_stack(log_t* log, BacktraceMap* backtrace_map, Memory* process_memory,
|
|
|
|
std::vector<backtrace_frame_data_t>& frames) {
|
2014-01-11 01:33:16 +01:00
|
|
|
size_t first = 0, last;
|
2017-08-21 23:31:17 +02:00
|
|
|
for (size_t i = 0; i < frames.size(); i++) {
|
|
|
|
const backtrace_frame_data_t& frame = frames[i];
|
|
|
|
if (frame.sp) {
|
2014-01-11 01:33:16 +01:00
|
|
|
if (!first) {
|
|
|
|
first = i+1;
|
|
|
|
}
|
|
|
|
last = i;
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2017-08-21 23:31:17 +02:00
|
|
|
|
2014-01-11 01:33:16 +01:00
|
|
|
if (!first) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
first--;
|
|
|
|
|
|
|
|
// Dump a few words before the first frame.
|
2018-01-18 20:15:49 +01:00
|
|
|
uint64_t sp = frames[first].sp - STACK_WORDS * sizeof(word_t);
|
2017-08-21 23:31:17 +02:00
|
|
|
dump_stack_segment(log, backtrace_map, process_memory, &sp, STACK_WORDS, -1);
|
2014-01-11 01:33:16 +01:00
|
|
|
|
|
|
|
// Dump a few words from all successive frames.
|
|
|
|
// Only log the first 3 frames, put the rest in the tombstone.
|
|
|
|
for (size_t i = first; i <= last; i++) {
|
2017-08-21 23:31:17 +02:00
|
|
|
const backtrace_frame_data_t* frame = &frames[i];
|
2014-01-11 01:33:16 +01:00
|
|
|
if (sp != frame->sp) {
|
2014-06-10 20:53:08 +02:00
|
|
|
_LOG(log, logtype::STACK, " ........ ........\n");
|
2014-01-11 01:33:16 +01:00
|
|
|
sp = frame->sp;
|
|
|
|
}
|
|
|
|
if (i == last) {
|
2017-08-21 23:31:17 +02:00
|
|
|
dump_stack_segment(log, backtrace_map, process_memory, &sp, STACK_WORDS, i);
|
2014-01-11 01:33:16 +01:00
|
|
|
if (sp < frame->sp + frame->stack_size) {
|
2014-06-10 20:53:08 +02:00
|
|
|
_LOG(log, logtype::STACK, " ........ ........\n");
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
|
|
|
} else {
|
2013-11-21 20:17:20 +01:00
|
|
|
size_t words = frame->stack_size / sizeof(word_t);
|
2014-01-11 01:33:16 +01:00
|
|
|
if (words == 0) {
|
|
|
|
words = 1;
|
|
|
|
} else if (words > STACK_WORDS) {
|
|
|
|
words = STACK_WORDS;
|
|
|
|
}
|
2017-08-21 23:31:17 +02:00
|
|
|
dump_stack_segment(log, backtrace_map, process_memory, &sp, words, i);
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
|
|
|
|
2018-01-18 20:15:49 +01:00
|
|
|
static std::string get_addr_string(uint64_t addr) {
|
2015-06-02 23:52:44 +02:00
|
|
|
std::string addr_str;
|
|
|
|
#if defined(__LP64__)
|
2017-02-02 01:59:15 +01:00
|
|
|
addr_str = StringPrintf("%08x'%08x",
|
|
|
|
static_cast<uint32_t>(addr >> 32),
|
|
|
|
static_cast<uint32_t>(addr & 0xffffffff));
|
2015-06-02 23:52:44 +02:00
|
|
|
#else
|
2018-01-18 20:15:49 +01:00
|
|
|
addr_str = StringPrintf("%08x", static_cast<uint32_t>(addr));
|
2015-06-02 23:52:44 +02:00
|
|
|
#endif
|
|
|
|
return addr_str;
|
|
|
|
}
|
|
|
|
|
2018-01-18 20:15:49 +01:00
|
|
|
static void dump_abort_message(log_t* log, Memory* process_memory, uint64_t address) {
|
2016-01-14 02:57:14 +01:00
|
|
|
if (address == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
size_t length;
|
|
|
|
if (!process_memory->ReadFully(address, &length, sizeof(length))) {
|
|
|
|
_LOG(log, logtype::HEADER, "Failed to read abort message header: %s\n", strerror(errno));
|
|
|
|
return;
|
|
|
|
}
|
2016-01-14 02:57:14 +01:00
|
|
|
|
2018-02-13 22:16:17 +01:00
|
|
|
// The length field includes the length of the length field itself.
|
|
|
|
if (length < sizeof(size_t)) {
|
|
|
|
_LOG(log, logtype::HEADER, "Abort message header malformed: claimed length = %zd\n", length);
|
2017-08-21 23:31:17 +02:00
|
|
|
return;
|
|
|
|
}
|
2016-01-14 02:57:14 +01:00
|
|
|
|
2018-02-13 22:16:17 +01:00
|
|
|
length -= sizeof(size_t);
|
|
|
|
|
2018-04-21 02:31:53 +02:00
|
|
|
// The abort message should be null terminated already, but reserve a spot for NUL just in case.
|
|
|
|
std::vector<char> msg(length + 1);
|
2018-02-13 22:16:17 +01:00
|
|
|
if (!process_memory->ReadFully(address + sizeof(length), &msg[0], length)) {
|
2017-08-21 23:31:17 +02:00
|
|
|
_LOG(log, logtype::HEADER, "Failed to read abort message: %s\n", strerror(errno));
|
|
|
|
return;
|
2016-01-14 02:57:14 +01:00
|
|
|
}
|
|
|
|
|
2018-02-13 22:16:17 +01:00
|
|
|
_LOG(log, logtype::HEADER, "Abort message: '%s'\n", &msg[0]);
|
2016-01-14 02:57:14 +01:00
|
|
|
}
|
|
|
|
|
2018-01-18 20:15:49 +01:00
|
|
|
static void dump_all_maps(log_t* log, BacktraceMap* map, Memory* process_memory, uint64_t addr) {
|
2017-08-21 23:31:17 +02:00
|
|
|
bool print_fault_address_marker = addr;
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2016-06-16 00:49:50 +02:00
|
|
|
ScopedBacktraceMapIteratorLock lock(map);
|
2017-09-26 20:54:49 +02:00
|
|
|
_LOG(log, logtype::MAPS,
|
|
|
|
"\n"
|
2017-09-27 22:59:42 +02:00
|
|
|
"memory map (%zu entr%s):",
|
|
|
|
map->size(), map->size() == 1 ? "y" : "ies");
|
2017-09-26 20:54:49 +02:00
|
|
|
if (print_fault_address_marker) {
|
2017-12-02 06:37:37 +01:00
|
|
|
if (map->begin() != map->end() && addr < (*map->begin())->start) {
|
2017-09-27 22:59:42 +02:00
|
|
|
_LOG(log, logtype::MAPS, "\n--->Fault address falls at %s before any mapped regions\n",
|
2015-06-02 23:52:44 +02:00
|
|
|
get_addr_string(addr).c_str());
|
2015-02-27 22:39:47 +01:00
|
|
|
print_fault_address_marker = false;
|
2017-09-26 20:54:49 +02:00
|
|
|
} else {
|
2017-09-27 22:59:42 +02:00
|
|
|
_LOG(log, logtype::MAPS, " (fault address prefixed with --->)\n");
|
2015-02-27 22:39:47 +01:00
|
|
|
}
|
2017-09-27 22:59:42 +02:00
|
|
|
} else {
|
|
|
|
_LOG(log, logtype::MAPS, "\n");
|
2014-07-07 21:33:50 +02:00
|
|
|
}
|
2014-01-11 01:33:16 +01:00
|
|
|
|
2015-02-27 22:39:47 +01:00
|
|
|
std::string line;
|
2017-12-02 06:37:37 +01:00
|
|
|
for (auto it = map->begin(); it != map->end(); ++it) {
|
|
|
|
const backtrace_map_t* entry = *it;
|
2015-02-27 22:39:47 +01:00
|
|
|
line = " ";
|
|
|
|
if (print_fault_address_marker) {
|
2017-12-02 06:37:37 +01:00
|
|
|
if (addr < entry->start) {
|
2015-06-02 23:52:44 +02:00
|
|
|
_LOG(log, logtype::MAPS, "--->Fault address falls at %s between mapped regions\n",
|
|
|
|
get_addr_string(addr).c_str());
|
2015-02-27 22:39:47 +01:00
|
|
|
print_fault_address_marker = false;
|
2017-12-02 06:37:37 +01:00
|
|
|
} else if (addr >= entry->start && addr < entry->end) {
|
2015-02-27 22:39:47 +01:00
|
|
|
line = "--->";
|
|
|
|
print_fault_address_marker = false;
|
|
|
|
}
|
|
|
|
}
|
2017-12-02 06:37:37 +01:00
|
|
|
line += get_addr_string(entry->start) + '-' + get_addr_string(entry->end - 1) + ' ';
|
|
|
|
if (entry->flags & PROT_READ) {
|
2015-02-27 22:39:47 +01:00
|
|
|
line += 'r';
|
|
|
|
} else {
|
|
|
|
line += '-';
|
|
|
|
}
|
2017-12-02 06:37:37 +01:00
|
|
|
if (entry->flags & PROT_WRITE) {
|
2015-02-27 22:39:47 +01:00
|
|
|
line += 'w';
|
|
|
|
} else {
|
|
|
|
line += '-';
|
|
|
|
}
|
2017-12-02 06:37:37 +01:00
|
|
|
if (entry->flags & PROT_EXEC) {
|
2015-02-27 22:39:47 +01:00
|
|
|
line += 'x';
|
|
|
|
} else {
|
|
|
|
line += '-';
|
|
|
|
}
|
2018-01-18 20:15:49 +01:00
|
|
|
line += StringPrintf(" %8" PRIx64 " %8" PRIx64, entry->offset, entry->end - entry->start);
|
2015-06-02 23:52:44 +02:00
|
|
|
bool space_needed = true;
|
2017-12-02 06:37:37 +01:00
|
|
|
if (entry->name.length() > 0) {
|
2015-06-02 23:52:44 +02:00
|
|
|
space_needed = false;
|
2017-12-02 06:37:37 +01:00
|
|
|
line += " " + entry->name;
|
2015-02-27 22:39:47 +01:00
|
|
|
std::string build_id;
|
2017-08-21 23:31:17 +02:00
|
|
|
if ((entry->flags & PROT_READ) && elf_get_build_id(process_memory, entry->start, &build_id)) {
|
2015-02-27 22:39:47 +01:00
|
|
|
line += " (BuildId: " + build_id + ")";
|
|
|
|
}
|
2014-06-20 01:47:59 +02:00
|
|
|
}
|
2017-12-02 06:37:37 +01:00
|
|
|
if (entry->load_bias != 0) {
|
2015-06-02 23:52:44 +02:00
|
|
|
if (space_needed) {
|
|
|
|
line += ' ';
|
|
|
|
}
|
2018-01-18 20:15:49 +01:00
|
|
|
line += StringPrintf(" (load bias 0x%" PRIx64 ")", entry->load_bias);
|
2015-05-02 00:02:03 +02:00
|
|
|
}
|
2015-02-27 22:39:47 +01:00
|
|
|
_LOG(log, logtype::MAPS, "%s\n", line.c_str());
|
2014-06-20 01:47:59 +02:00
|
|
|
}
|
2015-02-27 22:39:47 +01:00
|
|
|
if (print_fault_address_marker) {
|
2015-06-02 23:52:44 +02:00
|
|
|
_LOG(log, logtype::MAPS, "--->Fault address falls at %s after any mapped regions\n",
|
|
|
|
get_addr_string(addr).c_str());
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
void dump_backtrace(log_t* log, std::vector<backtrace_frame_data_t>& frames, const char* prefix) {
|
|
|
|
for (auto& frame : frames) {
|
|
|
|
_LOG(log, logtype::BACKTRACE, "%s%s\n", prefix, Backtrace::FormatFrameData(&frame).c_str());
|
|
|
|
}
|
|
|
|
}
|
2014-06-10 20:53:08 +02:00
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
static void print_register_row(log_t* log,
|
|
|
|
const std::vector<std::pair<std::string, uint64_t>>& registers) {
|
|
|
|
std::string output;
|
|
|
|
for (auto& [name, value] : registers) {
|
2018-01-18 20:15:49 +01:00
|
|
|
output += android::base::StringPrintf(" %-3s %0*" PRIx64, name.c_str(),
|
2017-08-21 23:31:17 +02:00
|
|
|
static_cast<int>(2 * sizeof(void*)),
|
2018-01-18 20:15:49 +01:00
|
|
|
static_cast<uint64_t>(value));
|
2015-02-10 02:06:27 +01:00
|
|
|
}
|
2017-08-21 23:31:17 +02:00
|
|
|
|
|
|
|
_LOG(log, logtype::REGISTERS, " %s\n", output.c_str());
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
void dump_registers(log_t* log, Regs* regs) {
|
|
|
|
// Split lr/sp/pc into their own special row.
|
|
|
|
static constexpr size_t column_count = 4;
|
|
|
|
std::vector<std::pair<std::string, uint64_t>> current_row;
|
|
|
|
std::vector<std::pair<std::string, uint64_t>> special_row;
|
|
|
|
|
|
|
|
#if defined(__arm__) || defined(__aarch64__)
|
|
|
|
static constexpr const char* special_registers[] = {"ip", "lr", "sp", "pc"};
|
|
|
|
#elif defined(__i386__)
|
|
|
|
static constexpr const char* special_registers[] = {"ebp", "esp", "eip"};
|
|
|
|
#elif defined(__x86_64__)
|
|
|
|
static constexpr const char* special_registers[] = {"rbp", "rsp", "rip"};
|
|
|
|
#else
|
|
|
|
static constexpr const char* special_registers[] = {};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
regs->IterateRegisters([log, ¤t_row, &special_row](const char* name, uint64_t value) {
|
|
|
|
auto row = ¤t_row;
|
|
|
|
for (const char* special_name : special_registers) {
|
|
|
|
if (strcmp(special_name, name) == 0) {
|
|
|
|
row = &special_row;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
row->emplace_back(name, value);
|
|
|
|
if (current_row.size() == column_count) {
|
|
|
|
print_register_row(log, current_row);
|
|
|
|
current_row.clear();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!current_row.empty()) {
|
|
|
|
print_register_row(log, current_row);
|
|
|
|
}
|
|
|
|
|
|
|
|
print_register_row(log, special_row);
|
2017-05-06 03:11:23 +02:00
|
|
|
}
|
|
|
|
|
2018-02-15 18:18:21 +01:00
|
|
|
void dump_memory_and_code(log_t* log, BacktraceMap* map, Memory* memory, Regs* regs) {
|
|
|
|
regs->IterateRegisters([log, map, memory](const char* reg_name, uint64_t reg_value) {
|
|
|
|
std::string label{"memory near "s + reg_name};
|
|
|
|
if (map) {
|
|
|
|
backtrace_map_t map_info;
|
|
|
|
map->FillIn(reg_value, &map_info);
|
|
|
|
std::string map_name{map_info.Name()};
|
|
|
|
if (!map_name.empty()) label += " (" + map_info.Name() + ")";
|
|
|
|
}
|
|
|
|
dump_memory(log, memory, reg_value, label);
|
2017-08-21 23:31:17 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool dump_thread(log_t* log, BacktraceMap* map, Memory* process_memory,
|
2018-01-18 20:15:49 +01:00
|
|
|
const ThreadInfo& thread_info, uint64_t abort_msg_address,
|
2017-08-21 23:31:17 +02:00
|
|
|
bool primary_thread) {
|
|
|
|
UNUSED(process_memory);
|
|
|
|
log->current_tid = thread_info.tid;
|
2016-01-14 02:57:14 +01:00
|
|
|
if (!primary_thread) {
|
2014-06-10 20:53:08 +02:00
|
|
|
_LOG(log, logtype::THREAD, "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n");
|
2016-01-14 02:57:14 +01:00
|
|
|
}
|
2017-08-21 23:31:17 +02:00
|
|
|
dump_thread_info(log, thread_info);
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
if (thread_info.siginfo) {
|
|
|
|
dump_signal_info(log, thread_info.siginfo);
|
2016-01-14 02:57:14 +01:00
|
|
|
}
|
2017-08-21 23:31:17 +02:00
|
|
|
|
2017-12-22 23:18:39 +01:00
|
|
|
if (primary_thread) {
|
|
|
|
dump_abort_message(log, process_memory, abort_msg_address);
|
|
|
|
}
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
dump_registers(log, thread_info.registers.get());
|
|
|
|
|
2018-04-20 21:04:41 +02:00
|
|
|
// Unwind will mutate the registers, so make a copy first.
|
|
|
|
std::unique_ptr<Regs> regs_copy(thread_info.registers->Clone());
|
2017-08-21 23:31:17 +02:00
|
|
|
std::vector<backtrace_frame_data_t> frames;
|
2018-04-20 21:04:41 +02:00
|
|
|
if (!Backtrace::Unwind(regs_copy.get(), map, &frames, 0, nullptr)) {
|
2017-08-21 23:31:17 +02:00
|
|
|
_LOG(log, logtype::THREAD, "Failed to unwind");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!frames.empty()) {
|
|
|
|
_LOG(log, logtype::BACKTRACE, "\nbacktrace:\n");
|
|
|
|
dump_backtrace(log, frames, " ");
|
|
|
|
|
|
|
|
_LOG(log, logtype::STACK, "\nstack:\n");
|
|
|
|
dump_stack(log, map, process_memory, frames);
|
|
|
|
}
|
|
|
|
|
2016-01-14 02:57:14 +01:00
|
|
|
if (primary_thread) {
|
2018-02-15 18:18:21 +01:00
|
|
|
dump_memory_and_code(log, map, process_memory, thread_info.registers.get());
|
2016-01-14 02:57:14 +01:00
|
|
|
if (map) {
|
2018-01-18 20:15:49 +01:00
|
|
|
uint64_t addr = 0;
|
2017-08-21 23:31:17 +02:00
|
|
|
siginfo_t* si = thread_info.siginfo;
|
|
|
|
if (signal_has_si_addr(si->si_signo, si->si_code)) {
|
2018-01-18 20:15:49 +01:00
|
|
|
addr = reinterpret_cast<uint64_t>(si->si_addr);
|
2017-08-21 23:31:17 +02:00
|
|
|
}
|
|
|
|
dump_all_maps(log, map, process_memory, addr);
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2016-01-14 02:57:14 +01:00
|
|
|
log->current_tid = log->crashed_tid;
|
2017-08-21 23:31:17 +02:00
|
|
|
return true;
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
|
|
|
|
2014-01-11 01:33:16 +01:00
|
|
|
// Reads the contents of the specified log device, filters out the entries
|
|
|
|
// that don't match the specified pid, and writes them to the tombstone file.
|
|
|
|
//
|
2014-06-28 00:55:19 +02:00
|
|
|
// If "tail" is non-zero, log the last "tail" number of lines.
|
2014-05-14 21:37:22 +02:00
|
|
|
static EventTagMap* g_eventTagMap = NULL;
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
static void dump_log_file(log_t* log, pid_t pid, const char* filename, unsigned int tail) {
|
2014-01-11 01:33:16 +01:00
|
|
|
bool first = true;
|
2014-06-28 00:55:19 +02:00
|
|
|
struct logger_list* logger_list;
|
2014-01-11 01:33:16 +01:00
|
|
|
|
2014-07-25 21:25:48 +02:00
|
|
|
if (!log->should_retrieve_logcat) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-11-22 19:53:34 +01:00
|
|
|
logger_list = android_logger_list_open(
|
2015-01-26 19:46:44 +01:00
|
|
|
android_name_to_log_id(filename), ANDROID_LOG_RDONLY | ANDROID_LOG_NONBLOCK, tail, pid);
|
2014-01-11 01:33:16 +01:00
|
|
|
|
2013-11-22 19:53:34 +01:00
|
|
|
if (!logger_list) {
|
2014-06-18 23:17:57 +02:00
|
|
|
ALOGE("Unable to open %s: %s\n", filename, strerror(errno));
|
2014-01-11 01:33:16 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-11-22 19:53:34 +01:00
|
|
|
struct log_msg log_entry;
|
2014-01-11 01:33:16 +01:00
|
|
|
|
|
|
|
while (true) {
|
2013-11-22 19:53:34 +01:00
|
|
|
ssize_t actual = android_logger_list_read(logger_list, &log_entry);
|
2014-06-28 00:55:19 +02:00
|
|
|
struct logger_entry* entry;
|
2013-11-22 19:53:34 +01:00
|
|
|
|
2014-01-11 01:33:16 +01:00
|
|
|
if (actual < 0) {
|
2013-11-22 19:53:34 +01:00
|
|
|
if (actual == -EINTR) {
|
2014-01-11 01:33:16 +01:00
|
|
|
// interrupted by signal, retry
|
|
|
|
continue;
|
2013-11-22 19:53:34 +01:00
|
|
|
} else if (actual == -EAGAIN) {
|
2014-01-11 01:33:16 +01:00
|
|
|
// non-blocking EOF; we're done
|
|
|
|
break;
|
|
|
|
} else {
|
2015-06-18 03:35:59 +02:00
|
|
|
ALOGE("Error while reading log: %s\n", strerror(-actual));
|
2014-01-11 01:33:16 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else if (actual == 0) {
|
2015-06-18 03:35:59 +02:00
|
|
|
ALOGE("Got zero bytes while reading log: %s\n", strerror(errno));
|
2014-01-11 01:33:16 +01:00
|
|
|
break;
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
|
|
|
|
2014-06-18 23:17:57 +02:00
|
|
|
// NOTE: if you ALOGV something here, this will spin forever,
|
2014-01-11 01:33:16 +01:00
|
|
|
// because you will be writing as fast as you're reading. Any
|
|
|
|
// high-frequency debug diagnostics should just be written to
|
|
|
|
// the tombstone file.
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2014-06-28 00:55:19 +02:00
|
|
|
entry = &log_entry.entry_v1;
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2014-01-11 01:33:16 +01:00
|
|
|
if (first) {
|
2014-06-27 19:32:22 +02:00
|
|
|
_LOG(log, logtype::LOGS, "--------- %slog %s\n",
|
2013-11-22 19:53:34 +01:00
|
|
|
tail ? "tail end of " : "", filename);
|
2014-01-11 01:33:16 +01:00
|
|
|
first = false;
|
|
|
|
}
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2014-01-11 01:33:16 +01:00
|
|
|
// Msg format is: <priority:1><tag:N>\0<message:N>\0
|
|
|
|
//
|
|
|
|
// We want to display it in the same format as "logcat -v threadtime"
|
|
|
|
// (although in this case the pid is redundant).
|
|
|
|
static const char* kPrioChars = "!.VDIWEFS";
|
2013-11-22 19:53:34 +01:00
|
|
|
unsigned hdr_size = log_entry.entry.hdr_size;
|
|
|
|
if (!hdr_size) {
|
|
|
|
hdr_size = sizeof(log_entry.entry_v1);
|
|
|
|
}
|
2016-08-18 23:59:41 +02:00
|
|
|
if ((hdr_size < sizeof(log_entry.entry_v1)) ||
|
|
|
|
(hdr_size > sizeof(log_entry.entry))) {
|
|
|
|
continue;
|
|
|
|
}
|
2014-05-14 21:37:22 +02:00
|
|
|
char* msg = reinterpret_cast<char*>(log_entry.buf) + hdr_size;
|
|
|
|
|
|
|
|
char timeBuf[32];
|
|
|
|
time_t sec = static_cast<time_t>(entry->sec);
|
|
|
|
struct tm tmBuf;
|
|
|
|
struct tm* ptm;
|
|
|
|
ptm = localtime_r(&sec, &tmBuf);
|
|
|
|
strftime(timeBuf, sizeof(timeBuf), "%m-%d %H:%M:%S", ptm);
|
|
|
|
|
|
|
|
if (log_entry.id() == LOG_ID_EVENTS) {
|
|
|
|
if (!g_eventTagMap) {
|
2016-11-11 18:48:56 +01:00
|
|
|
g_eventTagMap = android_openEventTagMap(NULL);
|
2014-05-14 21:37:22 +02:00
|
|
|
}
|
|
|
|
AndroidLogEntry e;
|
|
|
|
char buf[512];
|
|
|
|
android_log_processBinaryLogBuffer(entry, &e, g_eventTagMap, buf, sizeof(buf));
|
2016-10-24 22:11:46 +02:00
|
|
|
_LOG(log, logtype::LOGS, "%s.%03d %5d %5d %c %-8.*s: %s\n",
|
2014-05-14 21:37:22 +02:00
|
|
|
timeBuf, entry->nsec / 1000000, entry->pid, entry->tid,
|
2016-10-24 22:11:46 +02:00
|
|
|
'I', (int)e.tagLen, e.tag, e.message);
|
2014-05-14 21:37:22 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2013-11-22 19:53:34 +01:00
|
|
|
unsigned char prio = msg[0];
|
|
|
|
char* tag = msg + 1;
|
|
|
|
msg = tag + strlen(tag) + 1;
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2014-01-11 01:33:16 +01:00
|
|
|
// consume any trailing newlines
|
2013-12-12 21:21:20 +01:00
|
|
|
char* nl = msg + strlen(msg) - 1;
|
|
|
|
while (nl >= msg && *nl == '\n') {
|
2014-06-28 00:55:19 +02:00
|
|
|
*nl-- = '\0';
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2014-01-11 01:33:16 +01:00
|
|
|
char prioChar = (prio < strlen(kPrioChars) ? kPrioChars[prio] : '?');
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2013-12-12 21:21:20 +01:00
|
|
|
// Look for line breaks ('\n') and display each text line
|
|
|
|
// on a separate line, prefixed with the header, like logcat does.
|
|
|
|
do {
|
|
|
|
nl = strchr(msg, '\n');
|
|
|
|
if (nl) {
|
|
|
|
*nl = '\0';
|
|
|
|
++nl;
|
|
|
|
}
|
|
|
|
|
2014-06-10 20:53:08 +02:00
|
|
|
_LOG(log, logtype::LOGS, "%s.%03d %5d %5d %c %-8s: %s\n",
|
2013-12-12 21:21:20 +01:00
|
|
|
timeBuf, entry->nsec / 1000000, entry->pid, entry->tid,
|
|
|
|
prioChar, tag, msg);
|
|
|
|
} while ((msg = nl));
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2013-11-22 19:53:34 +01:00
|
|
|
android_logger_list_free(logger_list);
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
|
|
|
|
2014-01-11 01:33:16 +01:00
|
|
|
// Dumps the logs generated by the specified pid to the tombstone, from both
|
|
|
|
// "system" and "main" log devices. Ideally we'd interleave the output.
|
2014-06-28 00:55:19 +02:00
|
|
|
static void dump_logs(log_t* log, pid_t pid, unsigned int tail) {
|
2017-08-21 23:31:17 +02:00
|
|
|
if (pid == getpid()) {
|
|
|
|
// Cowardly refuse to dump logs while we're running in-process.
|
|
|
|
return;
|
2014-01-11 01:33:16 +01:00
|
|
|
}
|
2012-06-07 01:25:03 +02:00
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
dump_log_file(log, pid, "system", tail);
|
|
|
|
dump_log_file(log, pid, "main", tail);
|
2012-06-07 01:25:03 +02:00
|
|
|
}
|
2017-02-09 01:06:26 +01:00
|
|
|
|
2018-01-18 20:15:49 +01:00
|
|
|
void engrave_tombstone_ucontext(int tombstone_fd, uint64_t abort_msg_address, siginfo_t* siginfo,
|
2017-03-02 02:23:22 +01:00
|
|
|
ucontext_t* ucontext) {
|
|
|
|
pid_t pid = getpid();
|
|
|
|
pid_t tid = gettid();
|
|
|
|
|
2017-02-09 01:06:26 +01:00
|
|
|
log_t log;
|
|
|
|
log.current_tid = tid;
|
|
|
|
log.crashed_tid = tid;
|
|
|
|
log.tfd = tombstone_fd;
|
|
|
|
log.amfd_data = nullptr;
|
|
|
|
|
2017-03-16 07:23:22 +01:00
|
|
|
char thread_name[16];
|
|
|
|
char process_name[128];
|
|
|
|
|
|
|
|
read_with_default("/proc/self/comm", thread_name, sizeof(thread_name), "<unknown>");
|
|
|
|
read_with_default("/proc/self/cmdline", process_name, sizeof(process_name), "<unknown>");
|
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
std::unique_ptr<Regs> regs(Regs::CreateFromUcontext(Regs::CurrentArch(), ucontext));
|
|
|
|
|
|
|
|
std::map<pid_t, ThreadInfo> threads;
|
|
|
|
threads[gettid()] = ThreadInfo{
|
|
|
|
.registers = std::move(regs),
|
|
|
|
.tid = tid,
|
|
|
|
.thread_name = thread_name,
|
|
|
|
.pid = pid,
|
|
|
|
.process_name = process_name,
|
|
|
|
.siginfo = siginfo,
|
|
|
|
};
|
|
|
|
|
|
|
|
std::unique_ptr<BacktraceMap> backtrace_map(BacktraceMap::Create(getpid(), false));
|
|
|
|
if (!backtrace_map) {
|
|
|
|
ALOGE("failed to create backtrace map");
|
|
|
|
_exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<Memory> process_memory = backtrace_map->GetProcessMemory();
|
|
|
|
engrave_tombstone(unique_fd(dup(tombstone_fd)), backtrace_map.get(), process_memory.get(),
|
|
|
|
threads, tid, abort_msg_address, nullptr, nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void engrave_tombstone(unique_fd output_fd, BacktraceMap* map, Memory* process_memory,
|
|
|
|
const std::map<pid_t, ThreadInfo>& threads, pid_t target_thread,
|
2018-01-18 20:15:49 +01:00
|
|
|
uint64_t abort_msg_address, OpenFilesList* open_files,
|
2017-08-21 23:31:17 +02:00
|
|
|
std::string* amfd_data) {
|
|
|
|
// don't copy log messages to tombstone unless this is a dev device
|
|
|
|
bool want_logs = android::base::GetBoolProperty("ro.debuggable", false);
|
|
|
|
|
|
|
|
log_t log;
|
|
|
|
log.current_tid = target_thread;
|
|
|
|
log.crashed_tid = target_thread;
|
|
|
|
log.tfd = output_fd.get();
|
|
|
|
log.amfd_data = amfd_data;
|
|
|
|
|
2017-05-08 21:59:17 +02:00
|
|
|
_LOG(&log, logtype::HEADER, "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n");
|
|
|
|
dump_header_info(&log);
|
2017-02-09 01:06:26 +01:00
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
auto it = threads.find(target_thread);
|
|
|
|
if (it == threads.end()) {
|
|
|
|
LOG(FATAL) << "failed to find target thread";
|
|
|
|
}
|
|
|
|
dump_thread(&log, map, process_memory, it->second, abort_msg_address, true);
|
2017-05-06 03:11:23 +02:00
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
if (want_logs) {
|
2017-04-20 11:22:06 +02:00
|
|
|
dump_logs(&log, it->second.pid, 50);
|
2017-02-09 01:06:26 +01:00
|
|
|
}
|
2017-09-14 00:33:39 +02:00
|
|
|
|
2017-08-21 23:31:17 +02:00
|
|
|
for (auto& [tid, thread_info] : threads) {
|
|
|
|
if (tid == target_thread) {
|
|
|
|
continue;
|
2017-09-14 00:33:39 +02:00
|
|
|
}
|
2017-08-21 23:31:17 +02:00
|
|
|
|
|
|
|
dump_thread(&log, map, process_memory, thread_info, 0, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (open_files) {
|
|
|
|
_LOG(&log, logtype::OPEN_FILES, "\nopen files:\n");
|
|
|
|
dump_open_files_list(&log, *open_files, " ");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (want_logs) {
|
|
|
|
dump_logs(&log, it->second.pid, 0);
|
2017-09-14 00:33:39 +02:00
|
|
|
}
|
2017-02-09 01:06:26 +01:00
|
|
|
}
|