Skip to content

fix,v8: make v8.writeHeapSnapshot throw if fopen/fclose fail#41373

Merged
nodejs-github-bot merged 1 commit intonodejs:masterfrom
kyranet:fix-v8/make-write-heap-snapshot-throw
Jan 12, 2022
Merged

fix,v8: make v8.writeHeapSnapshot throw if fopen/fclose fail#41373
nodejs-github-bot merged 1 commit intonodejs:masterfrom
kyranet:fix-v8/make-write-heap-snapshot-throw

Conversation

@kyranet
Copy link
Contributor

@kyranet kyranet commented Jan 1, 2022

Fixes: #41346

Alternative to #41365, this PR makes v8.writeHeapSnapshot throw if the file could not be written, which can happen inside read-only directories (such as those from Docker containers).

I was not able to make a readonly directory on Windows since I could still write new files to it (is it even possible on Windows?), so I created an empty readonly file instead and made the function attempt to write on it. I ran this function in both Node.js 16.13.1 and the test fails as intended.

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v8.writeHeapSnapshot may return undefined if the file fails to write

9 participants