Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[22 regression] Infinite recursion when setting stat.atime #52705

Closed
nicolo-ribaudo opened this issue Apr 26, 2024 · 4 comments · Fixed by #52708
Closed

[22 regression] Infinite recursion when setting stat.atime #52705

nicolo-ribaudo opened this issue Apr 26, 2024 · 4 comments · Fixed by #52708
Labels
confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system. regression Issues related to regressions.

Comments

@nicolo-ribaudo
Copy link
Contributor

Version

v22.0.0

Platform

Linux

Subsystem

fs

What steps will reproduce the bug?

var fs = requre("fs");
var stat = fs.statSync("./package.json")
stat.atime = 2

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

It should work

What do you see instead?

It throws

Uncaught RangeError: Maximum call stack size exceeded
    at Stats.set [as atime] (node:internal/fs/utils:469:18)
    at Stats.set [as atime] (node:internal/fs/utils:469:18)
    at Stats.set [as atime] (node:internal/fs/utils:469:18)
    at Stats.set [as atime] (node:internal/fs/utils:469:18)
    at Stats.set [as atime] (node:internal/fs/utils:469:18)
    at Stats.set [as atime] (node:internal/fs/utils:469:18)
    at Stats.set [as atime] (node:internal/fs/utils:469:18)
    at Stats.set [as atime] (node:internal/fs/utils:469:18)
    at Stats.set [as atime] (node:internal/fs/utils:469:18)

Additional information

@targos targos added confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system. labels Apr 26, 2024
@targos
Copy link
Member

targos commented Apr 26, 2024

Another potential bug is that the property is now read-only (even after you access it once to trigger the getter).

@RedYetiDev RedYetiDev added the regression Issues related to regressions. label Apr 26, 2024
@nicolo-ribaudo
Copy link
Contributor Author

nicolo-ribaudo commented Apr 26, 2024

I'm opening a PR

@mojavelinux
Copy link

I'm seeing the same issue with mtime as well.

@RedYetiDev
Copy link
Member

Yes, the linked PR will fix both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system. regression Issues related to regressions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants