Unitech / Unitech/pm2

PM2 crashes with SIGSEGV(backtrace included)

Open
#4,859 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

What's going wrong?

SIGSEGV signal on pm2

How could we reproduce this issue?

I don't know

Supporting information

My app : pm2 cluster mode
pm2 version 4.4.1
nodejs version 10.22.0

backtrace log
frame #7: 0x000021dda725be1d
frame #8: 0x000021dda797c7e0 (anonymous)(this=0xb0de9c026f1:, 0x3dbda182251:<Number: 1.482158>, 0x3dbda182241:<Number: 1.468564>) at /usr/lib/node_modules/pm2/node_modules/@pm2/io/build/main/utils/metrics/histogram.js:55:28 fn=0x000003dbda182201
frame #9: 0x000021dda797ce7c QuickSort(this=0xb0de9c026f1:, 0x3dbda182301:<Array: length=1028>, <Smi: 830>, <Smi: 849>) at native array.js:1:10 fn=0x000003dbda1822c1
frame #10: 0x000021dda797d15e QuickSort(this=0xb0de9c026f1:, 0x3dbda182301:<Array: length=1028>, <Smi: 0>, <Smi: 1028>) at native array.js:1:10 fn=0x000003dbda1822c1
frame #11: 0x000021dda77c98aa InnerArraySort(this=0xb0de9c026f1:, 0x3dbda182301:<Array: length=1028>, <Smi: 1028>, 0x3dbda182201:<function: (anonymous) at /usr/lib/node_modules/pm2/node_modules/@pm2/io/build/main/utils/metrics/histogram.js:55:28>) at native array.js:1:10 fn=0x0000312a690062c9
frame #12: 0x000021dda77d5785 sort(this=0x3dbda182301:<Array: length=1028>, 0x3dbda182201:<function: (anonymous) at /usr/lib/node_modules/pm2/node_modules/@pm2/io/build/main/utils/metrics/histogram.js:55:28>) at native array.js:1:10 fn=0x0000312a690058a1
frame #13: 0x000021dda79b93ad handler(this=0xf45a972aa41:<Object: Object>) at /usr/lib/node_modules/pm2/node_modules/@pm2/io/build/main/metrics/eventLoopMetrics.js:77:31 fn=0x00000f45a972db99
frame #14: 0x000021dda77c9b9e timer.setInterval(this=0x3f36612726a1:<Object: Timeout>) at /usr/lib/node_modules/pm2/node_modules/@pm2/io/build/main/services/metrics.js:54:34 fn=0x00003f3661272891
frame #15: 0x000021dda77c306d processTimers(this=0x17f3d1404ed1:<Object: Timer>, <Smi: 109849056>) at timers.js:98:18 fn=0x00002f2519805149
frame #16: 0x000021dda720ee75
frame #17: 0x000021dda72092c1

PM2 report

PM2 | 2020-09-20T12:25:29: PM2 log: Worker Interval : 30000
PM2 | 2020-09-20T12:25:29: PM2 log: Process dump file : /root/.pm2/dump.pm2
PM2 | 2020-09-20T12:25:29: PM2 log: Concurrent actions : 2
PM2 | 2020-09-20T12:25:29: PM2 log: SIGTERM timeout : 1600
PM2 | 2020-09-20T12:25:29: PM2 log: ===============================================================================
PM2 | 2020-09-20T12:25:30: PM2 log: App [pm2-logrotate:0] starting in -fork mode-
PM2 | 2020-09-20T12:25:30: PM2 log: App [pm2-logrotate:0] online
PM2 | 2020-09-20T12:25:31: PM2 log: [Watch] Start watching cagent
PM2 | 2020-09-20T12:25:31: PM2 log: App [cagent:1] starting in -cluster mode-
PM2 | 2020-09-20T12:25:31: PM2 log: App [cagent:1] online
PM2 | 2020-09-20T12:25:32: PM2 log: [Watch] Start watching cagent
PM2 | 2020-09-20T12:25:32: PM2 log: App [cagent:2] starting in -cluster mode-
PM2 | 2020-09-20T12:25:32: PM2 log: App [cagent:2] online
PM2 | 2020-09-20T12:25:32: PM2 log: [Watch] Start watching cagent
PM2 | 2020-09-20T12:25:32: PM2 log: App [cagent:3] starting in -cluster mode-
PM2 | 2020-09-20T12:25:33: PM2 log: App [cagent:3] online
PM2 | 2020-09-21T18:56:22: PM2 log: App name:cagent id:2 disconnected
PM2 | 2020-09-21T18:56:22: PM2 log: App [cagent:2] exited with code [0] via signal [SIGSEGV]
PM2 | 2020-09-21T18:56:22: PM2 log: App [cagent:2] starting in -cluster mode-
PM2 | 2020-09-21T18:56:22: PM2 log: App [cagent:2] online

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the backtrace locations in @pm2/io/build/main/utils/metrics/histogram.js, eventLoopMetrics.js, and services/metrics.js, alongside the reported Node.js 10.22.0 and PM2 4.4.1 versions. Establish a reproducible case for the cluster-mode SIGSEGV, then verify that the relevant metrics path no longer crashes under the reported setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.