Skip to content

std::sys::imp::fs::remove_dir_all #43768

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

Closed
trombonehero opened this issue Aug 9, 2017 · 3 comments
Closed

std::sys::imp::fs::remove_dir_all #43768

trombonehero opened this issue Aug 9, 2017 · 3 comments
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@trombonehero
Copy link

On FreeBSD 12-CURRENT, the std::sys::imp::fs::remove_dir_all_recursive function can suffer from infinite recursion. I bumped into this problem when running cargo test in the gcc-rs crate, but it seems like a more general problem: I should think that a recursive function would include base-case tests to avoid infinite recursion. Running cargo test causes a core file to be emitted; running this through lldb yields:

[... a couple of thousand lines of backtrace ...]
frame #2040: 0x00000000010e96df cc_env-7bd47b4ac897ea8e`std::sys::imp::fs::remove_dir_all_recursive at fs.rs:672
frame #2041: 0x00000000010e96df cc_env-7bd47b4ac897ea8e`std::sys::imp::fs::remove_dir_all_recursive at fs.rs:672
frame #2042: 0x00000000010e96df cc_env-7bd47b4ac897ea8e`std::sys::imp::fs::remove_dir_all_recursive at fs.rs:672
frame #2043: 0x00000000010e955b cc_env-7bd47b4ac897ea8e`std::sys::imp::fs::remove_dir_all at fs.rs:664
frame #2044: 0x0000000001051286 cc_env-7bd47b4ac897ea8e`std::fs::remove_dir_all::hece5f45f7740fcc3 + 70
frame #2045: 0x0000000001057e3f cc_env-7bd47b4ac897ea8e`tempdir::TempDir::cleanup_dir::ha833124c67f05942 + 79
frame #2046: 0x0000000001057e74 cc_env-7bd47b4ac897ea8e`_$LT$tempdir..TempDir$u20$as$u20$core..ops..drop..Drop$GT$::drop::hf7d24f98e7c69fab + 36
frame #2047: 0x0000000001045765 cc_env-7bd47b4ac897ea8e`core::ptr::drop_in_place<tempdir::TempDir>((null)=0x00007fffdfffd5b0) at ptr.rs:61
frame #2048: 0x0000000001046425 cc_env-7bd47b4ac897ea8e`core::ptr::drop_in_place::hb964672cda22d903 + 21
frame #2049: 0x000000000104ec66 cc_env-7bd47b4ac897ea8e`cc_env::support::Test::gnu::ha935bcf832b37c65 + 134

In terms of my currently-running version, rustup show yields:

Default host: x86_64-unknown-freebsd

installed toolchains
--------------------

stable-x86_64-unknown-freebsd
nightly-x86_64-unknown-freebsd (default)

active toolchain
----------------

nightly-x86_64-unknown-freebsd (default)
rustc 1.21.0-nightly (cbbe17aa7 2017-08-07)
@trombonehero
Copy link
Author

Also, rustc --version --verbose gives me:

rustc 1.21.0-nightly (cbbe17aa7 2017-08-07)
binary: rustc
commit-hash: cbbe17aa7f13f9568a652c2180de03fa6881b86a
commit-date: 2017-08-07
host: x86_64-unknown-freebsd
release: 1.21.0-nightly
LLVM version: 4.0

@sfackler
Copy link
Member

sfackler commented Aug 9, 2017

The base case is no further directories in the directory being deleted. This looks like a duplicate of #42681.

@Mark-Simulacrum Mark-Simulacrum added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Aug 10, 2017
@Mark-Simulacrum
Copy link
Member

I'm going to close in favor of #42681.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants