DEV Community

Navneet Gaur
Navneet Gaur

Posted on

Node.js 20 Upgrade: Segmentation Fault Core Dump During Pipeline Lage Build Step

Node.js 20 Upgrade: Segmentation Fault Core Dump During Pipeline Lage Build Step

Issue Description:

We are encountering segmentation fault (core dump) when running our pipeline after upgrading to Node.js 20. This issue specifically arises during the execution of yarn lage build bundle steps on a Linux-based CI agent. The core dump logs do not provide sufficient insights into the root cause. This behaviour was not observed prior when running with Node.js 18, it's only been seen when we are trying to upgrade from Node 18.15.0 to Node 20.15.0.

Steps to Reproduce:

  1. Use a Linux-based CI agent.
  2. Execute the following pipeline commands:
   yarn lage build bundle stage-deployment --concurrency 32
Enter fullscreen mode Exit fullscreen mode
  1. Observe the segmentation fault during execution.

Troubleshooting Attempts:

System Vitals Monitoring:

  • Monitored memory usage, agent configurations, and system vitals to identify any anomalies.
  • Found no indications of memory pressure or system resource limitations.

Core Dump Analysis:

  • Installed Valgrind and a segfault handler to capture and analyze core dump logs.
  • Unfortunately, no meaningful insights were captured from the VM or agent machine logs.

Node Version Update:

  • Verified and updated all Node.js native modules and dependencies for compatibility with Node.js 20.

Heap Space Configuration:

  • Ensured no misconfigurations targeting the "new" space in the heap.
  • Adjusted heap settings with the following commands:
  node --max-old-space-size=8192 dist/server.js
Enter fullscreen mode Exit fullscreen mode
  • Introduced the --max-semi-space-size parameter to configure the "new" space in the heap.

Node Environment Cleanup:

  • Removed older versions of Node.js from the environment to prevent conflicts during pipeline execution.

References Checked and Explored:

  • Debugging Node.js Segmentation Faults
  • Node.js Help Issue #1636
  • Node.js 20 Upgrade and Heap Issues

Request for Assistance:

We have tried multiple of the above troubleshooting approaches but are still unable to resolve this issue. If anyone has encountered similar segmentation faults with Node.js 20 or has suggestions for further debugging, please share your thoughts.

Any assistance or guidance would be appreciated.

Top comments (0)