Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cb35097

Browse filesBrowse files
addaleaxtargos
authored andcommitted
src: enable stack trace printing for V8 check failures
Example output: $ ./node --expose-gc test/addons/buffer-free-callback/test.js # # Fatal error in , line 0 # Check failed: result.second. # # # #FailureMessage Object: 0x7ffebd956860 1: 0x56290a45b105 [./node] 2: 0x56290b305b77 V8_Fatal(char const*, ...) [./node] 3: 0x56290a82702d v8::internal::GlobalBackingStoreRegistry::Register(std::shared_ptr<v8::internal::BackingStore>) [./node] 4: 0x56290a59a1de v8::ArrayBuffer::GetBackingStore() [./node] 5: 0x56290a3cb63f node::Buffer::New(node::Environment*, char*, unsigned long, void (*)(char*, void*), void*) [./node] 6: 0x56290a3cbcdc node::Buffer::New(v8::Isolate*, char*, unsigned long, void (*)(char*, void*), void*) [./node] 7: 0x7fdeabdfdf89 Alloc(v8::FunctionCallbackInfo<v8::Value> const&) [/home/xxxx/src/node/master/test/addons/buffer-free-callback/build/Release/binding.node] 8: 0x56290a5ca077 [./node] 9: 0x56290a5cbf97 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [./node] 10: 0x56290ad99539 [./node] Illegal instruction (core dumped) PR-URL: #31079 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 8407086 commit cb35097
Copy full SHA for cb35097

File tree

Expand file treeCollapse file tree

2 files changed

+10
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-0
lines changed
Open diff view settings
Collapse file

‎src/node_platform.cc‎

Copy file name to clipboardExpand all lines: src/node_platform.cc
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,14 @@ TracingController* NodePlatform::GetTracingController() {
485485
return tracing_controller_;
486486
}
487487

488+
Platform::StackTracePrinter NodePlatform::GetStackTracePrinter() {
489+
return []() {
490+
fprintf(stderr, "\n");
491+
DumpBacktrace(stderr);
492+
fflush(stderr);
493+
};
494+
}
495+
488496
template <class T>
489497
TaskQueue<T>::TaskQueue()
490498
: lock_(), tasks_available_(), tasks_drained_(),
Collapse file

‎src/node_platform.h‎

Copy file name to clipboardExpand all lines: src/node_platform.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ class NodePlatform : public MultiIsolatePlatform {
169169
std::shared_ptr<v8::TaskRunner> GetForegroundTaskRunner(
170170
v8::Isolate* isolate) override;
171171

172+
Platform::StackTracePrinter GetStackTracePrinter() override;
173+
172174
private:
173175
std::shared_ptr<PerIsolatePlatformData> ForIsolate(v8::Isolate* isolate);
174176

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.