FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: print backtrace on fatal error by bnoordhuis · Pull Request #6734 · nodejs/node · GitHub

/ node Public

src: print backtrace on fatal error - #6734

Merged
bnoordhuis merged 8 commits into
nodejs:masterfrom
bnoordhuis:print-backtrace-on-fatal-error
Jun 29, 2016
Merged

src: print backtrace on fatal error#6734
bnoordhuis merged 8 commits into
nodejs:masterfrom
bnoordhuis:print-backtrace-on-fatal-error

Conversation

bnoordhuis commented May 13, 2016
edited
Loading

Copy link
Copy Markdown
Member

Print a C backtrace on fatal errors to make it easier to debug issues
like #6727.

CI: https://ci.nodejs.org/job/node-test-pull-request/2629/

bnoordhuis added the lib / src Issues and PRs related to general changes in the lib or src directory. label May 13, 2016
nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label May 13, 2016
Comment thread src/backtrace.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

#include "src/base/logging.h" works too, at least locally for me. Any particular reason for including the source file itself?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

And CI is failing on smartos with ld: fatal: symbol 'v8::base::DumpBacktrace()' is multiply-defined: https://ci.nodejs.org/job/node-test-commit-smartos/2478/nodes=smartos14-32/console

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I included the .cc so it works with shared V8 builds (think Fedora, Debian, Ubuntu, etc.,or linking against a .so.)

I'll ifdef out smartos. That user base is a rounding error compared to the aforementioned distros.

Copy link
Copy Markdown
Member Author

Copy link
Copy Markdown
Member

LGTM if CI is green

Copy link
Copy Markdown
Contributor

Oh my gosh, +1000

Copy link
Copy Markdown
Contributor

Looks like plinux doesn't like it.

In file included from ../deps/v8/src/base/logging.h:12:0,
                 from ../deps/v8/src/base/logging.cc:5,
                 from ../src/backtrace.cc:7:
../deps/v8/src/base/build_config.h:102:2: error: #error Target architecture was not detected as supported by v8
 #error Target architecture was not detected as supported by v8
  ^
../deps/v8/src/base/build_config.h:140:2: error: #error Unknown target architecture pointer size
 #error Unknown target architecture pointer size
  ^
../deps/v8/src/base/build_config.h:202:2: error: #error Unknown target architecture endianness
 #error Unknown target architecture endianness
  ^
make[2]: *** [/home/iojs/build/workspace/node-test-commit-plinux/nodes/ppcbe-ubuntu1404/out/Release/obj.target/node/src/backtrace.o] Error 1

cjihrig commented May 13, 2016

Copy link
Copy Markdown
Contributor

LGTM, but yea, was just about to say what @Fishrock123 did.

Copy link
Copy Markdown
Contributor

/cc @mhdawson re plinux error

bnoordhuis force-pushed the print-backtrace-on-fatal-error branch from 887c8cb to 9c63535 Compare May 13, 2016 16:55

Copy link
Copy Markdown
Member Author

Different approach that should work on all platforms: https://ci.nodejs.org/job/node-test-pull-request/2637/

Copy link
Copy Markdown
Contributor

@bnoordhuis Looks like that failed on smartos:

../src/backtrace_posix.cc
../src/backtrace_posix.cc: In function 'void node::DumpBacktrace(std::FILE*)':
../src/backtrace_posix.cc:20:47: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
     const bool have_info = dladdr(frame, &info);
                                               ^
In file included from ../src/backtrace_posix.cc:4:0:
/usr/include/dlfcn.h:115:12: error:   initializing argument 1 of 'int dladdr(void*, Dl_info*)' [-fpermissive]
 extern int dladdr(void *, Dl_info *);
            ^
node.target.mk:186: recipe for target '/home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-32/out/Release/obj.target/node/src/backtrace_posix.o' failed

Copy link
Copy Markdown
Member Author

God, smartos is like a time machine back to the '90s. Okay, loosened the const-ness. CI: https://ci.nodejs.org/job/node-test-pull-request/2638/

Copy link
Copy Markdown
Contributor

@bnoordhuis smartos still 🚒

Copy link
Copy Markdown
Member Author

Looks like something went wrong. Again: https://ci.nodejs.org/job/node-test-pull-request/2639/

Copy link
Copy Markdown
Member Author

Finally, green except for flaky parallel/test-debug-port-cluster on freebsd.

cjihrig commented May 16, 2016

Copy link
Copy Markdown
Contributor

