镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Description

@nicolo-ribaudo

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

Activity

  1. added
    confirmed-bugIssues and PRs for confirmed bugs.
    fsIssues and PRs related to file-system APIs and the fs module.
    on Apr 26, 2024
  2. targos commented on Apr 26, 2024

    @targos
    Member

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

  3. nicolo-ribaudo commented on Apr 26, 2024

    @nicolo-ribaudo
    ContributorAuthor

    I'm opening a PR

  4. mojavelinux commented on Apr 26, 2024

    @mojavelinux

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

  5. avivkeller commented on Apr 26, 2024

    @avivkeller
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.fsIssues and PRs related to file-system APIs and the fs module.regressionIssues related to regressions.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions