[GH-ISSUE #1504] mscash-opencl segfaults #976

Closed
opened 2026-10-14 03:30:34 +07:00 by bsakaguchi · 10 comments
Owner

Originally created by @magnumripper on GitHub (Jul 6, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1504

Originally assigned to: @frank-dittrich on GitHub.

Device 0: AMD Opteron(tm) Processor 6376                 
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... make: *** [check] Segmentation fault
Originally created by @magnumripper on GitHub (Jul 6, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1504 Originally assigned to: @frank-dittrich on GitHub. ``` Device 0: AMD Opteron(tm) Processor 6376 Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... make: *** [check] Segmentation fault ```
bsakaguchi 2026-10-14 03:30:34 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@frank-dittrich commented on GitHub (Jul 7, 2015):

While the gcc build segfaults, the clang build just fails self test:

Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... FAILED (get_key(1))
<!-- gh-comment-id:119115779 --> @frank-dittrich commented on GitHub (Jul 7, 2015): While the gcc build segfaults, the clang build just fails self test: ``` Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... FAILED (get_key(1)) ```
Author
Owner

@magnumripper commented on GitHub (Jul 8, 2015):

Current code (a1a2e5a) works fine on my nvidia and Iris, but not on my CPU device (using --test=0)

Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... OpenCL error (CL_INVALID_WORK_GROUP_SIZE) in file (opencl_mscash_fmt_plug.c) at line (770) - (failed in clEnqueueNDRangeKernel)

This is likely due to again ignoring device limits... this device may demand an LWS of 1.

...yep

$ ../run/john -form:mscash-opencl -test -dev=0
Device 0: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Benchmarking: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... DONE
Raw:    29069K c/s real, 4158K c/s virtual

The Travis segfault is something else though. It could be a driver bug but I've almost never had any problems with the AMD CPU device.

<!-- gh-comment-id:119378200 --> @magnumripper commented on GitHub (Jul 8, 2015): Current code (a1a2e5a) works fine on my nvidia and Iris, but not on my CPU device (using --test=0) ``` Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... OpenCL error (CL_INVALID_WORK_GROUP_SIZE) in file (opencl_mscash_fmt_plug.c) at line (770) - (failed in clEnqueueNDRangeKernel) ``` This is likely due to again ignoring device limits... this device may demand an LWS of 1. ...yep ``` $ ../run/john -form:mscash-opencl -test -dev=0 Device 0: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz Benchmarking: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... DONE Raw: 29069K c/s real, 4158K c/s virtual ``` The Travis segfault is something else though. It could be a driver bug but I've almost never had any problems with the AMD CPU device.
Author
Owner

@magnumripper commented on GitHub (Jul 8, 2015):

Super, af6a034

$ for i in 1 2 3 4 5 ; do ../run/john -test=0 -dev=$i -form:mscash-opencl -verb=2 ; done
Device 1: Tahiti [AMD Radeon HD 7900 Series]
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... Error, crypt_all kernel.
Device 2: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... Segmentation fault
Device 3: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... Segmentation fault
Device 4: Intel(R) Many Integrated Core Acceleration Card
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... FAILED (get_key(1))

Device 5: GeForce GTX TITAN
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... OpenCL error (CL_OUT_OF_RESOURCES) in file (opencl_mscash_fmt_plug.c) at line (772) - (failed in reading back num cracked hashes.)
<!-- gh-comment-id:119388492 --> @magnumripper commented on GitHub (Jul 8, 2015): Super, af6a034 ``` $ for i in 1 2 3 4 5 ; do ../run/john -test=0 -dev=$i -form:mscash-opencl -verb=2 ; done Device 1: Tahiti [AMD Radeon HD 7900 Series] Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... Error, crypt_all kernel. Device 2: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... Segmentation fault Device 3: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... Segmentation fault Device 4: Intel(R) Many Integrated Core Acceleration Card Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... FAILED (get_key(1)) Device 5: GeForce GTX TITAN Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... OpenCL error (CL_OUT_OF_RESOURCES) in file (opencl_mscash_fmt_plug.c) at line (772) - (failed in reading back num cracked hashes.) ```
Author
Owner

@sayan1an commented on GitHub (Jul 8, 2015):

I have one question, do we check for device limits when LWS/GWS is forced and change them as necessary?
Anyway, keeping the deviation as little as possible, I'm limiting LWS/GWS within the device boundaries even when the parameters are forced.

<!-- gh-comment-id:119419549 --> @sayan1an commented on GitHub (Jul 8, 2015): I have one question, do we check for device limits when LWS/GWS is forced and change them as necessary? Anyway, keeping the deviation as little as possible, I'm limiting LWS/GWS within the device boundaries even when the parameters are forced.
Author
Owner

@sayan1an commented on GitHub (Jul 8, 2015):

Fixed except for dev=3 on super. 98f8ff2026

Update: with 'scl enable devtoolset-3 bash' I'm getting those again on super!! Weird thing is, I have the same version of APPSDK and AMD driver installed on my box as on super, but somehow the error shows up only on super. Only difference is, I'm using gcc 4.9.2 while it is 4.9.1 on super.

My box:

$ fglrxinfo
display: :0  screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon R9 200 / HD 7900 Series
OpenGL version string: 4.4.13372 Compatibility Profile Context 15.101.1001

$ clinfo | grep version
  Device OpenCL C version:                       OpenCL C 1.2 
  Driver version:                                1702.3 (VM)
  Device OpenCL C version:                       OpenCL C 1.2 
  Driver version:                                1702.3 (sse2,avx)

$ gcc -v
gcc version 4.9.2 (Ubuntu 4.9.2-0ubuntu1~12.04)

./john -form=mscash-opencl -dev=0 -te=0
Device 0: Tahiti [AMD Radeon R9 200 / HD 7900 Series]
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS

On super

$ DISPLAY=:0 fglrxinfo
display: :0  screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 7900 Series  
OpenGL version string: 4.4.13372 Compatibility Profile Context 15.101.1001

display: :0  screen: 1
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 7900 Series  
OpenGL version string: 4.4.13372 Compatibility Profile Context 15.101.1001

$ clinfo | grep version
Device OpenCL C version:                       OpenCL C 1.2 
  Driver version:                                1702.3 (VM)
  Device OpenCL C version:                       OpenCL C 1.2 
  Driver version:                                1702.3 (VM)
  Device OpenCL C version:                       OpenCL C 1.2 
  Driver version:                                1702.3 (sse2,avx)
  Device OpenCL C version:                       OpenCL C 1.2 
  Driver version:                                1.2.0.76921
  Device OpenCL C version:                       OpenCL C 1.2 
  Driver version:                                1.2
  Device OpenCL C version:                       OpenCL C 1.2 
  Driver version:                                352.21

$ gcc -v
gcc version 4.9.1 20140922 (Red Hat 4.9.1-10) (GCC) 

./john -form=mscash-opencl -dev=0 -te=0
Device 0: Tahiti [AMD Radeon HD 7900 Series]
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... FAILED (cmp_one(1))
<!-- gh-comment-id:119460400 --> @sayan1an commented on GitHub (Jul 8, 2015): Fixed except for dev=3 on super. 98f8ff2026debb930ffaec Update: with 'scl enable devtoolset-3 bash' I'm getting those again on super!! Weird thing is, I have the same version of APPSDK and AMD driver installed on my box as on super, but somehow the error shows up only on super. Only difference is, I'm using gcc 4.9.2 while it is 4.9.1 on super. My box: ``` $ fglrxinfo display: :0 screen: 0 OpenGL vendor string: Advanced Micro Devices, Inc. OpenGL renderer string: AMD Radeon R9 200 / HD 7900 Series OpenGL version string: 4.4.13372 Compatibility Profile Context 15.101.1001 $ clinfo | grep version Device OpenCL C version: OpenCL C 1.2 Driver version: 1702.3 (VM) Device OpenCL C version: OpenCL C 1.2 Driver version: 1702.3 (sse2,avx) $ gcc -v gcc version 4.9.2 (Ubuntu 4.9.2-0ubuntu1~12.04) ./john -form=mscash-opencl -dev=0 -te=0 Device 0: Tahiti [AMD Radeon R9 200 / HD 7900 Series] Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS ``` On super ``` $ DISPLAY=:0 fglrxinfo display: :0 screen: 0 OpenGL vendor string: Advanced Micro Devices, Inc. OpenGL renderer string: AMD Radeon HD 7900 Series OpenGL version string: 4.4.13372 Compatibility Profile Context 15.101.1001 display: :0 screen: 1 OpenGL vendor string: Advanced Micro Devices, Inc. OpenGL renderer string: AMD Radeon HD 7900 Series OpenGL version string: 4.4.13372 Compatibility Profile Context 15.101.1001 $ clinfo | grep version Device OpenCL C version: OpenCL C 1.2 Driver version: 1702.3 (VM) Device OpenCL C version: OpenCL C 1.2 Driver version: 1702.3 (VM) Device OpenCL C version: OpenCL C 1.2 Driver version: 1702.3 (sse2,avx) Device OpenCL C version: OpenCL C 1.2 Driver version: 1.2.0.76921 Device OpenCL C version: OpenCL C 1.2 Driver version: 1.2 Device OpenCL C version: OpenCL C 1.2 Driver version: 352.21 $ gcc -v gcc version 4.9.1 20140922 (Red Hat 4.9.1-10) (GCC) ./john -form=mscash-opencl -dev=0 -te=0 Device 0: Tahiti [AMD Radeon HD 7900 Series] Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... FAILED (cmp_one(1)) ```
Author
Owner

@frank-dittrich commented on GitHub (Jul 8, 2015):

Now that I fixed the segfault that occurred during the dynamic formats, we know how Travis likes the recent macash-opencl changes.
https://travis-ci.org/magnumripper/JohnTheRipper/builds/70035280

clang build:

Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... FAILED (get_key(1))

The gcc build has some other issues:

 Configure finished.  Now 'make clean && make -s' to compile.

No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.

The build has been terminated

So the make took more than 10 minutes without even arriving at

/usr/bin/ar: creating aes.a
<!-- gh-comment-id:119529989 --> @frank-dittrich commented on GitHub (Jul 8, 2015): Now that I fixed the segfault that occurred during the dynamic formats, we know how Travis likes the recent macash-opencl changes. https://travis-ci.org/magnumripper/JohnTheRipper/builds/70035280 clang build: ``` Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... FAILED (get_key(1)) ``` The gcc build has some other issues: ``` Configure finished. Now 'make clean && make -s' to compile. No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself. The build has been terminated ``` So the make took more than 10 minutes without even arriving at ``` /usr/bin/ar: creating aes.a ```
Author
Owner

@magnumripper commented on GitHub (Jul 8, 2015):

I have one question, do we check for device limits when LWS/GWS is forced and change them as necessary?

Good question. I would say we wouldn't have to, but we HAVE to support --test=0 - which is practically the same as forced LWS/GWS. While the only limit likely to ever hit us in --test=0 is this odd LWS=1 requirement, it might be easier to always obey limits.

<!-- gh-comment-id:119550291 --> @magnumripper commented on GitHub (Jul 8, 2015): > I have one question, do we check for device limits when LWS/GWS is forced and change them as necessary? Good question. I would say we wouldn't have to, but we HAVE to support --test=0 - which is practically the same as forced LWS/GWS. While the only limit likely to ever hit us in --test=0 is this odd LWS=1 requirement, it might be easier to always obey limits.
Author
Owner

@magnumripper commented on GitHub (Jul 8, 2015):

Fixed in 9b4759a

<!-- gh-comment-id:119605453 --> @magnumripper commented on GitHub (Jul 8, 2015): Fixed in 9b4759a
Author
Owner

@magnumripper commented on GitHub (Jul 8, 2015):

Frank reported in #1522:

checked after commit github.com/magnumripper/JohnTheRipper@49beab1944

Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... FAILED (cmp_all(0))

while the clang build self test PASSes.

On Super:

[frank@super run]$ for i in 1 2 3 4 5 ; do ./john -test=0 -dev=$i -format=mscash-opencl -verb=2 ; done
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
Device 1: Tahiti [AMD Radeon HD 7900 Series]
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
Device 2: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
Device 3: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... Segmentation fault
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
Device 4: Intel(R) Many Integrated Core Acceleration Card
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
Device 5: GeForce GTX TITAN
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS
[frank@super run]$ ./john --list=build-info
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john)
Version: 1.8.0.6-jumbo-1-307-g826656e+
Build: linux-gnu 64-bit AVX-ac
SIMD: AVX, interleaving: MD4:3 MD5:3 SHA1:1 SHA256:1 SHA512:1
$JOHN is ./
Format interface version: 13
Max. number of reported tunable costs: 3
Rec file version: REC4
Charset file version: CHR3
CHARSET_MIN: 1 (0x01)
CHARSET_MAX: 255 (0xff)
CHARSET_LENGTH: 24
Max. Markov mode level: 400
Max. Markov mode password length: 30
gcc version: 4.4.7
GNU libc version: 2.12 (loaded: 2.12)
OpenCL library version: 1.2
Crypto library: OpenSSL
OpenSSL library version: 01000105f
OpenSSL 1.0.1e-fips 11 Feb 2013
GMP library version: 4.3.1
File locking: fcntl()
fseek(): fseek
ftell(): ftell
fopen(): fopen
memmem(): System's
<!-- gh-comment-id:119737506 --> @magnumripper commented on GitHub (Jul 8, 2015): Frank reported in #1522: checked after commit https://github.com/magnumripper/JohnTheRipper/commit/49beab1944510c50d1a216a2827a0b719e5b0700 ``` Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... FAILED (cmp_all(0)) ``` while the clang build self test PASSes. On Super: ``` [frank@super run]$ for i in 1 2 3 4 5 ; do ./john -test=0 -dev=$i -format=mscash-opencl -verb=2 ; done ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) Device 1: Tahiti [AMD Radeon HD 7900 Series] Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) Device 2: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) Device 3: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... Segmentation fault ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) Device 4: Intel(R) Many Integrated Core Acceleration Card Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) Device 5: GeForce GTX TITAN Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS [frank@super run]$ ./john --list=build-info ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) ./john: /usr/local/cuda/lib64/libOpenCL.so.1: no version information available (required by ./john) Version: 1.8.0.6-jumbo-1-307-g826656e+ Build: linux-gnu 64-bit AVX-ac SIMD: AVX, interleaving: MD4:3 MD5:3 SHA1:1 SHA256:1 SHA512:1 $JOHN is ./ Format interface version: 13 Max. number of reported tunable costs: 3 Rec file version: REC4 Charset file version: CHR3 CHARSET_MIN: 1 (0x01) CHARSET_MAX: 255 (0xff) CHARSET_LENGTH: 24 Max. Markov mode level: 400 Max. Markov mode password length: 30 gcc version: 4.4.7 GNU libc version: 2.12 (loaded: 2.12) OpenCL library version: 1.2 Crypto library: OpenSSL OpenSSL library version: 01000105f OpenSSL 1.0.1e-fips 11 Feb 2013 GMP library version: 4.3.1 File locking: fcntl() fseek(): fseek ftell(): ftell fopen(): fopen memmem(): System's ```
Author
Owner

@sayan1an commented on GitHub (Jul 10, 2015):

Please test after 8fe7362f28 and close.

<!-- gh-comment-id:120207356 --> @sayan1an commented on GitHub (Jul 10, 2015): Please test after 8fe7362f28fc4bebe50 and close.
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#976
No description provided.