Works on my machine. This might be a silly question, but does the CI actually exercise this at all?

Copy link
Copy Markdown
Member Author

Not intentionally, I don't think. I thought about adding a test but it would be rather anti-social when core dumps are enabled.

cjihrig commented May 16, 2016

Copy link
Copy Markdown
Contributor

@bnoordhuis I added a minimal test in cjihrig@3ce55fa. The abort tests aren't run anywhere (that I know of, but it would be nice to have at least something that can test it. Thoughts?

bnoordhuis force-pushed the print-backtrace-on-fatal-error branch from 4ab11e0 to f15eb7b Compare May 19, 2016 10:14

Copy link
Copy Markdown
Member Author

@cjihrig Thanks, added to the PR. Anyone wants to take one more quick look?

Copy link
Copy Markdown
Member

I guess the test should be skipped on Windows? Other than that still LGTM.

Comment thread test/abort/test-abort-backtrace.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Eh, the RE should probably start with ^\s* and end with $, otherwise the optional parts here are pointless

bnoordhuis force-pushed the print-backtrace-on-fatal-error branch from f15eb7b to e52e6d2 Compare May 23, 2016 10:57

Copy link
Copy Markdown
Member Author

Updated the test, PTAL. CI: https://ci.nodejs.org/job/node-test-pull-request/2741/

Copy link
Copy Markdown
Member

LGTM if CI is green

cjihrig commented May 23, 2016

Copy link
Copy Markdown
Contributor

LGTM. Seems to be an issue with the CI though.

cjihrig commented May 31, 2016

Copy link
Copy Markdown
Contributor

Fishrock123 pushed a commit that referenced this pull request Jul 5, 2016
`python tools/test.py abort` won't work without one.

PR-URL: #6734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Jul 5, 2016
The --abort-on-uncaught-exception can terminate the process with either
a SIGABRT or a SIGILL signal but the test only expected SIGABRT.

PR-URL: #6734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Jul 5, 2016
There is no real need and it causes endless grief on Windows with some
of the upcoming changes.

PR-URL: #6734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Jul 5, 2016
Print a C backtrace on fatal errors to make it easier to debug issues
like #6727.

PR-URL: #6734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Jul 5, 2016
Print a C backtrace on fatal errors to make it easier to debug issues.

PR-URL: #6734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Jul 5, 2016
This commit adds a test that validates backtraces which are
printed on fatal errors.

PR-URL: #6734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Fishrock123 pushed a commit that referenced this pull request Jul 5, 2016
Don't inline calls to node::DumpBacktrace() and fflush(), it makes the
generated code bigger.  A secondary benefit of moving it to a function
is that it gives you something to put a breakpoint on.

PR-URL: #6734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Jul 5, 2016
Print a C backtrace on fatal errors to make it easier to debug issues.

PR-URL: #6734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fishrock123 mentioned this pull request Jul 5, 2016

Copy link
Copy Markdown
Contributor

@bnoordhuis should this be backported?

Copy link
Copy Markdown
Member Author

Ideally, yes.

Copy link
Copy Markdown
Contributor

due to the AIX + compiler failures I'm going to hold off on this change for the v4.5.0 release

@bnoordhuis would you be willing to backport this PR along with #7508, #7544, and any other potential commits that need to land with this?

Copy link
Copy Markdown
Contributor

ping @bnoordhuis sorry about the other message. Would you be willing to backport a working version of this as mentioned above

gibfahn pushed a commit to gibfahn/node that referenced this pull request Nov 28, 2017
There is no real need and it causes endless grief on Windows with some
of the upcoming changes.

PR-URL: nodejs#6734
Backport-PR-URL: nodejs#16550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
There is no real need and it causes endless grief on Windows with some
of the upcoming changes.

PR-URL: #6734
Backport-PR-URL: #16550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 7, 2017
There is no real need and it causes endless grief on Windows with some
of the upcoming changes.

PR-URL: #6734
Backport-PR-URL: #16550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 8, 2017
There is no real need and it causes endless grief on Windows with some
of the upcoming changes.

PR-URL: #6734
Backport-PR-URL: #16550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Mar 28, 2018
There is no real need and it causes endless grief on Windows with some
of the upcoming changes.

PR-URL: #6734
Backport-PR-URL: #16550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Mar 30, 2018
There is no real need and it causes endless grief on Windows with some
of the upcoming changes.

PR-URL: #6734
Backport-PR-URL: #16550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL