jonelo / jacksum

A hash utility, est. 2002, FLOSS. 489 hash functions, HMAC support, cross platform, feature-rich, multi threaded. CLI and API. Recursive hashing, predefined and customizable formats, verify data integrity and find ok/failed/missing/new files, find files by their hashes, find the hash function to a hash. GUI provided by HashGarten.
https://jacksum.net
GNU General Public License v3.0
43 stars 5 forks source link

Regression: Jacksum 3.0.0 to 3.4.0 hangs while trying to read NTUSER.DAT on Microsoft Windows if more than one algo has been selected #24

Closed jonelo closed 1 year ago

jonelo commented 1 year ago

Describe the bug Jacksum 3.0.0 to 3.4.0 hangs while trying to read NTUSER.DAT on Microsoft Windows. Issue occurs in concurrency mode only, i. e. if more than one algo has been selected.

To Reproduce

C:\Users\Johann>jacksum34 -a md5+sha256 -V all -r 1 .
...
.\NTUSER.DAT (Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird)
java.io.FileNotFoundException: .\NTUSER.DAT (Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird)
        at java.base/java.io.FileInputStream.open0(Native Method)
        at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
        at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
        at net.jacksum.multicore.manyalgos.DataReader.run(DataReader.java:78)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)

process hangs.

Expected behavior it should not hang, but print out the error only and continue.

Jacksum: Error: .\NTUSER.DAT (Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird)

Screenshots n/a

Environment (please complete the following information): n/a

Additional context n/a

jonelo commented 1 year ago

Workaround:

C:\Users\Johann>java -Djacksum.concurrency.manyalgos=false -jar \Applications\jacksum-3.4.0\jacksum-3.4.0.jar -a md5+sha256 -V all -r 1 .
jonelo commented 1 year ago

fixed.