Skip to content

fs.mkdir with recursive option and invalid name hangs the program #36490

Description

@GeorgianStan
  • Version: v12.18.0
  • Platform: Windows10
  • Subsystem:

What steps will reproduce the bug?

const fs = require("fs");
const path = "./to-delete/s:d";

fs.mkdir(path, { recursive: true }, (err) => {
  if (err) {
    console.log(err);
    return;
  }
  console.log("success");
});

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

Using : (double dots) character in folder name after the first prefix will make the program freeze

What is the expected behavior?

Throw an error

What do you see instead?

The program hangs

Additional information

--

Activity

  1. navegador5 commented on Dec 12, 2020

    @navegador5

    is this only happened in windows enviroment ?

    i tsted in linux,it works

    
    Welcome to Node.js v12.18.2.
    Type ".help" for more information.
    > const fs = require("fs");
    undefined
    > const path = "./to-delete/s:d";
    undefined
    > fs.mkdir(path, { recursive: true }, (err) => {
    ...   if (err) {
    .....     console.log(err);
    .....     return;
    .....   }
    ...   console.log("success");
    ... });
    undefined
    > success
    
    >
    >
    >
    
  2. GeorgianStan commented on Dec 12, 2020

    @GeorgianStan
    Author

    I'm not able to test it on linux. I've only tested it in Windows 10

  3. targos commented on Dec 12, 2020

    @targos
    Member

    Can you test with the latest 12.x version? I remember this issue and I think it was fixed recently .

  4. added
    fsIssues and PRs related to file-system APIs and the fs module.
    windowsIssues and PRs related to the Windows platform.
    on Dec 12, 2020
  5. GeorgianStan commented on Dec 12, 2020

    @GeorgianStan
    Author

    I tested against Node v14.15.1. Same problem

  6. Xstoudi commented on Dec 12, 2020

    @Xstoudi
    Contributor

    I can confirm it happens on v12.20.0 and v14.15.1.

  7. targos commented on Dec 12, 2020

    @targos
    Member

    It seems to be the same issue as #31177.
    libuv/libuv#2601 is supposed to fix it.

  8. Xstoudi commented on Dec 29, 2020

    @Xstoudi
    Contributor

    The fix landed yesterday in libuv: libuv/libuv@dd8662b

  9. added
    libuvIssues and PRs related to the libuv dependency or the uv binding.
    on Dec 30, 2020
  10. GeorgianStan commented on Jan 2, 2021

    @GeorgianStan
    Author

    Thank you. In what version is the fix available?

  11. jasnell commented on Mar 5, 2021

    @jasnell
    Member

    Can confirm that the issue has been fixed in the 15.x line at least. Not sure about 14.x or 12.x.

  12. pd4d10 commented on May 4, 2021

    @pd4d10
    Contributor

    Can confirm it still happens on v12.22.1 and v14.16.1

  13. wwwzbwcom commented on Jul 9, 2021

    @wwwzbwcom
    Contributor

    Seem like this has been solved in the latest master branch version

    image

  14. santigimeno commented on Nov 5, 2022

    @santigimeno
    Member

    This should be fixed in all active releases as the fix was released in libuv 1.41.0.

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.libuvIssues and PRs related to the libuv dependency or the uv binding.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions