mirror of
https://github.com/openwall/john.git
synced 2026-12-03 20:43:49 +07:00
[GH-ISSUE #2652] descrypt-opencl slow and confusing startup at many salts (appears stalled) #1719
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1719
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aguvillalba on GitHub (Aug 4, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2652
When trying to execute:
./john --test=0 --format=descrypt-opencl --device=0I got this output:
When trying to crack using --format=descrypt-opencl I get the same output.
Here my info for ./john --list=build-info:
@roycewilliams commented on GitHub (Aug 4, 2017):
What about that output indicates that it's not working?
You asked it to run a test with no time (--test=0). That's what it did. :) The rest of the diagnostic output looks normal for a first run.
Give it a non-zero time and you'll get actual results:
@aguvillalba commented on GitHub (Aug 4, 2017):
Why do I still get this output when execute this command:
./john --format=descrypt-opencl --min-length=8 --progress-every=10 --device=0 ~/jonny.txt
Is it normal?
@roycewilliams commented on GitHub (Aug 4, 2017):
Yes, the first time you run for a given compilation of John and hash format. If you run it again, the output should be less verbose.
@aguvillalba commented on GitHub (Aug 4, 2017):
It happens every time I run that exact command. Also, if I run the same command but in the not opencl version, the output looks fine:
./john --format=descrypt --min-length=8 --progress-every=10 --device=0 ~/jonny.txt
Why the output for "non opencl" version of the command works fine?
@roycewilliams commented on GitHub (Aug 4, 2017):
Because the OpenCL kernel is not compiled dynamically on non-OpenCL attacks.
The issue is just cosmetic, correct? The OpenCL version of the attack still happens, even if the output is not what you expect?
@aguvillalba commented on GitHub (Aug 4, 2017):
I do not know. I do not think that it is working in the opencl version. At least in the non-opencl version I get some passwords cracked, but in the opencl version I get none.
Is the output that I showed in the messages above an error or just comestic?
@aguvillalba commented on GitHub (Aug 4, 2017):
Also, if I execute the test, I got this:
./john --test=20 --format=descrypt-opencl --device=0
Does it mean that there is something wrong?
@kost123 commented on GitHub (Aug 5, 2017):
I get it aswell in another format, pretty sure it's just debug info.
@ghost commented on GitHub (Aug 5, 2017):
~/.nvin your computer?CUDA_CACHE_DISABLE?Or, if you wish, run:
The output is harmless (it is only debug info). But, it is not expected to appear for every run, unless cache is disabled.
@ghost commented on GitHub (Aug 5, 2017):
Inside your https://github.com/magnumripper/JohnTheRipper/issues/2652#issuecomment-320325124 above, I noticed John printed Session aborted before any status line.
-verb=5to the command line) and post the results.BTW: you can hide the build log decreasing the verbosity.
@aguvillalba commented on GitHub (Aug 5, 2017):
Hi @claudioandre, thank you very much for your replies.
I run the commands you mentioned:
The 1st run during 2 minutes. And I have the same results:
1st run:
2nd run:
By the way, when running the commands, I cannot press 'q' to cancel the execution, only Ctrl+C works.
@aguvillalba commented on GitHub (Aug 5, 2017):
@claudioandre, yes, this happens everytime I run the command, always.
I have run it with --verbosity=5 and this is the output:
Any clue what is going on? Thanks for any help!
@aguvillalba commented on GitHub (Aug 5, 2017):
From the logs I pasted above, it seems to me that the cracking is not working and nothing is going on. Am I wrong?
@solardiz commented on GitHub (Aug 5, 2017):
This is an instance of what I described in a paragraph in #2613:
"Also, at the default verbosity level it is no longer clear what the process is doing - it appears to be stuck for minutes. Perhaps we should print at least one informational line about building the per-salt kernels (as well as how to disable this if the startup delay is undesirable and slower long-time speed would be OK?) even at default or otherwise low verbosity levels."
In short: our descrypt-opencl tries to optimize for lengthy runs or/and low salt counts, by building per-salt kernels. It'll take an hour or so for it to get up to speed when there are thousands of salts (up to the maximum of 4096). This is indeed a major usability drawback, and we should provide a way to disable this functionality - in fact, we should probably have it disabled by default when cracking multiple salts (more than 1? or more than some other low threshold?), with a message printed on how to re-enable it to regain the speedup for lengthy sessions.
@solardiz commented on GitHub (Aug 5, 2017):
IIRC, in some older version of Sayantan's code, the per-salt kernels were being built along with cracking using the already-built kernels (as well as the generic kernel for the rest of salts, where no specialized kernel was built yet?) Looks like we've since lost that, and now there appears to be no progress at all until all kernels are built. Maybe we lost it when attempting to parallelize the kernel builds with OpenMP.
This may explain why we had found it acceptable to have the per-salt kernels enabled by default before, and why (at least) I no longer find it acceptable now (except when there's just one or few salts). As an option, we could try to revert to that previous approach where cracking and specialized kernel building could proceed in parallel, and if so we wouldn't necessarily have to change the default (but would still need to print explanatory messages, along with instructions on how to disable the per-salt kernels).
@solardiz commented on GitHub (Aug 5, 2017):
Meanwhile, the advice for @aguvillalba is to leave this running for some hours. It'll eventually start making progress and gain speed.
@aguvillalba commented on GitHub (Aug 5, 2017):
@solardiz you are right, it was compiling salts during 24 minutes, after that it started to crack passwords.
Thank you very much for the help!
@ghost commented on GitHub (Aug 5, 2017):
All per-salt kernels are being build at once inside
reset().An easy and acceptable workaround is the patch below.
@ghost commented on GitHub (Aug 5, 2017):
The output is clear and the cursor rotates nicely (tested using the default verbosity).
@aguvillalba commented on GitHub (Aug 5, 2017):
@claudioandre that would be a good solution! At least the user knows what to expect. Although, I would remove the "WARNING" word and change it to "INFO", because the message is not really a warning from the execution, is just information.
Thank you very much!
@ghost commented on GitHub (Aug 5, 2017):
The threshold (16) and the text are subject to change.
BTW: It seems my
ifis pure Python !?!?@solardiz commented on GitHub (Aug 6, 2017):
Thank you, Claudio. Can we make it simply:
This looks more consistent with other messages we print: we already use the "Note: " prefix on some, and we print them to stderr. It also sets more specific expectations, consistent with how current computers actually perform.
@ghost commented on GitHub (Aug 6, 2017):
This is more close to a real patch.
@solardiz commented on GitHub (Aug 6, 2017):
Claudio, the added
ifblock should be above the existing#pragma ompdirective.Yes, the "> 1" is inconsistent with the self-tests already triggering multiple builds, but printing that message when there's just 1 salt in the input would be confusing. So I think it's fine to keep the "> 1" as-is.
@solardiz commented on GitHub (Aug 7, 2017):
Claudio fixed the confusion aspect, so closing this issue. We'll need separate issues for tracking more invasive changes we might want to make.
@solardiz commented on GitHub (Aug 14, 2017):
At default verbosity level, the many "ptxas info ..." lines are printed (and so the "Note: ..." is buried inbetween them - after the self-test ones and before the rest - and quickly scrolls away), but the "Salt compiled from ..." lines are not. That's confusing. I think it should be the other way around: can we, specifically for descrypt-opencl, suppress the OpenCL backend's build messages by default (unless verbosity is increased), but enable the "Salt compled from ..." messages? Claudio? (Maybe this should be a new issue - if so, feel free to create one and re-close this one.)
@magnumripper commented on GitHub (Aug 14, 2017):
@solardiz can we close this again now that #2665 was merged?
@solardiz commented on GitHub (Aug 14, 2017):
OK. I'm fine with not enabling the "Salt compiled from ..." at default verbosity. Closing.