[GH-ISSUE #2613] descrypt-opencl wrongly triggers "Progress is too slow!! trying next table size." #1704

Open
opened 2026-10-15 04:22:53 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @solardiz on GitHub (Jul 5, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2613

Originally assigned to: @sayan1an on GitHub.

Normally, "Progress is too slow!! trying next table size." would be triggered when there are a lot of hashes with an unsalted hash type, or for a given salt. However, it is also triggered with descrypt-opencl running against our test pw-fake-unix (3269 password hashes with 2243 different salts). I guess this is because building the per-salt kernels does indeed make the progress slow (until all kernels are built), and this confuses Sayantan's perfect hash tables code. Perhaps we should special-case this.

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.

Originally created by @solardiz on GitHub (Jul 5, 2017). Original GitHub issue: https://github.com/openwall/john/issues/2613 Originally assigned to: @sayan1an on GitHub. Normally, "Progress is too slow!! trying next table size." would be triggered when there are a lot of hashes with an unsalted hash type, or for a given salt. However, it is also triggered with descrypt-opencl running against our test pw-fake-unix (3269 password hashes with 2243 different salts). I guess this is because building the per-salt kernels does indeed make the progress slow (until all kernels are built), and this confuses Sayantan's perfect hash tables code. Perhaps we should special-case this. 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.
Author
Owner

@solardiz commented on GitHub (Aug 7, 2017):

#2655 took care of "we should print at least one informational line about building the per-salt kernels".

<!-- gh-comment-id:320652827 --> @solardiz commented on GitHub (Aug 7, 2017): #2655 took care of "we should print at least one informational line about building the per-salt kernels".
Author
Owner

@sayan1an commented on GitHub (Aug 7, 2017):

Hi Guys,

I'm sorry that I cannot actively debug this issue but I can definitely give you some pointers regrading what to look for.

For starters, create_perfect_hash_table() is not thread safe. So, if you are putting this function in an openMP loop or any other shared memory architecture, please wrap the function within a critical section.

I quickly went though the current des opencl and it didn't seem like we are running create_perfect_hash_table() from an OpenMP loop but please recheck though. Since we are building salts in parallel, my guess is somehow we are building the hash table for each salt in parallel? In that case it is the first problem which needs fixing.

Second, "Progress is too slow!! trying next table size." is triggered when there are lot of hashes per salt which is a legitimate reason for showing this error.

Third, "Progress is too slow!! trying next table size." could be triggered when the duplicate removal code in the bt_hash_type_64.c is not working. In that case, try to print the loaded_hashes_64[] array before and after calling remove_duplicates_64() function. I highly doubt the error is in remove_duplicates_64(), but should be checked nonetheless. The remove_duplicates_64() function removes duplicate hashes and returns the number of unique hashes. The output hashes are compressed to occupy contiguous memory locations in loaded_hashes_64[] array.

Finally, it could be that when there are too few hashes, the timer for printing "Progress is too slow!! trying next table size." runs out too quickly. In that case check bt.c line 398. Increase the alarm from 3 seconds to a higher value. Although, 3 seconds is ample time but maybe there are some issues with system calls and the alarm is sounded too quickly.

<!-- gh-comment-id:320721882 --> @sayan1an commented on GitHub (Aug 7, 2017): Hi Guys, I'm sorry that I cannot actively debug this issue but I can definitely give you some pointers regrading what to look for. For starters, create_perfect_hash_table() is not thread safe. So, if you are putting this function in an openMP loop or any other shared memory architecture, please wrap the function within a critical section. I quickly went though the current des opencl and it didn't seem like we are running create_perfect_hash_table() from an OpenMP loop but please recheck though. Since we are building salts in parallel, my guess is somehow we are building the hash table for each salt in parallel? In that case it is the first problem which needs fixing. Second, "Progress is too slow!! trying next table size." is triggered when there are lot of hashes per salt which is a legitimate reason for showing this error. Third, "Progress is too slow!! trying next table size." could be triggered when the duplicate removal code in the bt_hash_type_64.c is not working. In that case, try to print the loaded_hashes_64[] array before and after calling remove_duplicates_64() function. I highly doubt the error is in remove_duplicates_64(), but should be checked nonetheless. The remove_duplicates_64() function removes duplicate hashes and returns the number of unique hashes. The output hashes are compressed to occupy contiguous memory locations in loaded_hashes_64[] array. Finally, it could be that when there are too few hashes, the timer for printing "Progress is too slow!! trying next table size." runs out too quickly. In that case check bt.c line 398. Increase the alarm from 3 seconds to a higher value. Although, 3 seconds is ample time but maybe there are some issues with system calls and the alarm is sounded too quickly.
Author
Owner

@solardiz commented on GitHub (Aug 7, 2017):

Thank you for your comments, Sayantan!

While there's support for building of per-salt kernels in parallel, that support is currently disabled for other reasons (IIRC, there were issues with vendors' OpenCL backends triggered by the parallel builds).

I think the problem is simpler than what you describe: the timer (3 seconds as you say) somehow covers the time needed to build the kernels (which we know can be up to about 2 hours). If so, that should be fixed. I might be wrong, though.

<!-- gh-comment-id:320757691 --> @solardiz commented on GitHub (Aug 7, 2017): Thank you for your comments, Sayantan! While there's support for building of per-salt kernels in parallel, that support is currently disabled for other reasons (IIRC, there were issues with vendors' OpenCL backends triggered by the parallel builds). I think the problem is simpler than what you describe: the timer (3 seconds as you say) somehow covers the time needed to build the kernels (which we know can be up to about 2 hours). If so, that should be fixed. I might be wrong, though.
Author
Owner

