Skip to content

fix: Isolate and cache process.report.getReport() calls in a child process for robust environment detection#6251

Merged
lukastaegert merged 2 commits intorollup:masterfrom
alan-agius4:header-isolate
Jan 30, 2026
Merged

fix: Isolate and cache process.report.getReport() calls in a child process for robust environment detection#6251
lukastaegert merged 2 commits intorollup:masterfrom
alan-agius4:header-isolate

Conversation

@alan-agius4
Copy link
Contributor

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
Not in this repo.
For some details angular/angular-cli#32234

Description

This refactoring isolates the process.report.getReport() call into a separate child process. This change is necessary because since the introduction of this code, we have observed frequent process crashes on Windows, specifically with the error code -1073740940 (0xC0000374), which corresponds to a Windows heap corruption error.

By moving the report generation to an isolated process, any potential instability or memory corruption is contained and does not affect the main process.

The retrieved report header is cached to ensure that the child process is spawned only once, making this a fast and efficient solution for environment detection.

@vercel
Copy link

vercel bot commented Jan 29, 2026

@alan-agius4 is attempting to deploy a commit to the rollup-js Team on Vercel.

A member of the Team first needs to authorize it.

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.76%. Comparing base (c931d23) to head (4c1a46b).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
native.js 50.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6251      +/-   ##
==========================================
- Coverage   98.83%   98.76%   -0.07%     
==========================================
  Files         273      273              
  Lines       10700    10712      +12     
  Branches     2854     2854              
==========================================
+ Hits        10575    10580       +5     
- Misses         82       89       +7     
  Partials       43       43              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lukastaegert
Copy link
Member

Nice catch. In my experience, though, spawning child processes has quite some performance overhead, which will negatively affect startup time. Maybe we can limit this to windows environments, where the issue was observed, and use the regular call on Linux?

@alan-agius4
Copy link
Contributor Author

Nice catch. In my experience, though, spawning child processes has quite some performance overhead, which will negatively affect startup time. Maybe we can limit this to windows environments, where the issue was observed, and use the regular call on Linux?

SGTM

@alan-agius4 alan-agius4 force-pushed the header-isolate branch 2 times, most recently from 6b87b74 to 500e390 Compare January 29, 2026 18:27
…process for robust environment detection.

This refactoring isolates the `process.report.getReport()` call into a separate child process. This change is necessary because since the introduction of this code, we have observed frequent process crashes on Windows, specifically with the error code -1073740940 (0xC0000374), which corresponds to a Windows heap corruption error.

By moving the report generation to an isolated process, any potential instability or memory corruption is contained and does not affect the main process.

The retrieved report header is cached to ensure that the child process is spawned only once, making this a fast and efficient solution for environment detection.
Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good.

@vercel
Copy link

vercel bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rollup Ready Ready Preview, Comment Jan 30, 2026 6:19am

Request Review

@lukastaegert lukastaegert merged commit 5e393e3 into rollup:master Jan 30, 2026
45 of 47 checks passed
@github-actions
Copy link

This PR has been released as part of rollup@4.57.1. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants