[GH-ISSUE #1797] DEScrypt OpenCL cached kernel doesn't work? #1201

Closed
opened 2026-10-14 03:39:04 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @magnumripper on GitHub (Oct 3, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1797

Originally assigned to: @magnumripper on GitHub.

On OSX (3d7c8cf)

$ rm ../run/kernels/*bin

$ ../run/john --format=descrypt-opencl --test=0
Device 1: HD Graphics 4000
Testing: descrypt-opencl, traditional crypt(3) [DES OpenCL]... PASS

$ ../run/john --format=descrypt-opencl --test=0
Device 1: HD Graphics 4000
Testing: descrypt-opencl, traditional crypt(3) [DES OpenCL]... OpenCL CL_INVALID_VALUE error in common-opencl.c:1061 - Error while getting build info (using cached binary)
Originally created by @magnumripper on GitHub (Oct 3, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1797 Originally assigned to: @magnumripper on GitHub. On OSX (3d7c8cf) ``` $ rm ../run/kernels/*bin $ ../run/john --format=descrypt-opencl --test=0 Device 1: HD Graphics 4000 Testing: descrypt-opencl, traditional crypt(3) [DES OpenCL]... PASS $ ../run/john --format=descrypt-opencl --test=0 Device 1: HD Graphics 4000 Testing: descrypt-opencl, traditional crypt(3) [DES OpenCL]... OpenCL CL_INVALID_VALUE error in common-opencl.c:1061 - Error while getting build info (using cached binary) ```
bsakaguchi 2026-10-14 03:39:04 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@sayan1an commented on GitHub (Oct 4, 2015):

I tried to replicate the issue using well's Intel HD graphics by forcing #define USE_BASIC_KERNEL 1 (see line 50, opencl_DES_fmt_plug.c).

Device 1: Intel(R) HD Graphics
Benchmarking: descrypt-opencl, traditional crypt(3) [DES OpenCL]... Options used: -I ./kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DDEV_VER_MAJOR=16 -DDEV_VER_MINOR=4 -D_OPENCL_COMPILER 
Build log: fcl build 1 succeeded.
fcl build 2 succeeded.
bcl build succeeded.

Options used: -I ./kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DDEV_VER_MAJOR=16 -DDEV_VER_MINOR=4 -D_OPENCL_COMPILER -D ITER_COUNT=1 -D MASK_ENABLED=0 -D LOC_0=-1 -D LOC_1=-1 -D LOC_2=-1 -D LOC_3=-1 -D IS_STATIC_GPU_MASK=0 -D CONST_CACHE_SIZE=65536
Build log: fcl build 1 succeeded.
fcl build 2 succeeded.
bcl build succeeded.

Options used: -I ./kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DDEV_VER_MAJOR=16 -DDEV_VER_MINOR=4 -D_OPENCL_COMPILER -D WORK_GROUP_SIZE=16 -D USE_LOCAL_MEM=1
Build log: fcl build 1 succeeded.
fcl build 2 succeeded.
bcl build succeeded.

GWS: 16384, LWS: 16
DONE
Warning: "Many salts" test limited: 1/256
Many salts:     294543 c/s real, 52428K c/s virtual
Only one salt:  288070 c/s real, 13107K c/s virtual

Somehow, it doesn't use cached kernels when running second time and I don't have any control over using cached binaries as like any other format, it uses opencl_build_kernel().

<!-- gh-comment-id:145320675 --> @sayan1an commented on GitHub (Oct 4, 2015): I tried to replicate the issue using well's Intel HD graphics by forcing #define USE_BASIC_KERNEL 1 (see line 50, opencl_DES_fmt_plug.c). ``` Device 1: Intel(R) HD Graphics Benchmarking: descrypt-opencl, traditional crypt(3) [DES OpenCL]... Options used: -I ./kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DDEV_VER_MAJOR=16 -DDEV_VER_MINOR=4 -D_OPENCL_COMPILER Build log: fcl build 1 succeeded. fcl build 2 succeeded. bcl build succeeded. Options used: -I ./kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DDEV_VER_MAJOR=16 -DDEV_VER_MINOR=4 -D_OPENCL_COMPILER -D ITER_COUNT=1 -D MASK_ENABLED=0 -D LOC_0=-1 -D LOC_1=-1 -D LOC_2=-1 -D LOC_3=-1 -D IS_STATIC_GPU_MASK=0 -D CONST_CACHE_SIZE=65536 Build log: fcl build 1 succeeded. fcl build 2 succeeded. bcl build succeeded. Options used: -I ./kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DDEV_VER_MAJOR=16 -DDEV_VER_MINOR=4 -D_OPENCL_COMPILER -D WORK_GROUP_SIZE=16 -D USE_LOCAL_MEM=1 Build log: fcl build 1 succeeded. fcl build 2 succeeded. bcl build succeeded. GWS: 16384, LWS: 16 DONE Warning: "Many salts" test limited: 1/256 Many salts: 294543 c/s real, 52428K c/s virtual Only one salt: 288070 c/s real, 13107K c/s virtual ``` Somehow, it doesn't use cached kernels when running second time and I don't have any control over using cached binaries as like any other format, it uses opencl_build_kernel().
Author
Owner

@sayan1an commented on GitHub (Oct 4, 2015):

Also, devices using cached binaries behave normally forcing the same kernel as apple_devices. You should look into program_size and kernel_source in opencl_build_from_binary() and ensure they are not 0 and NULL.

<!-- gh-comment-id:145321350 --> @sayan1an commented on GitHub (Oct 4, 2015): Also, devices using cached binaries behave normally forcing the same kernel as apple_devices. You should look into program_size and kernel_source in opencl_build_from_binary() and ensure they are not 0 and NULL.
Author
Owner

@magnumripper commented on GitHub (Oct 4, 2015):

Yeah I'll try to narrow it down.

<!-- gh-comment-id:145336873 --> @magnumripper commented on GitHub (Oct 4, 2015): Yeah I'll try to narrow it down.
Author
Owner

@magnumripper commented on GitHub (Oct 4, 2015):

Fixed. You introduced it in 57a6cce7, changing build_log from an array to alloced memory - but still using sizeof(build_log)...

<!-- gh-comment-id:145354908 --> @magnumripper commented on GitHub (Oct 4, 2015): Fixed. You introduced it in 57a6cce7, changing build_log from an array to alloced memory - but still using sizeof(build_log)...
Author
Owner

@magnumripper commented on GitHub (Oct 4, 2015):

I have no idea why only DEScrypt triggered the bug - it should be triggered by many formats and also not only for OSX.

<!-- gh-comment-id:145354955 --> @magnumripper commented on GitHub (Oct 4, 2015): I have no idea why only DEScrypt triggered the bug - it should be triggered by many formats and also not only for OSX.
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#1201
No description provided.