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

doc(llnode): add user journey guide #587

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 57 additions & 1 deletion documentation/crash/step2/using_llnode.md
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
// TODO
# Using `llnode` for post-mortem debugging

You probably already experienced crashes that only happen in production.
You'd like to reproduce it and step through instructions,
but it will imply stopping your Node.js process and certainly
degrade the user experience.

The purpose of this guide is to help you to find route causes
of your application crashes in production.

Before jumping into the code, let's clarify a few core concepts
that will helps you to go thoroughly through this tutorial.

## Concepts

> ✋ If you familliar with the concept of core dump and `lldb`,
> please skip this chapter, and start [here](#explore-your-firstcore-dump)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> please skip this chapter, and start [here](#explore-your-firstcore-dump)
> please skip this chapter, and start [here](#explore-your-first-core-dump)

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch


### What is a core dump?
### What is `lldb`?

## Explore your first core dump

### Setup

Open your favorite editor and copy-paste this piece of code.

```js
// script.js

const log = {
  info: (message) => console.log("Info: " + message),
  error: (message) => console.log("Error: " + message)
}

log.debug("This should crash");
```

### Create a code dump
### Use lldb
### Something is missing in the frames

## Reveal invisible frames with `llnode`

This is not ideal for dealing with these blank lines.
Let's see how `llnode` can help us.

### Install `llnode` plugin
### Explore missing traces (`v8 bt`)

## Beyond the backtrace

Revealing Javascript frames is not the only capacity of `llnode`.

### Inspect framces (`v8 i`)
### Explore objects (`v8 findjsobjects` / `v8 findjsinstances`)
### Find object references (`v8 findrefs`)