Title: fs.realpath infinite loop · Issue #60295 · nodejs/node · GitHub
Open Graph Title: fs.realpath infinite loop · Issue #60295 · nodejs/node
X Title: fs.realpath infinite loop · Issue #60295 · nodejs/node
Description: Version v25.0.0 Platform uname -a Linux [hostname] 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? $ mkdir test $ cd test $ mkdir -p a/b/{c...
Open Graph Description: Version v25.0.0 Platform uname -a Linux [hostname] 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? ...
X Description: Version v25.0.0 Platform uname -a Linux [hostname] 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? ...
Opengraph URL: https://github.com/nodejs/node/issues/60295
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fs.realpath infinite loop","articleBody":"### Version\n\nv25.0.0\n\n### Platform\n\n```text\nuname -a\nLinux [hostname] 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux\n```\n\n### Subsystem\n\nfs\n\n### What steps will reproduce the bug?\n\n```\n$ mkdir test\n$ cd test\n$ mkdir -p a/b/{c,d}\n$ ln -s a/b/c # Make symlink to c dir in a/b\n$ ln -s \"c/../d\" # Make symlink to d dir via c symlink\n$ node -e \"const fs = require('fs'); console.log(fs.realpathSync('d'));\"\n```\nThe `node` call never returns. If I call it with `strace` it's just checking the same file over and over:\n```\n...\nstatx(AT_FDCWD, \"/home/niko/test/d\", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFLNK|0777, stx_size=6, ...}) = 0\nstatx(AT_FDCWD, \"/home/niko/test/d\", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFLNK|0777, stx_size=6, ...}) = 0\n...\n```\n\n### How often does it reproduce? Is there a required condition?\n\nReproduces every time.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nExpected behavior is that the realpath would be printed to the console:\n```\n$ node -e \"const fs = require('fs'); console.log(fs.realpathSync('d'));\"\n/home/niko/test/a/b/d\n```\n\nNote that `realpathSync.native` does work properly:\n```\n$ node -e \"const fs = require('fs'); console.log(fs.realpathSync.native('d'));\"\n/home/niko/test/a/b/d\n```\n\n### What do you see instead?\n\nAn infinite loop (see Steps section above).\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/adzenith","@type":"Person","name":"adzenith"},"datePublished":"2025-10-17T13:14:48Z","url":"https://github.com/nodejs/node/issues/60295"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:1a6116d0-990e-d2df-b9c3-fda59e99b508 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF26:33F13D:DEC2AE:1324C65:6AFBF266 |
| html-safe-nonce | ed75ccc685218262c5cd3d78a569712c50387a6fd357fe978c1e688e34cd239d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjI2OjMzRjEzRDpERUMyQUU6MTMyNEM2NTo2QUZCRjI2NiIsInZpc2l0b3JfaWQiOiI1Mzg3NjkxNDc2MDU4MDc3MTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 65e45dbea66f37cfeee35f3215d56f91abecc1b440d45b130ec54437ab9f3152 |
| hovercard-subject-tag | issue:3526145422 |
| 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/60295/issue_layout |
| twitter:image | https://opengraph.githubassets.com/455dcae1f2911385f59e90b1344e475cc30c701fe8b8e1572395767fa99aab97/nodejs/node/issues/60295 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/455dcae1f2911385f59e90b1344e475cc30c701fe8b8e1572395767fa99aab97/nodejs/node/issues/60295 |
| og:image:alt | Version v25.0.0 Platform uname -a Linux [hostname] 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adzenith |
| hostname | github.com |
| expected-hostname | github.com |
| None | fa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f |
| 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 | b3b5633a74535d9c23385512d534c66c8fde1907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width