scullionw / dirstat-rs

(fastest?) disk usage cli, similar to windirstat.
MIT License
157 stars 11 forks source link

crashes on windows #3

Closed sarangbaheti closed 2 years ago

sarangbaheti commented 3 years ago

Hi,

Just tried it building from source on windows and it crashes

.\target\release\ds.exe -d 1 D:\scratch\

Analysing: D:\scratch\

thread '<unnamed>' panicked at 'attempted to leave type `nodrop::NoDrop<(epoch::Epoch, garbage::Bag)>` uninitialized, which is invalid', C:\Users\sarangb\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\mem\mod.rs:660:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Tried running with RUST_BACKTRACE=full in vain. I tried replacing par_iter with iter in lib.rs and could make it work, but it was quite slow then.

                let mut sub_items = sub_entries
                    //.iter()
                    .par_iter()
                    .filter_map(|entry| {
                        DiskItem::from_analyze(&entry.path(), apparent, root_dev).ok()
                    })
                    .collect::<Vec<_>>();

Anyway, the directory i am trying to run this on contains 232617 files and ~750 directories- totaling ~135GB of data.

Mart-Bogdan commented 3 years ago

Interesting. Does backtrace shows anything useful?

How this could be reproduced? It's a directory that has itself lots of files?

If using iter helped, I guess bug is in rayon? Perhaps bumping its version would help.

scullionw commented 2 years ago

Hi! Sorry for responding so late. I've updated rayon in an attempt to fix this bug, please reopen if it still occurs for you.