GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Proposal: add more debugging symbols related to Node internal structures · Issue #46 · nodejs/post-mortem

This repository was archived by the owner on Aug 7, 2023. It is now read-only.
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Proposal: add more debugging symbols related to Node internal structures #46

Copy link
Copy link
Closed
Closed
Proposal: add more debugging symbols related to Node internal structures#46
Copy link

Description

@mmarchini
mmarchini
opened on Aug 16, 2017
Issue body actions

Hello everyone!

I'm writing a command to llnode to print all Handles and Requests on the queue of a core dump (similar to what node::GetActiveHandles and node::GetActiveRequests do). While I was working I noticed that, although there's plenty of debugging symbols to help navigate V8 structures (v8dbg_ symbols, thanks to the postmortem-metadata action on V8 build), there are no symbols to describe Node internal structures.

Using as example the command I'm implementing, I need to get the current Environment, navigate to the corresponding queue (let's say, handle_wrap_queue_), and then iterate over this queue (which was created with ListHead) to be able to get the HandleWrap objects. All of this can be done easily on a node debug build, but it's not possible to do on a common build.

I thought about implementing something similar to V8 postmortem-metadata: a script that creates a .cc file with all wanted symbols prefixed with something like nodedbg_. Would that be acceptable? I could probably publish a draft patch at the end of this week. I think this would be useful for other debugging tools, not just llnode.

I'm opened to suggestions.

In the meantime, thank you so much for your attention and participation.

Activity

Next
  1. mmarchini
    added 2 commits that reference this issue on Aug 17, 2017

    src, tools: add debug symbols for node internals

    acf9da6
  2. rnchamberlain commented on Aug 18, 2017

    @rnchamberlain
    rnchamberlain
    on Aug 18, 2017
    Contributor
    More actions

    This looks like a great step forward for post-mortem debugging of node internals (i.e. not just V8). The requirement raised here is typical: nodejs/llnode#100

    Exposing the address of the Environment structure is a key step (as well as the offsets in that structure). You get that by setting a global symbol during node startup that you can then find in the debugger plugin?

    Also you are wrapping this with NODE_POSTMORTEM_SUPPORT - is the intention to provide this in production builds of node? Thanks!

  3. mhdawson commented on Aug 18, 2017

    @mhdawson
    mhdawson
    on Aug 18, 2017
    Member
    More actions

    @mmarchini thanks for suggesting/working on this. Additional meta data would be greatly appreciated.

  4. davepacheco commented on Aug 18, 2017

    @davepacheco
    davepacheco
    on Aug 18, 2017
    More actions

    This sounds terrific. We already hardcode one Node offset in mdb_v8:
    https://github.com/joyent/mdb_v8/blob/08571bf8d4ba1e7546b46e7d24011ca2f9be1f3d/src/mdb_v8_impl.h#L116

    It would be great to incorporate this one into your new mechanism. And we'd love to use your proposed new metadata to provide an mdb_v8 dcmd to print active handles. As I'm sure you know, Node programs that don't exit when expected can be frustrating to debug, and that sort of problem is very amenable to debugging from a core file.

  5. mmarchini commented on Aug 18, 2017

    @mmarchini
    mmarchini
    on Aug 18, 2017
    Author
    More actions

    @rnchamberlain yes, the intention is to provide this in production builds too (I already removed those guards from the PR).

    @davepacheco I'll add this offset to nodejs/node#14901, I'm just having trouble finding node_string.h, does it still exists on node's master branch?

    Suggestions of other constants or offsets that can be added to this PR would be really appreciated!

  6. 30 remaining items

  7. addaleax
    added a commit that references this issue on Feb 26, 2018

    src, test: node internals' postmortem metadata

    8964ea5
  8. MylesBorins
    added a commit that references this issue on Feb 26, 2018

    src, test: node internals' postmortem metadata

    46fc507
  9. mmarchini
    added 2 commits that reference this issue on Mar 6, 2018

    src, test: node internals' postmortem metadata

    77eb8e2

    src, test: node internals' postmortem metadata

    cad9554
  10. mmarchini commented on Mar 21, 2018

    @mmarchini
    mmarchini
    on Mar 21, 2018
    Author
    More actions

    I'm closing because nodejs/node#14901 landed and is shipped on v9.7.0+, but feel free to reopen if you think there's something else to discuss here.

  11. mmarchini
    closed this as completedon Mar 21, 2018
  12. MayaLekova
    added a commit that references this issue on May 8, 2018

    src, test: node internals' postmortem metadata

    9bfd3b9
  13. MylesBorins
    added 2 commits that reference this issue on May 22, 2018

    src, test: node internals' postmortem metadata

    29119a8

    src, test: node internals' postmortem metadata

    b2b85e5
  14. MylesBorins
    added a commit that references this issue on Jun 14, 2018

    src, test: node internals' postmortem metadata

    2050c4c
  15. rvagg
    added a commit that references this issue on Aug 16, 2018

    src, test: node internals' postmortem metadata

    0564454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.