Bug 91315

Summary: When running JohnTheRipper OpenCL tests: The kernel rejected CS, see dmesg for more information. / [mi] EQ overflowing. Additional events will be discarded until existing events are processed.
Product: Mesa Reporter: Dennis Schridde <devurandom>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact: Default DRI bug account <dri-devel>
Severity: normal    
Priority: medium    
Version: 10.6   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 99553    
Attachments: Last lines of output from: john --test=0 --verbosity=5
Patch to JohnTheRipper
Xorg.0.log
dmesg
lspci -v
Linux kernel config
emerge --info media-libs/mesa

Description Dennis Schridde 2015-07-12 09:18:36 UTC
Created attachment 117064 [details]
Last lines of output from: john --test=0 --verbosity=5

I ran `john --test=0 --verbosity=5` from JohnTheRipper@e0e854e01e46e3e58dcec89d0e87b651c448cdff (plus a local patch as suggested in https://github.com/magnumripper/JohnTheRipper/issues/1470#issuecomment-120698629) as a regular non-root user, which made X crash.

The last lines of output from `john --test=0 --verbosity=5`, when run as a regular non-root user):
```
[...]
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... Options used: -I /usr/share/john/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=10 -DDEV_VER_MAJOR=10 -DDEV_VER_MINOR=6 -D_OPENCL_COMPILER -D NUM_INT_KEYS=1 -D IS_STATIC_GPU_MASK=0 -D $
Build log: input.cl:365:18: warning: unknown attribute 'max_constant_size' ignored
input.cl:375:18: warning: unknown attribute 'max_constant_size' ignored

Self test GWS: 64, LWS: 8
FAILED (cmp_all(0))

Options used: -I /usr/share/john/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=10 -DDEV_VER_MAJOR=10 -DDEV_VER_MINOR=6 -D_OPENCL_COMPILER -D SALT_BUFFER_SIZE=260
Build log: input.cl:586:17: warning: unknown attribute 'max_constant_size' ignored

binary size 107038
Error creating binary file $JOHN/kernels/pbkdf2_kernel_-D_SALT_BUFFER_SIZE=260_-DDEV_VER_MAJOR=10_-DDEV_VER_MINOR=6AMD_KAVERI_0.bin
Device 0  GWS: 8192, LWS: 8
Testing: mscash2-opencl, MS Cache Hash 2 (DCC2) [PBKDF2-SHA1 OpenCL]... radeon: The kernel rejected CS, see dmesg for more information.
radeon: The kernel rejected CS, see dmesg for more information.
radeon: The kernel rejected CS, see dmesg for more information.
radeon: The kernel rejected CS, see dmesg for more information.
radeon: The kernel rejected CS, see dmesg for more information.
radeon: The kernel rejected CS, see dmesg for more information.
radeon: The kernel rejected CS, see dmesg for more information.
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 131072 bytes
radeon:    alignment : 4096 bytes
radeon:    domains   : 2
radeon:    va        : 0x00000000020b2000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 131072 bytes
radeon:    alignment : 4096 bytes
radeon:    domains   : 2
radeon:    va        : 0x00000000020b2000
Bus error
```

