[vm] Also print version information in assertion failures, not just faults.

Populate the dynamic symbol table for gen_snapshot.

Change-Id: Ib4712d2f481948f646ba4f5e353e0837b6391eab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95682
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2019-03-06 20:02:18 +00:00 committed by commit-bot@chromium.org
parent 0c231060f4
commit 68946df573
6 changed files with 23 additions and 15 deletions

View file

@ -179,6 +179,13 @@ template("build_gen_snapshot") {
]
}
if (!is_win) {
# Adds all symbols to the dynamic symbol table, not just used ones.
# This is needed to make native extensions work. It is also needed to get
# symbols in VM-generated backtraces and profiles.
ldflags = [ "-rdynamic" ]
}
if (is_win) {
libs = [
"iphlpapi.lib",
@ -730,7 +737,8 @@ template("dart_executable") {
ldflags = [ "/EXPORT:Dart_True" ]
} else {
# Adds all symbols to the dynamic symbol table, not just used ones.
# This is needed to make native extensions work.
# This is needed to make native extensions work. It is also needed to get
# symbols in VM-generated backtraces and profiles.
ldflags = [ "-rdynamic" ]
}
@ -943,6 +951,9 @@ executable("run_vm_tests") {
] + builtin_impl_tests + vm_tests + compiler_tests + heap_tests
if (!is_win) {
# Adds all symbols to the dynamic symbol table, not just used ones.
# This is needed to make native extensions work. It is also needed to get
# symbols in VM-generated backtraces and profiles.
ldflags = [ "-rdynamic" ]
}

View file

@ -28,10 +28,9 @@ char** Platform::argv_ = NULL;
static void segv_handler(int signal, siginfo_t* siginfo, void* context) {
Log::PrintErr(
"\n===== CRASH =====\n"
"version=%s\n"
"si_signo=%s(%d), si_code=%d, si_addr=%p\n",
Dart_VersionString(), strsignal(siginfo->si_signo), siginfo->si_signo,
siginfo->si_code, siginfo->si_addr);
strsignal(siginfo->si_signo), siginfo->si_signo, siginfo->si_code,
siginfo->si_addr);
Dart_DumpNativeStackTrace(context);
abort();
}

View file

@ -28,10 +28,9 @@ char** Platform::argv_ = NULL;
static void segv_handler(int signal, siginfo_t* siginfo, void* context) {
Log::PrintErr(
"\n===== CRASH =====\n"
"version=%s\n"
"si_signo=%s(%d), si_code=%d, si_addr=%p\n",
Dart_VersionString(), strsignal(siginfo->si_signo), siginfo->si_signo,
siginfo->si_code, siginfo->si_addr);
strsignal(siginfo->si_signo), siginfo->si_signo, siginfo->si_code,
siginfo->si_addr);
Dart_DumpNativeStackTrace(context);
abort();
}

View file

@ -36,10 +36,9 @@ char** Platform::argv_ = NULL;
static void segv_handler(int signal, siginfo_t* siginfo, void* context) {
Log::PrintErr(
"\n===== CRASH =====\n"
"version=%s\n"
"si_signo=%s(%d), si_code=%d, si_addr=%p\n",
Dart_VersionString(), strsignal(siginfo->si_signo), siginfo->si_signo,
siginfo->si_code, siginfo->si_addr);
strsignal(siginfo->si_signo), siginfo->si_signo, siginfo->si_code,
siginfo->si_addr);
Dart_DumpNativeStackTrace(context);
abort();
}

View file

@ -75,9 +75,8 @@ class PlatformWin {
EXCEPTION_ILLEGAL_INSTRUCTION)) {
Log::PrintErr(
"\n===== CRASH =====\n"
"version=%s\n"
"ExceptionCode=%d, ExceptionFlags=%d, ExceptionAddress=%p\n",
Dart_VersionString(), ExceptionInfo->ExceptionRecord->ExceptionCode,
ExceptionInfo->ExceptionRecord->ExceptionCode,
ExceptionInfo->ExceptionRecord->ExceptionFlags,
ExceptionInfo->ExceptionRecord->ExceptionAddress);
Dart_DumpNativeStackTrace(ExceptionInfo->ContextRecord);

View file

@ -23,6 +23,7 @@
#include "vm/signal_handler.h"
#include "vm/simulator.h"
#include "vm/stack_frame.h"
#include "vm/version.h"
namespace dart {
@ -1117,9 +1118,9 @@ void Profiler::DumpStackTrace(uword sp, uword fp, uword pc, bool for_crash) {
ASSERT(os_thread != NULL);
Isolate* isolate = Isolate::Current();
const char* name = isolate == NULL ? NULL : isolate->name();
OS::PrintErr("thread=%" Pd ", isolate=%s(%p)\n",
OSThread::ThreadIdToIntPtr(os_thread->trace_id()), name,
isolate);
OS::PrintErr(
"version=%s\nthread=%" Pd ", isolate=%s(%p)\n", Version::String(),
OSThread::ThreadIdToIntPtr(os_thread->trace_id()), name, isolate);
if (!InitialRegisterCheck(pc, fp, sp)) {
OS::PrintErr("Stack dump aborted because InitialRegisterCheck failed.\n");