Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlegendecas <legendecas@gmail.com>2021-05-10 19:45:24 +0300
committerlegendecas <legendecas@gmail.com>2021-05-18 04:44:59 +0300
commitf536cc2e89092c60bddfc9953838aeab432da9b9 (patch)
tree404cdd7ed0b8805057fd26fb90a5f2b7c66278be /src
parent3b1a9936a8d193c7cb314f243fafea1ef7682738 (diff)
src: fix fatal errors when a current isolate not exist
napi_fatal_error and node watchdog trigger fatal error but rather running on a thread that hold no current isolate. PR-URL: https://github.com/nodejs/node/pull/38624 Reviewed-By: Michael Dawson <midawson@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_errors.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc
index ab8b513ccee..47b13f61495 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -425,6 +425,12 @@ void OnFatalError(const char* location, const char* message) {
}
Isolate* isolate = Isolate::GetCurrent();
+ // TODO(legendecas): investigate failures on triggering node-report with
+ // nullptr isolates.
+ if (isolate == nullptr) {
+ fflush(stderr);
+ ABORT();
+ }
Environment* env = Environment::GetCurrent(isolate);
bool report_on_fatalerror;
{