X logs:
```
[...]
(EE) [mi] EQ overflowing.  Additional events will be discarded until existing events are processed.
(EE)
(EE) Backtrace:
(EE) 0: /usr/bin/X (xorg_backtrace+0x4f) [0x586aff]
(EE) 1: /usr/bin/X (mieqEnqueue+0x23b) [0x5690fb]
(EE) 2: /usr/bin/X (QueuePointerEvents+0x5a) [0x44f57a]
(EE) 3: /usr/lib64/xorg/modules/input/evdev_drv.so (0x7fa4741c7000+0x5f17) [0x7fa4741ccf17]
(EE) 4: /usr/lib64/xorg/modules/input/evdev_drv.so (0x7fa4741c7000+0x679d) [0x7fa4741cd79d]
(EE) 5: /usr/bin/X (0x400000+0x74978) [0x474978]
(EE) 6: /usr/bin/X (0x400000+0x9d350) [0x49d350]
(EE) 7: /lib64/libc.so.6 (0x308b000000+0x336a0) [0x308b0336a0]
(EE) 8: /lib64/libc.so.6 (ioctl+0x7) [0x308b0e0c67]
(EE) 9: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x3bb1c04428]
(EE) 10: /usr/lib64/libdrm.so.2 (drmCommandWrite+0x1b) [0x3bb1c06ff3]
(EE) 11: /usr/lib64/dri/radeonsi_dri.so (0x7fa478037000+0x466944) [0x7fa47849d944]
(EE) 12: /usr/lib64/dri/radeonsi_dri.so (0x7fa478037000+0x467ff2) [0x7fa47849eff2]
(EE) 13: /usr/lib64/dri/radeonsi_dri.so (0x7fa478037000+0x4794ff) [0x7fa4784b04ff]
(EE) 14: /usr/lib64/dri/radeonsi_dri.so (0x7fa478037000+0x1bdec1) [0x7fa4781f4ec1]
(EE) 15: /usr/lib64/dri/radeonsi_dri.so (0x7fa478037000+0x13bb1c) [0x7fa478172b1c]
(EE) 16: /usr/lib64/dri/radeonsi_dri.so (0x7fa478037000+0x1c0f2e) [0x7fa4781f7f2e]
(EE) 17: /usr/lib64/dri/radeonsi_dri.so (0x7fa478037000+0x13cdbc) [0x7fa478173dbc]
(EE) 18: /usr/lib64/dri/radeonsi_dri.so (0x7fa478037000+0x13d012) [0x7fa478174012]
(EE) 19: /usr/lib64/xorg/modules/libglamoregl.so (0x7fa478a47000+0x215b6) [0x7fa478a685b6]
(EE) 20: /usr/lib64/xorg/modules/libglamoregl.so (0x7fa478a47000+0xb2df) [0x7fa478a522df]
(EE) 21: /usr/lib64/xorg/modules/libglamoregl.so (0x7fa478a47000+0xbb6a) [0x7fa478a52b6a]
(EE) 22: /usr/bin/X (miCopyRegion+0x1a7) [0x5675a7]
(EE) 23: /usr/bin/X (miDoCopy+0x43e) [0x567b2e]
(EE) 24: /usr/lib64/xorg/modules/libglamoregl.so (0x7fa478a47000+0xbc04) [0x7fa478a52c04]
(EE) 25: /usr/bin/X (0x400000+0x114a72) [0x514a72]
(EE) 26: /usr/bin/X (0x400000+0x343ae) [0x4343ae]
(EE) 27: /usr/bin/X (0x400000+0x3829f) [0x43829f]
(EE) 28: /usr/bin/X (0x400000+0x3c32a) [0x43c32a]
(EE) 29: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x308b020040]
(EE) 30: /usr/bin/X (0x400000+0x26d2e) [0x426d2e]
(EE)
(EE) [mi] These backtraces from mieqEnqueue may point to a culprit higher up the stack.
(EE) [mi] mieq is *NOT* the cause.  It is a victim.
(EE) [mi] EQ overflow continuing.  100 events have been dropped.
[...]
```
Comment 1 Dennis Schridde 2015-07-12 09:20:40 UTC
Created attachment 117065 [details] [review]
Patch to JohnTheRipper

Patch to JohnTheRipper suggested by @magnumripper in https://github.com/magnumripper/JohnTheRipper/issues/1470#issuecomment-120698629 to workaround kernel/mesa crash when running OpenCL DES kernel
Comment 2 Dennis Schridde 2015-07-12 09:21:01 UTC
Created attachment 117066 [details]
Xorg.0.log
Comment 3 Dennis Schridde 2015-07-12 09:21:21 UTC
Created attachment 117067 [details]
dmesg
Comment 4 Dennis Schridde 2015-07-12 09:22:16 UTC
Created attachment 117068 [details]
lspci -v
Comment 5 Dennis Schridde 2015-07-12 09:22:43 UTC
Created attachment 117069 [details]
Linux kernel config
Comment 6 Dennis Schridde 2015-07-12 09:23:51 UTC
Created attachment 117070 [details]
emerge --info media-libs/mesa
Comment 7 Dennis Schridde 2015-07-12 09:25:26 UTC
I am running Mesa 10.6.1 on Linux 4.1.2. Please note that I was also running radeontop 0.8 at the time I ran john and when X crashed.
Comment 8 Dennis Schridde 2015-07-12 09:27:38 UTC
Unlike with bug #91305 there was no switching to a VT and kernel output this time. X (SDDM+KDE, managed by systemd) immediately restarted.
Comment 9 Dennis Schridde 2015-07-12 09:32:09 UTC
After this, without rebooting, john will immediately segfault:
```
$ /usr/sbin/john --test=0 --verbosity=5
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 4352 bytes
radeon:    alignment : 4096 bytes
radeon:    domains   : 4
radeon:    va        : 0x0000000000800000
radeon: Failed to allocate virtual address for buffer:
radeon:    size      : 4352 bytes
radeon:    alignment : 4096 bytes
radeon:    domains   : 4
radeon:    va        : 0x0000000000800000
Segmentation fault
```
Comment 10 GitLab Migration User 2019-09-25 17:52:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1221.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.