<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Navneet Gaur</title>
    <description>The latest articles on DEV Community by Navneet Gaur (@navneet_gaur_31432a0a3fd6).</description>
    <link>https://dev.to/navneet_gaur_31432a0a3fd6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2490121%2Fa84d2ce2-1457-4bae-afb5-777f5ace478f.png</url>
      <title>DEV Community: Navneet Gaur</title>
      <link>https://dev.to/navneet_gaur_31432a0a3fd6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/navneet_gaur_31432a0a3fd6"/>
    <language>en</language>
    <item>
      <title>Node.js 20 Upgrade: Segmentation Fault Core Dump During Pipeline Lage Build Step</title>
      <dc:creator>Navneet Gaur</dc:creator>
      <pubDate>Fri, 13 Dec 2024 10:01:23 +0000</pubDate>
      <link>https://dev.to/navneet_gaur_31432a0a3fd6/nodejs-20-upgrade-segmentation-fault-core-dump-during-pipeline-lage-build-step-4bli</link>
      <guid>https://dev.to/navneet_gaur_31432a0a3fd6/nodejs-20-upgrade-segmentation-fault-core-dump-during-pipeline-lage-build-step-4bli</guid>
      <description>&lt;h1&gt;
  
  
  Node.js 20 Upgrade: Segmentation Fault Core Dump During Pipeline Lage Build Step
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Issue Description:
&lt;/h2&gt;

&lt;p&gt;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 &lt;code&gt;yarn lage build bundle&lt;/code&gt; 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to Reproduce:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Use a Linux-based CI agent.&lt;/li&gt;
&lt;li&gt;Execute the following pipeline commands:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   yarn lage build bundle stage-deployment &lt;span class="nt"&gt;--concurrency&lt;/span&gt; 32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Observe the segmentation fault during execution.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Troubleshooting Attempts:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  System Vitals Monitoring:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Monitored memory usage, agent configurations, and system vitals to identify any anomalies.&lt;/li&gt;
&lt;li&gt;Found no indications of memory pressure or system resource limitations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Core Dump Analysis:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Installed Valgrind and a segfault handler to capture and analyze core dump logs.&lt;/li&gt;
&lt;li&gt;Unfortunately, no meaningful insights were captured from the VM or agent machine logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Node Version Update:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Verified and updated all Node.js native modules and dependencies for compatibility with Node.js 20.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Heap Space Configuration:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Ensured no misconfigurations targeting the "new" space in the heap.&lt;/li&gt;
&lt;li&gt;Adjusted heap settings with the following commands:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  node &lt;span class="nt"&gt;--max-old-space-size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8192 dist/server.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Introduced the &lt;code&gt;--max-semi-space-size&lt;/code&gt; parameter to configure the "new" space in the heap.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Node Environment Cleanup:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Removed older versions of Node.js from the environment to prevent conflicts during pipeline execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References Checked and Explored:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Debugging Node.js Segmentation Faults&lt;/li&gt;
&lt;li&gt;Node.js Help Issue #1636&lt;/li&gt;
&lt;li&gt;Node.js 20 Upgrade and Heap Issues&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Request for Assistance:
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Any assistance or guidance would be appreciated.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
