qarmin / czkawka

Multi functional app to find duplicates, empty folders, similar images etc.
Other
18.36k stars 604 forks source link

strange bug that program appear to be hang after scan completed or stopped #1229

Closed chchia closed 4 months ago

chchia commented 4 months ago

Bug Description latest github source, build following the guide. (i had been doing this since long time ago and it was always working correctly until recently). during hashing stage, if user stop the hashing, or even hashing completed, for large library, the program will appear like hang, but you can still move the czkawka dialog box.

Steps to reproduce:

just scan images for large library, and then stop. image i had been stuck in this interface for more than 12 hours, htop show there is no activity, no high CPU usage nor IO usage.

image

    Finished release [optimized] target(s) in 0.21s
     Running `target/release/czkawka_gui`
16:43:58.849 [INFO] czkawka_core::common: App version: 7.0.0, release mode, rust 1.76.0 (2024-02-04), os Ubuntu 23.10 [x86_64 64-bit], 6 cpu/threads

(czkawka_gui:4566): Gtk-WARNING **: 16:43:58.880: No IM module matching GTK_IM_MODULE=fcitx found
16:43:59.180 [INFO] czkawka_gui: Set thread number to 6

(czkawka_gui:4566): IBUS-WARNING **: 16:43:59.229: Unable to connect to ibus: Could not connect: Connection refused
16:44:05.600 [INFO] czkawka_core::similar_images: find_similar_images
thread '<unnamed>' panicked at czkawka_core/src/similar_images.rs:393:21:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

System

i was thinking that maybe my Linux OS corrupted, so i installed a fresh new Ubuntu.

then i think maybe my database corrupted, i deleted the database in .cache/czkawka folder.

but still the result is same.

qarmin commented 4 months ago

Crash happens in this code https://github.com/qarmin/czkawka/blob/e5a0219bc92db67907923f181b5212526f6b77c5/czkawka_core/src/similar_images.rs#L372-L396

and is caused by using here image with unknown extension - this situation should never happens, because images with known extensions should be used in this code, but somehow happened.

chchia commented 4 months ago

great, since you had traced the issue, i believe you will be able to fix it soon, thanks!