Use index rather than telldir/seekdir to represent fd_readdir cookie#298
Merged
cjihrig merged 4 commits intonodejs:mainfrom May 29, 2025
Merged
Use index rather than telldir/seekdir to represent fd_readdir cookie#298cjihrig merged 4 commits intonodejs:mainfrom
telldir/seekdir to represent fd_readdir cookie#298cjihrig merged 4 commits intonodejs:mainfrom
Conversation
Collaborator
|
@CPunisher can you rebase this or force push. GitHub isn't giving me the option to start the CI. |
e40e42f to
830670a
Compare
cjihrig
approved these changes
May 29, 2025
Merged
aduh95
added a commit
that referenced
this pull request
Sep 2, 2025
Notable changes: - Disallow malformed path with null byte (#266) (7aaa0b4) - Preserve trailing slash in file path (#268) (afffaaa) - Disallow absolute path at the raw WASI level (#270) (9811374) - Error if creating symlink to absolute path (#272) (c8d4f01) - Add cflite and document normalize path (#280) (6eeddba) - Resolve old_path in uvwasi_path_symlink() (#303) (98da5ad) - Use index rather than `telldir`/`seekdir` to represent `fd_readdir` cookie (#298) (392e1f1) - fix: static library name (#305) (146e516) - fix: do not put header files in a subfolders (#302) (ec28b58) - fix: explicitly export symbols (#308) (4e9b4e0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: nodejs/node#47193
How
telldirandseekdirwork depends on the operating system. For example, in ubuntu,telldirreturns a relative pos of current dirent iterator. But in macos,telldirreturns a self-incrementing counter, which is only valid for oneDIR*.The issue is that every single call to
fd_readdiropens and closes the dir, so the cookie becomes invalid on the next call, thus getting infinite loop.