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

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

Closed
GeorgianStan opened this issue Dec 12, 2020 · 12 comments
Closed

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

GeorgianStan opened this issue Dec 12, 2020 · 12 comments
Labels
confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding. windows Issues and PRs related to the Windows platform.

Comments

@GeorgianStan
Copy link

GeorgianStan commented Dec 12, 2020

  • 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

--

@navegador5
Copy link

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

>
>
>

@GeorgianStan
Copy link
Author

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

@targos
Copy link
Member

targos commented Dec 12, 2020

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

@RaisinTen RaisinTen added fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform. labels Dec 12, 2020
@GeorgianStan
Copy link
Author

I tested against Node v14.15.1. Same problem

@Xstoudi
Copy link
Contributor

Xstoudi commented Dec 12, 2020

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

@targos targos added the confirmed-bug Issues with confirmed bugs. label Dec 12, 2020
@targos
Copy link
Member

targos commented Dec 12, 2020

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

@Xstoudi
Copy link
Contributor

Xstoudi commented Dec 29, 2020

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

@targos targos added the libuv Issues and PRs related to the libuv dependency or the uv binding. label Dec 30, 2020
@GeorgianStan
Copy link
Author

Thank you. In what version is the fix available?

@jasnell
Copy link
Member

jasnell commented Mar 5, 2021

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

@pd4d10
Copy link
Contributor

pd4d10 commented May 4, 2021

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

@wwwzbwcom
Copy link
Contributor

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

image

@santigimeno
Copy link
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
Labels
confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

10 participants