@sayan1an commented on GitHub (Aug 8, 2017):

Hi Alexander!! I don't think building the kernels and building the tables are related. They can run independently of each other!! Timer used in building the tables is for doing some trial n error work built into the perfect hash table algorithm itself.

<!-- gh-comment-id:320843494 --> @sayan1an commented on GitHub (Aug 8, 2017): Hi Alexander!! I don't think building the kernels and building the tables are related. They can run independently of each other!! Timer used in building the tables is for doing some trial n error work built into the perfect hash table algorithm itself.
Author
Owner

@solardiz commented on GitHub (Aug 14, 2017):

Thanks Sayantan. Maybe related or not: why does descrypt-opencl consume so much GPU memory even for tiny hash files - e.g., a few thousand hashes with a few thousand different salts (so under 2 hashes/salt on average)? This is seen in #2653 where 1.6 GB is consumed for a file like that. Is this possibly because of unnecessarily large hash tables? Or (and?) are all of the per-salt kernels kept in GPU memory at once?

<!-- gh-comment-id:322179138 --> @solardiz commented on GitHub (Aug 14, 2017): Thanks Sayantan. Maybe related or not: why does descrypt-opencl consume so much GPU memory even for tiny hash files - e.g., a few thousand hashes with a few thousand different salts (so under 2 hashes/salt on average)? This is seen in #2653 where 1.6 GB is consumed for a file like that. Is this possibly because of unnecessarily large hash tables? Or (and?) are all of the per-salt kernels kept in GPU memory at once?
Author
Owner

@solardiz commented on GitHub (Aug 14, 2017):

Figured out the 1.6 GB memory usage: it is also seen when cracking just one hash, and is a result of the autodetected "GWS: 2097152". Manually reducing GWS reduces the memory usage accordingly. So no problem with that.

<!-- gh-comment-id:322239350 --> @solardiz commented on GitHub (Aug 14, 2017): Figured out the 1.6 GB memory usage: it is also seen when cracking just one hash, and is a result of the autodetected "GWS: 2097152". Manually reducing GWS reduces the memory usage accordingly. So no problem with that.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1704
No description provided.