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

Panic in push: called Option::unwrap() on a None value #123

Closed
LukasKalbertodt opened this issue Jul 10, 2019 · 3 comments
Closed

Panic in push: called Option::unwrap() on a None value #123

LukasKalbertodt opened this issue Jul 10, 2019 · 3 comments

Comments

@LukasKalbertodt
Copy link
Contributor

I tried using cargo-sweep but it panics for me:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
   7: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:384
   8: rust_begin_unwind
             at src/libstd/panicking.rs:311
   9: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  10: core::panicking::panic
             at src/libcore/panicking.rs:49
  11: core::option::Option<T>::unwrap
             at /rustc/088b987307b91612ab164026e1dcdd0129fdb62b/src/libcore/macros.rs:12
  12: walkdir::IntoIter::push
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/walkdir-2.2.6/src/lib.rs:875
  13: walkdir::IntoIter::handle_entry
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/walkdir-2.2.6/src/lib.rs:845
  14: <walkdir::IntoIter as core::iter::traits::iterator::Iterator>::next
             at /home/lukas/.cargo/registry/src/github.com-1ecc6299db9ec823/walkdir-2.2.6/src/lib.rs:710
  15: cargo_sweep::find_cargo_projects
             at src/main.rs:83
  16: cargo_sweep::main
             at src/main.rs:223
  17: std::rt::lang_start::{{closure}}
             at /rustc/088b987307b91612ab164026e1dcdd0129fdb62b/src/libstd/rt.rs:64
  18: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  19: std::panicking::try::do_call
             at src/libstd/panicking.rs:296
  20: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:82
  21: std::panicking::try
             at src/libstd/panicking.rs:275
  22: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  23: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  24: std::rt::lang_start
             at /rustc/088b987307b91612ab164026e1dcdd0129fdb62b/src/libstd/rt.rs:64
  25: main

The problem seems to be this statement:

walkdir/src/lib.rs

Lines 898 to 900 in f85554d

let free = self.stack_list
.len()
.checked_sub(self.oldest_opened).unwrap();

If I should try to find more information about the problem, just tell me!

@BurntSushi
Copy link
Owner

BurntSushi commented Jul 10, 2019

This is a duplicate of #118. If you can provide a reproduction, then I'd be happy to re-open #118. But as it stands, I see no way to reproduce this on my end. (What command did you run? On what directory? Can you reproduce it on a directory hierarchy that I can also see?)

@LukasKalbertodt
Copy link
Contributor Author

@BurntSushi Thanks for the quick reply and sorry for not checking for dupes before! I will try to find a reproducible example and post it into #118.

@BurntSushi
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants