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, test: node internals' postmortem metadata #14901

Closed
wants to merge 2 commits into
base: master
from

Conversation

@mmarchini
Member

mmarchini commented Aug 17, 2017

Those changes are the first steps towards allowing debug tools to
navigate some of Node's internals strucutres, giving more possibilities
to developers doing post-mortem debugging. One example of what can be
achieved with the symbols added is a new command being developed for
llnode, which prints information about handles and requests on the
queue for a core dump file.

Ref: nodejs/post-mortem#46

Obs.: To add good tests for those changes, something like nodejs/build#777 is needed.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)
  • Building system
  • Tools
src/env.cc Outdated
@@ -23,6 +24,8 @@ using v8::Message;
using v8::StackFrame;
using v8::StackTrace;
Environment *Environment::currentEnvironment;

This comment has been minimized.

@addaleax

addaleax Aug 17, 2017

Member

style nit: align the * to the left (i.e. Environment* Environment::currentEnvironment)

src/env.h Outdated
@@ -360,6 +360,7 @@ class IsolateData {
class Environment {
public:
static Environment *currentEnvironment;

This comment has been minimized.

@addaleax

addaleax Aug 17, 2017

Member

(ditto)

name="currentEnvironment",
value="(uint64_t) &Environment::currentEnvironment",
headers=["env.h"],
type_="uint64_t",

This comment has been minimized.

@addaleax

addaleax Aug 17, 2017

Member

uintptr_t?

type_="uint64_t",
),
DebugSymbol(
name="class__BaseObject__persistant_handle",

This comment has been minimized.

@addaleax

addaleax Aug 17, 2017

Member

typo: persistant

common.gypi Outdated
@@ -50,6 +50,7 @@
}, {
'os_posix': 1,
'v8_postmortem_support%': 'true',
'node_postmortem_support%': 'true',

This comment has been minimized.

@addaleax

addaleax Aug 17, 2017

Member

What’s the motivation for making this optional?

@@ -19,6 +19,10 @@ class ReqWrap : public AsyncWrap {
inline ~ReqWrap() override;
inline void Dispatched(); // Call this after the req has been dispatched.
T* req() { return &req_; }
#ifdef NODE_POSTMORTEM_SUPPORT

This comment has been minimized.

@addaleax

addaleax Aug 17, 2017

Member

I don’t think these guards are necessary either way.

),
DebugSymbol(
name="class__Environment__handleWrapQueue",
value="(size_t) (((Environment*)0)->handle_wrap_queue())",

This comment has been minimized.

@addaleax

addaleax Aug 17, 2017

Member

Tbh, I’d just put #define private public at the top of the generated file and use offsetof.

mmarchini added a commit to mmarchini/llnode that referenced this pull request Aug 17, 2017

src: add commands to inspect the workqueue
Added two new commands (getactivehandles and getactiverequests)
which prints all pending handles and requests (same return
given by process._getActiveHandles() and process._getActiveRequests()).
Those changes were built upon the symbols added on nodejs/node#14901,
which means it's currently not working with node's latest build.

Fixes: nodejs#100
Ref: nodejs/node#14901
@bnoordhuis

This comment has been minimized.

Member

bnoordhuis commented Aug 18, 2017

The changes to src/ seem rather ad hoc. I'm also not a fan of adding global variables. You don't need to because the env can be found by following node_isolate.

@mmarchini

This comment has been minimized.

Member

mmarchini commented Aug 18, 2017

Thanks for the feedbacks, I just updated the PR with the suggestions made by @addaleax. I'm just not sure if #define private public is safe enough to be used here (seems rather extreme to me), but it worked like a charm.

All changes previously made on src/ were removed (with the exception of Environment::currentEnvironment). Now I'll take a look into node_isolate to see how to access the environment from there (it's a little challenging because it's not possible to call functions or methods when debugging a core file, but I think it can be done). I'll update this PR after finding a better way to access the current environment.

node.gyp Outdated
@@ -152,7 +152,8 @@
'dependencies': [
'node_js2c#host',
'deps/nghttp2/nghttp2.gyp:nghttp2'
'deps/nghttp2/nghttp2.gyp:nghttp2',
'node-postmortem-metadata'

This comment has been minimized.

@mmarchini

mmarchini Aug 18, 2017

Member

Is this the right place to include node-postmortem-metadata as a dependency?

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Seems fine to me but you should add a #host at the end. For consistency, I'd name it node_postmortem_metadata, i.e., underscores instead of dashes.

This comment has been minimized.

@mmarchini

mmarchini Sep 18, 2017

Member

I'll make those changes. Should I also rename gen-postmortem-metadata.py to gen_postmortem_metadata.py (most files on tools/ are using dashes, but there are some files using underscores)?

src/env.cc Outdated
@@ -23,6 +24,8 @@ using v8::Message;
using v8::StackFrame;
using v8::StackTrace;
Environment* Environment::currentEnvironment;

This comment has been minimized.

@mmarchini

mmarchini Aug 18, 2017

Member

This will be changed in the next update to this PR

*/
#define private public
#define protected public

This comment has been minimized.

@mmarchini

mmarchini Aug 18, 2017

Member

Is it safe to be used here?

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Seems fine to me.

@rnchamberlain

This comment has been minimized.

Member

rnchamberlain commented Aug 22, 2017

@bnoordhuis @mmarchini the isolate is a v8 class, the env is in node, and it looks to me that you could get the isolate from the env, but I don't see how you can go the other way?

@mmarchini

This comment has been minimized.

Member

mmarchini commented Aug 22, 2017

@rnchamberlain the Environment is stored in a fixed position inside the Context, and the Context is reachable from the Isolate, but the offsets to get the Context from the Isolate and the position inside the Context where the Environment is stored are currently not available in the symbols table of V8. I'm writing a PR to add those symbols to V8, let's see how it goes.

Another option would be to get the environment from uv_key_t thread_local_env, but it seems way harder to do, and any solution would be platform dependent (for example, on Linux the environment is stored in a pthread's thread-specific store).

@mmarchini

This comment has been minimized.

Member

mmarchini commented Aug 29, 2017

Pull Request updated:

  • Remove currentEnvironment symbol
  • Add environment_context_idx_embedder_data symbol (required to get the Environment from node_isolate)

Please let me know if there's any other changes needed.

@BridgeAR

This comment has been minimized.

Member

BridgeAR commented Sep 3, 2017

@BridgeAR

This comment has been minimized.

Member

BridgeAR commented Sep 13, 2017

Again @nodejs/build @nodejs/post-mortem PTAL
Maybe @addaleax again as well?

@addaleax

This comment has been minimized.

Member

addaleax commented Sep 14, 2017

Maybe @addaleax again as well?

The code LGTM but I don’t think I have a sufficiently good feeling for the usefulness of this feature.

node.gyp Outdated
@@ -152,7 +152,8 @@
'dependencies': [
'node_js2c#host',
'deps/nghttp2/nghttp2.gyp:nghttp2'
'deps/nghttp2/nghttp2.gyp:nghttp2',
'node-postmortem-metadata'

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Seems fine to me but you should add a #host at the end. For consistency, I'd name it node_postmortem_metadata, i.e., underscores instead of dashes.

node.gyp Outdated
'variables': {},
'actions': [
{
'action_name': 'gen-postmortem-metadata',

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Can you add 'process_outputs_as_sources': 1, here?

class DebugSymbol(object):
type_ = 'int'
_PREFIX = 'nodedbg_'

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Inconsistent casing of class variables.

self.name = name
self.value = value
self.headers = headers
self.type_ = type_ or DebugSymbol.type_

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Why is this called type_ instead of type?

This comment has been minimized.

@mmarchini

mmarchini Sep 18, 2017

Member

There's a built-in function named type, so using it as a name for variables or attributes is usually discouraged, but I could rename that if you prefer.

headers = [debug_symbol.headers for debug_symbol in debug_symbols]
headers = sum(headers, [])
return [h for h in headers if not (h in seen or seen_add(h))]

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

This seems like a convoluted way of doing:

headers = set()
for d in debug_symbols:
  headers.update(d.headers)
return list(headers)

Or even just:

return list(set(sum(d.headers for d in debug_symbols, [])))

This comment has been minimized.

@mmarchini

mmarchini Sep 18, 2017

Member

I prefer these ways too, but the order the headers were declared should be preserved (some headers need to be included before others). I'll add a comment on this method explaining that.

return [h for h in headers if not (h in seen or seen_add(h))]
def __str__(self):
return "{type} {prefix}{name} = {value};".format(

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Minor nit but we usually use single quotes for strings.

),
DebugSymbol(
name="class__BaseObject__persistent_handle",
value="(size_t) offsetof(BaseObject, persistent_handle_)",

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Unnecessary cast here and elsewhere: the return type of offsetof() is already size_t.

))
if (len(sys.argv) < 2):

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Superfluous parens.

if (len(sys.argv) < 2):
print('usage: %s output.cc' % sys.argv[0])

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Can you use .format() here?

*/
#define private public
#define protected public

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 15, 2017

Member

Seems fine to me.

@BridgeAR

This comment has been minimized.

Member

BridgeAR commented Sep 19, 2017

Ping @mmarchini

@mmarchini

This comment has been minimized.

Member

mmarchini commented Sep 20, 2017

Sorry for the late response. I've just updated the PR with changes requested by @bnoordhuis. I've also rebased it to match the current master.

@addaleax for now, it can be used to inspect active handles and requests on debuggers like LLDB (nodejs/llnode#122) and MDB (not implemented yet, but certainly will be if this is accepted). As we were discussing in nodejs/post-mortem#46, this is a first step to increase the power of debuggers to do post-mortem analysis of Node applications.

@cjihrig

LGTM once @bnoordhuis is good with it.

@bnoordhuis

LGTM if the last nits are addressed. Thanks for the PR.

node.gyp Outdated
@@ -169,7 +169,8 @@
'dependencies': [
'node_js2c#host',
'deps/nghttp2/nghttp2.gyp:nghttp2'
'deps/nghttp2/nghttp2.gyp:nghttp2',
'node_postmortem_metadata#host'

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 20, 2017

Member

If you swap these two, you can reduce the diff by one line (because you don't need to append a comma to the nghttp2 dep.)

@classmethod
def get_headers(cls, debug_symbols):
'''
Return a list of headers without duplicates, preserving the order they were declared

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 20, 2017

Member

Long line, can you wrap this at 80 columns?

Return a list of headers without duplicates, preserving the order they were declared
'''
seen = set()
seen_add = seen.add # faster than seen.add on each iteration

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 20, 2017

Member

It probably makes no measurable difference. I'd simply drop this and use seen.add(h) below.

headers = [debug_symbol.headers for debug_symbol in debug_symbols]
headers = sum(headers, [])
return [h for h in headers if not (h in seen or seen_add(h))]

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 20, 2017

Member

or seen_add(h) is a somewhat misleading construct because seen.add(h) doesn't return anything (well, None.)

I'd spell it out for clarity:

result = []
for h in headers:
  if not h in seen:
    seen.add(h)
    result.append(h)

return result
debug_symbols = [
DebugSymbol(
name="environment_context_idx_embedder_data",

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 20, 2017

Member

Single quotes please.

out = file(sys.argv[1], 'w')
headers = DebugSymbol.get_headers(debug_symbols)
includes = ['#include "{}"'.format(header) for header in headers]
includes = "\n".join(includes)

This comment has been minimized.

@bnoordhuis

bnoordhuis Sep 20, 2017

Member

Likewise.

@mmarchini

This comment has been minimized.

Member

mmarchini commented Sep 20, 2017

Pull Request updated with those last changes requested

@BridgeAR

This comment has been minimized.

@BridgeAR

This comment has been minimized.

Member

BridgeAR commented Sep 22, 2017

@mmarchini the commits should at least partially quashed and it is somewhat difficult for me to describe your changes in a single commit as I do not know what of the commit messages is still relevant and what not. Would you mind to either provide a single commit messages for all commits together or rebase on your own so this can be landed? Thanks a lot in advance!

@mmarchini

This comment has been minimized.

Member

mmarchini commented Sep 25, 2017

I've squashed all commits into one and updated the commit message to best reflect these changes. If you need anything else please let me know :)

@BridgeAR

This comment has been minimized.

@BridgeAR

This comment has been minimized.

Member

BridgeAR commented Sep 28, 2017

Rerun the CI as it is very red https://ci.nodejs.org/job/node-test-commit/12650/

@BridgeAR

This comment has been minimized.

Member

BridgeAR commented Sep 28, 2017

@mmarchini it seems like there are related failures on the CI. Please have a look. E.g. https://ci.nodejs.org/job/node-test-commit-linux/12698/nodes=centos5-64/console

@mmarchini

This comment has been minimized.

Member

mmarchini commented Sep 28, 2017

PR updated, there was a problem with string formatting when using Python 2.6. It should work now.

@BridgeAR

This comment has been minimized.

mmarchini added a commit to mmarchini/node that referenced this pull request Feb 26, 2018

src, test: node internals' postmortem metadata
Before these changes, only V8 added postmortem metadata to Node's
binary, limiting the possibilities for debugger's developers to add some
features that rely on investigating Node's internal structures.

These changes are first steps towards empowering debug tools to
navigate Node's internal structures. One example of what can be
achieved with this is shown at nodejs/llnode#122 (a command which prints
information about handles and requests on the queue for a core dump
file). Node postmortem metadata are prefixed with nodedbg_.

This also adds tests to validate if all postmortem metadata are
calculated correctly, plus some documentation on what is postmortem
metadata and a few care to be taken to avoid breaking it.

Ref: nodejs/llnode#122
Ref: nodejs/post-mortem#46

PR-URL: nodejs#14901
Refs: nodejs/post-mortem#46
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

addaleax added a commit that referenced this pull request Feb 26, 2018

src, test: node internals' postmortem metadata
Before these changes, only V8 added postmortem metadata to Node's
binary, limiting the possibilities for debugger's developers to add some
features that rely on investigating Node's internal structures.

These changes are first steps towards empowering debug tools to
navigate Node's internal structures. One example of what can be
achieved with this is shown at nodejs/llnode#122 (a command which prints
information about handles and requests on the queue for a core dump
file). Node postmortem metadata are prefixed with nodedbg_.

This also adds tests to validate if all postmortem metadata are
calculated correctly, plus some documentation on what is postmortem
metadata and a few care to be taken to avoid breaking it.

Ref: nodejs/llnode#122
Ref: nodejs/post-mortem#46

Backport-PR-URL: #18550
PR-URL: #14901
Refs: nodejs/post-mortem#46
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

MylesBorins added a commit that referenced this pull request Feb 26, 2018

src, test: node internals' postmortem metadata
Before these changes, only V8 added postmortem metadata to Node's
binary, limiting the possibilities for debugger's developers to add some
features that rely on investigating Node's internal structures.

These changes are first steps towards empowering debug tools to
navigate Node's internal structures. One example of what can be
achieved with this is shown at nodejs/llnode#122 (a command which prints
information about handles and requests on the queue for a core dump
file). Node postmortem metadata are prefixed with nodedbg_.

This also adds tests to validate if all postmortem metadata are
calculated correctly, plus some documentation on what is postmortem
metadata and a few care to be taken to avoid breaking it.

Ref: nodejs/llnode#122
Ref: nodejs/post-mortem#46

Backport-PR-URL: #18550
PR-URL: #14901
Refs: nodejs/post-mortem#46
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

addaleax added a commit that referenced this pull request Feb 27, 2018

2018-02-27, Version 9.7.0 (Current)
Notable Changes:

* **libuv**:
  - Updated to libuv 1.19.2 (Colin Ihrig) [#18918](#18918)

* **src**:
  - Add initial support for Node.js-specific post-mortem metadata (Matheus Marchini) [#14901](#14901)

* **timers**:
  - The return value of `setImmediate()` now has `ref()` and `unref()` methods (Anatoli Papirovski) [#18139](#18139)

* **util**:
  - It is now possible to get the name for a numerical platform-specific error code as a string (Joyee Cheung) [#18186](#18186)

addaleax added a commit that referenced this pull request Feb 27, 2018

2018-02-27, Version 9.7.0 (Current)
Notable Changes:

* **libuv**:
  - Updated to libuv 1.19.2 (Colin Ihrig) [#18918](#18918)

* **src**:
  - Add initial support for Node.js-specific post-mortem metadata (Matheus Marchini) [#14901](#14901)

* **timers**:
  - The return value of `setImmediate()` now has `ref()` and `unref()` methods (Anatoli Papirovski) [#18139](#18139)

* **util**:
  - It is now possible to get the name for a numerical platform-specific error code as a string (Joyee Cheung) [#18186](#18186)

@addaleax addaleax referenced this pull request Feb 27, 2018

Closed

v9.7.0 proposal #19040

rvagg added a commit that referenced this pull request Mar 1, 2018

2018-03-01, Version 9.7.0 (Current)
Notable Changes:

* **libuv**:
  - Updated to libuv 1.19.2 (Colin Ihrig) [#18918](#18918)

* **src**:
  - Add initial support for Node.js-specific post-mortem metadata (Matheus Marchini) [#14901](#14901)

* **timers**:
  - The return value of `setImmediate()` now has `ref()` and `unref()` methods (Anatoli Papirovski) [#18139](#18139)

* **util**:
  - It is now possible to get the name for a numerical platform-specific error code as a string (Joyee Cheung) [#18186](#18186)

PR-URL: #19040
Prepared-By: Anna Henningsen <anna@addaleax.net>

rvagg added a commit that referenced this pull request Mar 1, 2018

2018-03-01, Version 9.7.0 (Current)
Notable Changes:

* **libuv**:
  - Updated to libuv 1.19.2 (Colin Ihrig) [#18918](#18918)

* **src**:
  - Add initial support for Node.js-specific post-mortem metadata (Matheus Marchini) [#14901](#14901)

* **timers**:
  - The return value of `setImmediate()` now has `ref()` and `unref()` methods (Anatoli Papirovski) [#18139](#18139)

* **util**:
  - It is now possible to get the name for a numerical platform-specific error code as a string (Joyee Cheung) [#18186](#18186)

PR-URL: #19040
Prepared-By: Anna Henningsen <anna@addaleax.net>

mmarchini added a commit to mmarchini/node that referenced this pull request Mar 6, 2018

src, test: node internals' postmortem metadata
Before these changes, only V8 added postmortem metadata to Node's
binary, limiting the possibilities for debugger's developers to add some
features that rely on investigating Node's internal structures.

These changes are first steps towards empowering debug tools to
navigate Node's internal structures. One example of what can be
achieved with this is shown at nodejs/llnode#122 (a command which prints
information about handles and requests on the queue for a core dump
file). Node postmortem metadata are prefixed with nodedbg_.

This also adds tests to validate if all postmortem metadata are
calculated correctly, plus some documentation on what is postmortem
metadata and a few care to be taken to avoid breaking it.

Ref: nodejs/llnode#122
Ref: nodejs/post-mortem#46

PR-URL: nodejs#14901
Refs: nodejs/post-mortem#46
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

mmarchini added a commit to mmarchini/node that referenced this pull request Mar 13, 2018

src, test: node internals' postmortem metadata
Before these changes, only V8 added postmortem metadata to Node's
binary, limiting the possibilities for debugger's developers to add some
features that rely on investigating Node's internal structures.

These changes are first steps towards empowering debug tools to
navigate Node's internal structures. One example of what can be
achieved with this is shown at nodejs/llnode#122 (a command which prints
information about handles and requests on the queue for a core dump
file). Node postmortem metadata are prefixed with nodedbg_.

This also adds tests to validate if all postmortem metadata are
calculated correctly, plus some documentation on what is postmortem
metadata and a few care to be taken to avoid breaking it.

Ref: nodejs/llnode#122
Ref: nodejs/post-mortem#46

PR-URL: nodejs#14901
Refs: nodejs/post-mortem#46
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

mmarchini added a commit to mmarchini/llnode that referenced this pull request Mar 13, 2018

src: add commands to inspect the workqueue
Added two new commands (getactivehandles and getactiverequests)
which prints all pending handles and requests (same return
given by process._getActiveHandles() and process._getActiveRequests()).
Those changes were built upon the symbols added on nodejs/node#14901,
which means it's currently not working with node's latest build.

Fixes: nodejs#100
Ref: nodejs/node#14901

MayaLekova added a commit to MayaLekova/node that referenced this pull request May 8, 2018

src, test: node internals' postmortem metadata
Before these changes, only V8 added postmortem metadata to Node's
binary, limiting the possibilities for debugger's developers to add some
features that rely on investigating Node's internal structures.

These changes are first steps towards empowering debug tools to
navigate Node's internal structures. One example of what can be
achieved with this is shown at nodejs/llnode#122 (a command which prints
information about handles and requests on the queue for a core dump
file). Node postmortem metadata are prefixed with nodedbg_.

This also adds tests to validate if all postmortem metadata are
calculated correctly, plus some documentation on what is postmortem
metadata and a few care to be taken to avoid breaking it.

Ref: nodejs/llnode#122
Ref: nodejs/post-mortem#46

PR-URL: nodejs#14901
Refs: nodejs/post-mortem#46
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

MayaLekova added a commit to MayaLekova/node that referenced this pull request May 8, 2018

2018-03-01, Version 9.7.0 (Current)
Notable Changes:

* **libuv**:
  - Updated to libuv 1.19.2 (Colin Ihrig) [nodejs#18918](nodejs#18918)

* **src**:
  - Add initial support for Node.js-specific post-mortem metadata (Matheus Marchini) [nodejs#14901](nodejs#14901)

* **timers**:
  - The return value of `setImmediate()` now has `ref()` and `unref()` methods (Anatoli Papirovski) [nodejs#18139](nodejs#18139)

* **util**:
  - It is now possible to get the name for a numerical platform-specific error code as a string (Joyee Cheung) [nodejs#18186](nodejs#18186)

PR-URL: nodejs#19040
Prepared-By: Anna Henningsen <anna@addaleax.net>
@mmarchini

This comment has been minimized.

Member

mmarchini commented May 22, 2018

Yes. There's already a backport PR open (#19176), I just need to rebase it to resolve conflicts. I'll do it today.

MylesBorins added a commit that referenced this pull request May 22, 2018

src, test: node internals' postmortem metadata
Before these changes, only V8 added postmortem metadata to Node's
binary, limiting the possibilities for debugger's developers to add some
features that rely on investigating Node's internal structures.

These changes are first steps towards empowering debug tools to
navigate Node's internal structures. One example of what can be
achieved with this is shown at nodejs/llnode#122 (a command which prints
information about handles and requests on the queue for a core dump
file). Node postmortem metadata are prefixed with nodedbg_.

This also adds tests to validate if all postmortem metadata are
calculated correctly, plus some documentation on what is postmortem
metadata and a few care to be taken to avoid breaking it.

Ref: nodejs/llnode#122
Ref: nodejs/post-mortem#46

PR-URL: #14901
Refs: nodejs/post-mortem#46
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

MylesBorins added a commit that referenced this pull request May 22, 2018

src, test: node internals' postmortem metadata
Before these changes, only V8 added postmortem metadata to Node's
binary, limiting the possibilities for debugger's developers to add some
features that rely on investigating Node's internal structures.

These changes are first steps towards empowering debug tools to
navigate Node's internal structures. One example of what can be
achieved with this is shown at nodejs/llnode#122 (a command which prints
information about handles and requests on the queue for a core dump
file). Node postmortem metadata are prefixed with nodedbg_.

This also adds tests to validate if all postmortem metadata are
calculated correctly, plus some documentation on what is postmortem
metadata and a few care to be taken to avoid breaking it.

Ref: nodejs/llnode#122
Ref: nodejs/post-mortem#46

Backport-PR-URL: #19176
PR-URL: #14901
Refs: nodejs/post-mortem#46
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

MylesBorins added a commit that referenced this pull request Jun 14, 2018

src, test: node internals' postmortem metadata
Before these changes, only V8 added postmortem metadata to Node's
binary, limiting the possibilities for debugger's developers to add some
features that rely on investigating Node's internal structures.

These changes are first steps towards empowering debug tools to
navigate Node's internal structures. One example of what can be
achieved with this is shown at nodejs/llnode#122 (a command which prints
information about handles and requests on the queue for a core dump
file). Node postmortem metadata are prefixed with nodedbg_.

This also adds tests to validate if all postmortem metadata are
calculated correctly, plus some documentation on what is postmortem
metadata and a few care to be taken to avoid breaking it.

Ref: nodejs/llnode#122
Ref: nodejs/post-mortem#46

Backport-PR-URL: #19176
PR-URL: #14901
Refs: nodejs/post-mortem#46
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

@MylesBorins MylesBorins referenced this pull request Jul 9, 2018

Merged

v8.12.0 proposal #21593

rvagg added a commit that referenced this pull request Aug 16, 2018

src, test: node internals' postmortem metadata
Before these changes, only V8 added postmortem metadata to Node's
binary, limiting the possibilities for debugger's developers to add some
features that rely on investigating Node's internal structures.

These changes are first steps towards empowering debug tools to
navigate Node's internal structures. One example of what can be
achieved with this is shown at nodejs/llnode#122 (a command which prints
information about handles and requests on the queue for a core dump
file). Node postmortem metadata are prefixed with nodedbg_.

This also adds tests to validate if all postmortem metadata are
calculated correctly, plus some documentation on what is postmortem
metadata and a few care to be taken to avoid breaking it.

Ref: nodejs/llnode#122
Ref: nodejs/post-mortem#46

Backport-PR-URL: #19176
PR-URL: #14901
Refs: nodejs/post-mortem#46
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

MylesBorins added a commit that referenced this pull request Aug 17, 2018

2018-09-04, Version 8.12.0 'Carbon' (LTS)
Notable Changes:

* async_hooks:
  - rename PromiseWrap.parentId (Ali Ijaz Sheikh)
    #18633
  - remove runtime deprecation (Ali Ijaz Sheikh)
    #19517
  - deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
    #18513
* cluster:
  - add cwd to cluster.settings (cjihrig)
    #18399
  - support windowsHide option for workers (Todd Wong)
    #17412
* crypto:
  - allow passing null as IV unless required (Tobias Nießen)
    #18644
* deps:
  - upgrade npm to 6.2.0 (Kat Marchán)
    #21592
  - upgrade libuv to 1.19.2 (cjihrig)
    #18918
  - Upgrade node-inspect to 1.11.5 (Jan Krems)
    #21055
* fs,net:
  - support as and as+ flags in stringToFlags() (Sarat Addepalli)
    #18801
  - emit 'ready' for fs streams and sockets (Sameer Srivastava)
    #19408
* http, http2:
  - add options to http.createServer() (Peter Marton)
    #15752
  - add 103 Early Hints status code (Yosuke Furukawa)
    #16644
  - add http fallback options to .createServer (Peter Marton)
    #15752
* n-api:
  - take n-api out of experimental (Michael Dawson)
    #19262
* perf_hooks:
  - add warning when too many entries in the timeline (James M Snell)
    #18087
* src:
  - add public API for managing NodePlatform (Cheng Zhao)
    #16981
  - allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
    #17600
  - node internals' postmortem metadata (Matheus Marchini)
    #14901
* tls:
  - expose Finished messages in TLSSocket (Anton Salikhmetov)
    #19102
* **trace_events**:
  - add file pattern cli option (Andreas Madsen)
    #18480
* util:
  - implement util.getSystemErrorName() (Joyee Cheung)
    #18186

PR-URL: #21593

MylesBorins added a commit that referenced this pull request Aug 17, 2018

2018-09-04, Version 8.12.0 'Carbon' (LTS)
Notable Changes:

* async_hooks:
  - rename PromiseWrap.parentId (Ali Ijaz Sheikh)
    #18633
  - remove runtime deprecation (Ali Ijaz Sheikh)
    #19517
  - deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
    #18513
* cluster:
  - add cwd to cluster.settings (cjihrig)
    #18399
  - support windowsHide option for workers (Todd Wong)
    #17412
* crypto:
  - allow passing null as IV unless required (Tobias Nießen)
    #18644
* deps:
  - upgrade npm to 6.2.0 (Kat Marchán)
    #21592
  - upgrade libuv to 1.19.2 (cjihrig)
    #18918
  - Upgrade node-inspect to 1.11.5 (Jan Krems)
    #21055
* fs,net:
  - support as and as+ flags in stringToFlags() (Sarat Addepalli)
    #18801
  - emit 'ready' for fs streams and sockets (Sameer Srivastava)
    #19408
* http, http2:
  - add options to http.createServer() (Peter Marton)
    #15752
  - add 103 Early Hints status code (Yosuke Furukawa)
    #16644
  - add http fallback options to .createServer (Peter Marton)
    #15752
* n-api:
  - take n-api out of experimental (Michael Dawson)
    #19262
* perf_hooks:
  - add warning when too many entries in the timeline (James M Snell)
    #18087
* src:
  - add public API for managing NodePlatform (Cheng Zhao)
    #16981
  - allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
    #17600
  - node internals' postmortem metadata (Matheus Marchini)
    #14901
* tls:
  - expose Finished messages in TLSSocket (Anton Salikhmetov)
    #19102
* **trace_events**:
  - add file pattern cli option (Andreas Madsen)
    #18480
* util:
  - implement util.getSystemErrorName() (Joyee Cheung)
    #18186

PR-URL: #21593

BethGriggs added a commit to BethGriggs/node that referenced this pull request Aug 29, 2018

2018-09-04, Version 8.12.0 'Carbon' (LTS)
Notable Changes:

* async_hooks:
  - rename PromiseWrap.parentId (Ali Ijaz Sheikh)
    nodejs#18633
  - remove runtime deprecation (Ali Ijaz Sheikh)
    nodejs#19517
  - deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
    nodejs#18513
* cluster:
  - add cwd to cluster.settings (cjihrig)
    nodejs#18399
  - support windowsHide option for workers (Todd Wong)
    nodejs#17412
* crypto:
  - allow passing null as IV unless required (Tobias Nießen)
    nodejs#18644
* deps:
  - upgrade npm to 6.2.0 (Kat Marchán)
    nodejs#21592
  - upgrade libuv to 1.19.2 (cjihrig)
    nodejs#18918
  - Upgrade node-inspect to 1.11.5 (Jan Krems)
    nodejs#21055
* fs,net:
  - support as and as+ flags in stringToFlags() (Sarat Addepalli)
    nodejs#18801
  - emit 'ready' for fs streams and sockets (Sameer Srivastava)
    nodejs#19408
* http, http2:
  - add options to http.createServer() (Peter Marton)
    nodejs#15752
  - add 103 Early Hints status code (Yosuke Furukawa)
    nodejs#16644
  - add http fallback options to .createServer (Peter Marton)
    nodejs#15752
* n-api:
  - take n-api out of experimental (Michael Dawson)
    nodejs#19262
* perf_hooks:
  - add warning when too many entries in the timeline (James M Snell)
    nodejs#18087
* src:
  - add public API for managing NodePlatform (Cheng Zhao)
    nodejs#16981
  - allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
    nodejs#17600
  - node internals' postmortem metadata (Matheus Marchini)
    nodejs#14901
* tls:
  - expose Finished messages in TLSSocket (Anton Salikhmetov)
    nodejs#19102
* **trace_events**:
  - add file pattern cli option (Andreas Madsen)
    nodejs#18480
* util:
  - implement util.getSystemErrorName() (Joyee Cheung)
    nodejs#18186

PR-URL: nodejs#21593

MylesBorins added a commit that referenced this pull request Sep 3, 2018

2018-09-04, Version 8.12.0 'Carbon' (LTS)
Notable Changes:

* async_hooks:
  - rename PromiseWrap.parentId (Ali Ijaz Sheikh)
    #18633
  - remove runtime deprecation (Ali Ijaz Sheikh)
    #19517
  - deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
    #18513
* cluster:
  - add cwd to cluster.settings (cjihrig)
    #18399
  - support windowsHide option for workers (Todd Wong)
    #17412
* crypto:
  - allow passing null as IV unless required (Tobias Nießen)
    #18644
* deps:
  - upgrade npm to 6.4.1 (Kat Marchán)
    #22591
  - upgrade libuv to 1.19.2 (cjihrig)
    #18918
  - Upgrade node-inspect to 1.11.5 (Jan Krems)
    #21055
* fs,net:
  - support as and as+ flags in stringToFlags() (Sarat Addepalli)
    #18801
  - emit 'ready' for fs streams and sockets (Sameer Srivastava)
    #19408
* http, http2:
  - add options to http.createServer() (Peter Marton)
    #15752
  - add 103 Early Hints status code (Yosuke Furukawa)
    #16644
  - add http fallback options to .createServer (Peter Marton)
    #15752
* n-api:
  - take n-api out of experimental (Michael Dawson)
    #19262
* perf_hooks:
  - add warning when too many entries in the timeline (James M Snell)
    #18087
* src:
  - add public API for managing NodePlatform (Cheng Zhao)
    #16981
  - allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
    #17600
  - node internals' postmortem metadata (Matheus Marchini)
    #14901
* tls:
  - expose Finished messages in TLSSocket (Anton Salikhmetov)
    #19102
* **trace_events**:
  - add file pattern cli option (Andreas Madsen)
    #18480
* util:
  - implement util.getSystemErrorName() (Joyee Cheung)
    #18186

PR-URL: #21593

MylesBorins added a commit that referenced this pull request Sep 6, 2018

2018-09-11, Version 8.12.0 'Carbon' (LTS)
Notable Changes:

* async_hooks:
  - rename PromiseWrap.parentId (Ali Ijaz Sheikh)
    #18633
  - remove runtime deprecation (Ali Ijaz Sheikh)
    #19517
  - deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
    #18513
* cluster:
  - add cwd to cluster.settings (cjihrig)
    #18399
  - support windowsHide option for workers (Todd Wong)
    #17412
* crypto:
  - allow passing null as IV unless required (Tobias Nießen)
    #18644
* deps:
  - upgrade npm to 6.2.0 (Kat Marchán)
    #21592
  - upgrade libuv to 1.19.2 (cjihrig)
    #18918
  - Upgrade node-inspect to 1.11.5 (Jan Krems)
    #21055
* fs,net:
  - support as and as+ flags in stringToFlags() (Sarat Addepalli)
    #18801
  - emit 'ready' for fs streams and sockets (Sameer Srivastava)
    #19408
* http, http2:
  - add options to http.createServer() (Peter Marton)
    #15752
  - add 103 Early Hints status code (Yosuke Furukawa)
    #16644
  - add http fallback options to .createServer (Peter Marton)
    #15752
* n-api:
  - take n-api out of experimental (Michael Dawson)
    #19262
* perf_hooks:
  - add warning when too many entries in the timeline (James M Snell)
    #18087
* src:
  - add public API for managing NodePlatform (Cheng Zhao)
    #16981
  - allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
    #17600
  - node internals' postmortem metadata (Matheus Marchini)
    #14901
* tls:
  - expose Finished messages in TLSSocket (Anton Salikhmetov)
    #19102
* **trace_events**:
  - add file pattern cli option (Andreas Madsen)
    #18480
* util:
  - implement util.getSystemErrorName() (Joyee Cheung)
    #18186

PR-URL: #21593

MylesBorins added a commit that referenced this pull request Sep 6, 2018

2018-09-11, Version 8.12.0 'Carbon' (LTS)
Notable Changes:

* async_hooks:
  - rename PromiseWrap.parentId (Ali Ijaz Sheikh)
    #18633
  - remove runtime deprecation (Ali Ijaz Sheikh)
    #19517
  - deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
    #18513
* cluster:
  - add cwd to cluster.settings (cjihrig)
    #18399
  - support windowsHide option for workers (Todd Wong)
    #17412
* crypto:
  - allow passing null as IV unless required (Tobias Nießen)
    #18644
* deps:
  - upgrade npm to 6.2.0 (Kat Marchán)
    #21592
  - upgrade libuv to 1.19.2 (cjihrig)
    #18918
  - Upgrade node-inspect to 1.11.5 (Jan Krems)
    #21055
* fs,net:
  - support as and as+ flags in stringToFlags() (Sarat Addepalli)
    #18801
  - emit 'ready' for fs streams and sockets (Sameer Srivastava)
    #19408
* http, http2:
  - add options to http.createServer() (Peter Marton)
    #15752
  - add 103 Early Hints status code (Yosuke Furukawa)
    #16644
  - add http fallback options to .createServer (Peter Marton)
    #15752
* n-api:
  - take n-api out of experimental (Michael Dawson)
    #19262
* perf_hooks:
  - add warning when too many entries in the timeline (James M Snell)
    #18087
* src:
  - add public API for managing NodePlatform (Cheng Zhao)
    #16981
  - allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
    #17600
  - node internals' postmortem metadata (Matheus Marchini)
    #14901
* tls:
  - expose Finished messages in TLSSocket (Anton Salikhmetov)
    #19102
* **trace_events**:
  - add file pattern cli option (Andreas Madsen)
    #18480
* util:
  - implement util.getSystemErrorName() (Joyee Cheung)
    #18186

PR-URL: #21593

MylesBorins added a commit that referenced this pull request Sep 10, 2018

2018-09-11, Version 8.12.0 'Carbon' (LTS)
Notable Changes:

* async_hooks:
  - rename PromiseWrap.parentId (Ali Ijaz Sheikh)
    #18633
  - remove runtime deprecation (Ali Ijaz Sheikh)
    #19517
  - deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
    #18513
* cluster:
  - add cwd to cluster.settings (cjihrig)
    #18399
  - support windowsHide option for workers (Todd Wong)
    #17412
* crypto:
  - allow passing null as IV unless required (Tobias Nießen)
    #18644
* deps:
  - upgrade npm to 6.2.0 (Kat Marchán)
    #21592
  - upgrade libuv to 1.19.2 (cjihrig)
    #18918
  - Upgrade node-inspect to 1.11.5 (Jan Krems)
    #21055
* fs,net:
  - support as and as+ flags in stringToFlags() (Sarat Addepalli)
    #18801
  - emit 'ready' for fs streams and sockets (Sameer Srivastava)
    #19408
* http, http2:
  - add options to http.createServer() (Peter Marton)
    #15752
  - add 103 Early Hints status code (Yosuke Furukawa)
    #16644
  - add http fallback options to .createServer (Peter Marton)
    #15752
* n-api:
  - take n-api out of experimental (Michael Dawson)
    #19262
* perf_hooks:
  - add warning when too many entries in the timeline (James M Snell)
    #18087
* src:
  - add public API for managing NodePlatform (Cheng Zhao)
    #16981
  - allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
    #17600
  - node internals' postmortem metadata (Matheus Marchini)
    #14901
* tls:
  - expose Finished messages in TLSSocket (Anton Salikhmetov)
    #19102
* **trace_events**:
  - add file pattern cli option (Andreas Madsen)
    #18480
* util:
  - implement util.getSystemErrorName() (Joyee Cheung)
    #18186

PR-URL: #21593

MylesBorins added a commit that referenced this pull request Sep 11, 2018

2018-09-11, Version 8.12.0 'Carbon' (LTS)
Notable Changes:

* async_hooks:
  - rename PromiseWrap.parentId (Ali Ijaz Sheikh)
    #18633
  - remove runtime deprecation (Ali Ijaz Sheikh)
    #19517
  - deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
    #18513
* cluster:
  - add cwd to cluster.settings (cjihrig)
    #18399
  - support windowsHide option for workers (Todd Wong)
    #17412
* crypto:
  - allow passing null as IV unless required (Tobias Nießen)
    #18644
* deps:
  - upgrade npm to 6.2.0 (Kat Marchán)
    #21592
  - upgrade libuv to 1.19.2 (cjihrig)
    #18918
  - Upgrade node-inspect to 1.11.5 (Jan Krems)
    #21055
* fs,net:
  - support as and as+ flags in stringToFlags() (Sarat Addepalli)
    #18801
  - emit 'ready' for fs streams and sockets (Sameer Srivastava)
    #19408
* http, http2:
  - add options to http.createServer() (Peter Marton)
    #15752
  - add 103 Early Hints status code (Yosuke Furukawa)
    #16644
  - add http fallback options to .createServer (Peter Marton)
    #15752
* n-api:
  - take n-api out of experimental (Michael Dawson)
    #19262
* perf_hooks:
  - add warning when too many entries in the timeline (James M Snell)
    #18087
* src:
  - add public API for managing NodePlatform (Cheng Zhao)
    #16981
  - allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
    #17600
  - node internals' postmortem metadata (Matheus Marchini)
    #14901
* tls:
  - expose Finished messages in TLSSocket (Anton Salikhmetov)
    #19102
* **trace_events**:
  - add file pattern cli option (Andreas Madsen)
    #18480
* util:
  - implement util.getSystemErrorName() (Joyee Cheung)
    #18186

PR-URL: #21593

MylesBorins added a commit that referenced this pull request Sep 11, 2018

2018-09-11, Version 8.12.0 'Carbon' (LTS)
Notable Changes:

* async_hooks:
  - rename PromiseWrap.parentId (Ali Ijaz Sheikh)
    #18633
  - remove runtime deprecation (Ali Ijaz Sheikh)
    #19517
  - deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
    #18513
* cluster:
  - add cwd to cluster.settings (cjihrig)
    #18399
  - support windowsHide option for workers (Todd Wong)
    #17412
* crypto:
  - allow passing null as IV unless required (Tobias Nießen)
    #18644
* deps:
  - upgrade npm to 6.2.0 (Kat Marchán)
    #21592
  - upgrade libuv to 1.19.2 (cjihrig)
    #18918
  - Upgrade node-inspect to 1.11.5 (Jan Krems)
    #21055
* fs,net:
  - support as and as+ flags in stringToFlags() (Sarat Addepalli)
    #18801
  - emit 'ready' for fs streams and sockets (Sameer Srivastava)
    #19408
* http, http2:
  - add options to http.createServer() (Peter Marton)
    #15752
  - add 103 Early Hints status code (Yosuke Furukawa)
    #16644
  - add http fallback options to .createServer (Peter Marton)
    #15752
* n-api:
  - take n-api out of experimental (Michael Dawson)
    #19262
* perf_hooks:
  - add warning when too many entries in the timeline (James M Snell)
    #18087
* src:
  - add public API for managing NodePlatform (Cheng Zhao)
    #16981
  - allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
    #17600
  - node internals' postmortem metadata (Matheus Marchini)
    #14901
* tls:
  - expose Finished messages in TLSSocket (Anton Salikhmetov)
    #19102
* **trace_events**:
  - add file pattern cli option (Andreas Madsen)
    #18480
* util:
  - implement util.getSystemErrorName() (Joyee Cheung)
    #18186

PR-URL: #21593
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment