-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
std::fs::create_dir_all will stack overflow with big paths #124309
Copy link
Copy link
Closed
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Activity
Metadata
Metadata
Assignees
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: doesn't stack overflow
Instead, this happened:
std::fs::create_dir_allwith a big path with many uncreated directories will stack overflow on Windows. The max path is 32767, which can technically result in ~16383 recursive calls, which will stack overflow the 1mb default stack on Windows.Meta
rustc --version --verbose: