mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
Use Dart_PrepareToAbort in segfault handlers for consistency.
Change-Id: Ie4c838c8f8b68b16a0bda2e8a59005bee6c1bf30 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111523 Reviewed-by: Samir Jindel <sjindel@google.com> Reviewed-by: Zach Anderson <zra@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
136aee0655
commit
ebc4a59b61
|
@ -33,6 +33,7 @@ static void segv_handler(int signal, siginfo_t* siginfo, void* context) {
|
|||
strsignal(siginfo->si_signo), siginfo->si_signo, siginfo->si_code,
|
||||
siginfo->si_addr);
|
||||
Dart_DumpNativeStackTrace(context);
|
||||
Dart_PrepareToAbort();
|
||||
abort();
|
||||
}
|
||||
|
||||
|
@ -156,6 +157,7 @@ const char* Platform::ResolveExecutablePath() {
|
|||
|
||||
void Platform::Exit(int exit_code) {
|
||||
Console::RestoreConfig();
|
||||
Dart_PrepareToAbort();
|
||||
exit(exit_code);
|
||||
}
|
||||
|
||||
|
|
|
@ -149,6 +149,7 @@ const char* Platform::ResolveExecutablePath() {
|
|||
|
||||
void Platform::Exit(int exit_code) {
|
||||
Console::RestoreConfig();
|
||||
Dart_PrepareToAbort();
|
||||
exit(exit_code);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ static void segv_handler(int signal, siginfo_t* siginfo, void* context) {
|
|||
strsignal(siginfo->si_signo), siginfo->si_signo, siginfo->si_code,
|
||||
siginfo->si_addr);
|
||||
Dart_DumpNativeStackTrace(context);
|
||||
Dart_PrepareToAbort();
|
||||
abort();
|
||||
}
|
||||
|
||||
|
@ -163,6 +164,7 @@ const char* Platform::ResolveExecutablePath() {
|
|||
|
||||
void Platform::Exit(int exit_code) {
|
||||
Console::RestoreConfig();
|
||||
Dart_PrepareToAbort();
|
||||
exit(exit_code);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ static void segv_handler(int signal, siginfo_t* siginfo, void* context) {
|
|||
strsignal(siginfo->si_signo), siginfo->si_signo, siginfo->si_code,
|
||||
siginfo->si_addr);
|
||||
Dart_DumpNativeStackTrace(context);
|
||||
Dart_PrepareToAbort();
|
||||
abort();
|
||||
}
|
||||
|
||||
|
@ -252,6 +253,7 @@ const char* Platform::ResolveExecutablePath() {
|
|||
|
||||
void Platform::Exit(int exit_code) {
|
||||
Console::RestoreConfig();
|
||||
Dart_PrepareToAbort();
|
||||
exit(exit_code);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
|
||||
|
||||
namespace dart {
|
||||
|
||||
// Defined in vm/os_thread_win.cc
|
||||
extern bool private_flag_windows_run_tls_destructors;
|
||||
|
||||
namespace bin {
|
||||
|
||||
const char* Platform::executable_name_ = NULL;
|
||||
|
@ -81,10 +77,9 @@ class PlatformWin {
|
|||
ExceptionInfo->ExceptionRecord->ExceptionAddress);
|
||||
Dart_DumpNativeStackTrace(ExceptionInfo->ContextRecord);
|
||||
Console::RestoreConfig();
|
||||
// TODO(zra): Remove once VM shuts down cleanly.
|
||||
::dart::private_flag_windows_run_tls_destructors = false;
|
||||
// Note: we want to abort(...) here instead of exiting because exiting
|
||||
// would not cause WER to generate a minidump.
|
||||
Dart_PrepareToAbort();
|
||||
abort();
|
||||
}
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
|
@ -291,12 +286,11 @@ const char* Platform::ResolveExecutablePath() {
|
|||
}
|
||||
|
||||
void Platform::Exit(int exit_code) {
|
||||
// TODO(zra): Remove once VM shuts down cleanly.
|
||||
::dart::private_flag_windows_run_tls_destructors = false;
|
||||
// Restore the console's output code page
|
||||
Console::RestoreConfig();
|
||||
// On Windows we use ExitProcess so that threads can't clobber the exit_code.
|
||||
// See: https://code.google.com/p/nativeclient/issues/detail?id=2870
|
||||
Dart_PrepareToAbort();
|
||||
::ExitProcess(exit_code);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,6 @@ extern const uint8_t kDartCoreIsolateSnapshotInstructions[];
|
|||
// TODO(iposva, asiva): This is a placeholder for the real unittest framework.
|
||||
namespace dart {
|
||||
|
||||
// Defined in vm/os_thread_win.cc
|
||||
extern bool private_flag_windows_run_tls_destructors;
|
||||
|
||||
// Snapshot pieces when we link in a snapshot.
|
||||
#if defined(DART_NO_SNAPSHOT)
|
||||
#error "run_vm_tests must be built with a snapshot"
|
||||
|
|
|
@ -344,6 +344,7 @@ void OS::Cleanup() {}
|
|||
void OS::PrepareToAbort() {}
|
||||
|
||||
void OS::Abort() {
|
||||
PrepareToAbort();
|
||||
abort();
|
||||
}
|
||||
|
||||
|
|
|
@ -285,6 +285,7 @@ void OS::Cleanup() {}
|
|||
void OS::PrepareToAbort() {}
|
||||
|
||||
void OS::Abort() {
|
||||
PrepareToAbort();
|
||||
abort();
|
||||
}
|
||||
|
||||
|
|
|
@ -665,6 +665,7 @@ void OS::Cleanup() {}
|
|||
void OS::PrepareToAbort() {}
|
||||
|
||||
void OS::Abort() {
|
||||
PrepareToAbort();
|
||||
abort();
|
||||
}
|
||||
|
||||
|
|
|
@ -325,6 +325,7 @@ void OS::Cleanup() {}
|
|||
void OS::PrepareToAbort() {}
|
||||
|
||||
void OS::Abort() {
|
||||
PrepareToAbort();
|
||||
abort();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue