From 20d17c86bc26fcd4dafabfb66c0f729cf7d20f87 Mon Sep 17 00:00:00 2001 From: Tony Gorez Date: Wed, 24 Aug 2022 19:37:24 +0200 Subject: [PATCH 1/3] doc(llnode): add structure --- documentation/crash/step2/using_llnode.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/documentation/crash/step2/using_llnode.md b/documentation/crash/step2/using_llnode.md index 70b786d..e0234ba 100644 --- a/documentation/crash/step2/using_llnode.md +++ b/documentation/crash/step2/using_llnode.md @@ -1 +1,20 @@ -// TODO +# Using `llnode` for post-mortem debugging + +## Concepts + +### What is post-mortem debugging? +### What is a core dump? +### What is `lldb`? + +## Explore your first core dump + +### Setup (script we'll use for the tutorial) +### Use lldb +### Something is missing in the frames + +## Reveal invisible frames with `llnode` + +### Install `llnode` plugin +### Explore missing traces +### Explore objects +### Find object references From 6e66c10779da3dcdbd27c64e7accd64ac74d07b4 Mon Sep 17 00:00:00 2001 From: Tony Gorez Date: Thu, 1 Sep 2022 07:02:45 +0200 Subject: [PATCH 2/3] doc(llnode): enrich --- documentation/crash/step2/using_llnode.md | 40 ++++++++++++++++++++--- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/documentation/crash/step2/using_llnode.md b/documentation/crash/step2/using_llnode.md index e0234ba..710a794 100644 --- a/documentation/crash/step2/using_llnode.md +++ b/documentation/crash/step2/using_llnode.md @@ -1,5 +1,13 @@ # Using `llnode` for post-mortem debugging +You probably already experienced bugs 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 ### What is post-mortem debugging? @@ -8,13 +16,37 @@ ## Explore your first core dump -### Setup (script we'll use for the tutorial) +### 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 -### Explore objects -### Find object references +### 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`) From f177cc5d9a4ccf67ce4407c621cda28ee03b39b2 Mon Sep 17 00:00:00 2001 From: Tony Gorez Date: Wed, 7 Sep 2022 07:11:41 +0200 Subject: [PATCH 3/3] doc(llnode): delete post-mortem description part --- documentation/crash/step2/using_llnode.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/documentation/crash/step2/using_llnode.md b/documentation/crash/step2/using_llnode.md index 710a794..2a2e6b4 100644 --- a/documentation/crash/step2/using_llnode.md +++ b/documentation/crash/step2/using_llnode.md @@ -1,6 +1,9 @@ # Using `llnode` for post-mortem debugging -You probably already experienced bugs 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. +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. @@ -10,7 +13,9 @@ that will helps you to go thoroughly through this tutorial. ## Concepts -### What is post-mortem debugging? +> ✋ If you familliar with the concept of core dump and `lldb`, +> please skip this chapter, and start [here](#explore-your-firstcore-dump) + ### What is a core dump? ### What is `lldb`?