Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: enable stack trace printing for V8 check failures #31079

Closed
wants to merge 1 commit into from

Conversation

addaleax
Copy link
Member

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)
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

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)
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Dec 24, 2019
@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 24, 2019
@nodejs-github-bot
Copy link
Collaborator

@richardlau
Copy link
Member

Fwiw it doesn’t appear to be printing a stack trace on AIX: https://ci.nodejs.org/job/node-stress-single-test/34/nodes=aix61-ppc64/console

@addaleax
Copy link
Member Author

Fwiw it doesn’t appear to be printing a stack trace on AIX: https://ci.nodejs.org/job/node-stress-single-test/34/nodes=aix61-ppc64/console

We don’t support stack traces for Node.js assertion failures there either, unfortunately:

node/src/debug_utils.cc

Lines 9 to 13 in e23bf8f

#if defined(__linux__) && !defined(__GLIBC__) || \
defined(__UCLIBC__) || \
defined(_AIX)
#define HAVE_EXECINFO_H 0
#else

Copy link
Contributor

@antsmartian antsmartian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, can't we add test cases for this one? At least few assertions?

@addaleax
Copy link
Member Author

@antsmartian I’m not sure, most V8 (D)CHECKs should not be reachable by us ideally… and fwiw, we already have tests for the Node.js variant that verifies that DumpBacktrace() works for our own assertions

@nodejs-github-bot
Copy link
Collaborator

@addaleax
Copy link
Member Author

Landed in 341c4da

@addaleax addaleax closed this Dec 27, 2019
addaleax added a commit that referenced this pull request Dec 27, 2019
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>
@addaleax addaleax deleted the platform-stack-trace branch December 27, 2019 01:14
BridgeAR pushed a commit that referenced this pull request Jan 3, 2020
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>
@BridgeAR BridgeAR mentioned this pull request Jan 7, 2020
targos pushed a commit that referenced this pull request Jan 14, 2020
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>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
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>
@MylesBorins MylesBorins mentioned this pull request Feb 8, 2020
@addaleax addaleax added the v8 platform Issues and PRs related to Node's v8::Platform implementation. label Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. v8 platform Issues and PRs related to Node's v8::Platform implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.