Title: node:fs: calling writeFileSync/appendFileSync with negative 0 causes an assertion failure · Issue #65886 · nodejs/node · GitHub
Open Graph Title: node:fs: calling writeFileSync/appendFileSync with negative 0 causes an assertion failure · Issue #65886 · nodejs/node
X Title: node:fs: calling writeFileSync/appendFileSync with negative 0 causes an assertion failure · Issue #65886 · nodejs/node
Description: Version v26.8.1 Platform Linux nixdesk 6.18.48 #1-NixOS SMP PREEMPT_DYNAMIC Fri Aug 28 06:22:54 UTC 2026 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? require("node:fs").writeFileSync(-0, "") or require("node:fs").appe...
Open Graph Description: Version v26.8.1 Platform Linux nixdesk 6.18.48 #1-NixOS SMP PREEMPT_DYNAMIC Fri Aug 28 06:22:54 UTC 2026 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? require("node:fs").writeFil...
X Description: Version v26.8.1 Platform Linux nixdesk 6.18.48 #1-NixOS SMP PREEMPT_DYNAMIC Fri Aug 28 06:22:54 UTC 2026 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? require("node:fs"...
Opengraph URL: https://github.com/nodejs/node/issues/65886
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"node:fs: calling writeFileSync/appendFileSync with negative 0 causes an assertion failure","articleBody":"### Version\n\nv26.8.1\n\n### Platform\n\n```text\nLinux nixdesk 6.18.48 #1-NixOS SMP PREEMPT_DYNAMIC Fri Aug 28 06:22:54 UTC 2026 x86_64 GNU/Linux\n```\n\n### Subsystem\n\nfs\n\n### What steps will reproduce the bug?\n\n`require(\"node:fs\").writeFileSync(-0, \"\")`\n\nor\n\n`require(\"node:fs\").appendFileSync(-0, \"\")`\n\n### How often does it reproduce? Is there a required condition?\n\nit always happens on my machine. i have not tried on any other computer or os\n\n### What is the expected behavior? Why is that the expected behavior?\n\nfor it to do the same thing as positive zero i assume\n\n### What do you see instead?\n\n```\n❯ echo 'require(\"node:fs\").writeFileSync(-0, \"\")' | node -\n\n # node[264400]: void node::fs::WriteFileUtf8(const v8::FunctionCallbackInfo\u003cv8::Value>&) at ../../src/node_file.cc:2764\n # Assertion failed: (*path) != nullptr\n\n----- Native stack trace -----\n\n 1: 0x629c801c0228 [node]\n 2: 0x629c801c0b97 node::Assert(node::AssertionInfo const&) [node]\n 3: 0x629c801cda7b [node]\n 4: 0x729babdcfae9 \n\n----- JavaScript stack trace -----\n\n1: writeFileSync (node:fs:2997:20)\n2: [stdin]:1:20\n3: runScriptInThisContext (node:internal/vm:219:10)\n4: node:internal/process/execution:485:12\n5: [stdin]-wrapper:6:24\n6: runScriptInContext (node:internal/process/execution:483:60)\n7: evalFunction (node:internal/process/execution:317:30)\n8: evalTypeScript (node:internal/process/execution:329:3)\n9: node:internal/main/eval_stdin:51:5\n10: node:internal/process/execution:239:5\n\n\nfish: Job 1, 'echo 'require(\"node:fs\").writeF…' terminated by signal SIGABRT (Abort)\n```\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/xunuwu","@type":"Person","name":"xunuwu"},"datePublished":"2026-09-07T19:53:23Z","url":"https://github.com/nodejs/node/issues/65886"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2cb8413a-3ce5-34cc-17fe-7d7013aed240 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BBF6:20C6D9:91EF40:C20F9C:6AED2D93 |
| html-safe-nonce | 80503cd7793502c7f700e3836ea6c7dad3587c1f866a43b9c4e5e44ba7630f16 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkY2OjIwQzZEOTo5MUVGNDA6QzIwRjlDOjZBRUQyRDkzIiwidmlzaXRvcl9pZCI6Ijg1ODc2MDkzMjQyNjk2Nzc5NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d2a6c23fadf42ccac8202ae1d5b5922c692aa3c70f519a66d4db0857967871a4 |
| hovercard-subject-tag | issue:5378529220 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/65886/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c7de153604026743863bc7b9832ce72bd1429f851aba2d85d8e780ae56c53930/nodejs/node/issues/65886 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c7de153604026743863bc7b9832ce72bd1429f851aba2d85d8e780ae56c53930/nodejs/node/issues/65886 |
| og:image:alt | Version v26.8.1 Platform Linux nixdesk 6.18.48 #1-NixOS SMP PREEMPT_DYNAMIC Fri Aug 28 06:22:54 UTC 2026 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? require("node:fs").writeFil... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xunuwu |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width