Skip to content

SIGABRT wrong exit code #5994

@alexnu

Description

@alexnu

When the process is killed by the heap limiter, the exit code is incorrectly shown as 0.

Steps to reproduce

Create a test.js file:

const numbers = [];
for (let i = 0; i < 100000000; i++) {
  numbers.push(i);
  if (i % 10000 === 0) console.log(i);
}

Execute the following command to trigger the heap limiter:

pm2 start test.js --no-autorestart --no-daemon --node-args="--max-old-space-size=10"

Expected behaviour

The process should exit with SIGABRT signal and a non-zero code (usually 134).

Actual behaviour

The process exits with SIGABRT signal and 0 code. This makes it impossible to determine whether the process exited normally or with an error:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions