Bug 1460400 - X server found. dri2 connection failed!
X server found. dri2 connection failed!
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: beignet (Show other bugs)
26
x86_64 Linux
unspecified Severity low
: ---
: ---
Assigned To: Igor Gnatenko
Fedora Extras Quality Assurance
:
: 1462298 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-09 18:44 EDT by axel
Modified: 2017-07-16 16:21 EDT (History)
7 users (show)

See Also:
Fixed In Version: beignet-1.3.1-3.git20170622.36f6a8b.fc26
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-16 16:21:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
coredump (6.33 MB, application/octet-stream)
2017-06-09 18:44 EDT, axel
no flags Details
gdb apply all backtraces output (darktable) (17.08 KB, text/plain)
2017-06-10 08:31 EDT, axel
no flags Details
File: backtrace (88.37 KB, text/plain)
2017-06-19 11:01 EDT, Petr Schindler
no flags Details

  None (edit)
Description axel 2017-06-09 18:44:15 EDT
Created attachment 1286557 [details]
coredump

Description of problem:
When starting darktable, darktable coredump.

Version-Release number of selected component (if applicable):
arktable-2.2.4-1.fc26.x86_64

How reproducible:
start darktable

If you need any further details, don´ t hesitate to contact me. I am not so familiar with bug-testing on fedora. Therefore any help in how to report is appreciated.
Comment 1 axel 2017-06-09 18:46:27 EDT
error message:

X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
darktable: /usr/include/llvm/Support/Casting.h:236: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::CompositeType; Y = llvm::Type; typename llvm::cast_retty<X, Y*>::ret_type = llvm::CompositeType*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
[1]    12712 abort (core dumped)  darktable
Comment 2 Germano Massullo 2017-06-10 04:03:53 EDT
Please update to 2.2.5 darktable and we can better investigate ( # dnf -y update darktable)
Show us output of
$ lspci -k | grep -iA 3 vga

Thank you
Comment 3 axel 2017-06-10 05:44:43 EDT
Darktable is updated from testing repo, but still crashes.

➜  ~ lspci -k |grep -iA 3 vga
00:02.0 VGA compatible controller: Intel Corporation Device 5916 (rev 02)
	Subsystem: Lenovo Device 224b
	Kernel driver in use: i915
	Kernel modules: i915
Comment 4 Germano Massullo 2017-06-10 05:47:13 EDT
You should not use OpenCL on integrated VGAs, since they do not have any performance improvement.
Please show output of
$ darktable-cltest
Comment 5 axel 2017-06-10 06:02:19 EDT
I know, but on this laptop it is the only VGA ;)


Here we go!

➜  ~ darktable-cltest 
[opencl_init] opencl related configuration options:
[opencl_init] 
[opencl_init] opencl: 1
[opencl_init] opencl_library: ''
[opencl_init] opencl_memory_requirement: 768
[opencl_init] opencl_memory_headroom: 300
[opencl_init] opencl_device_priority: '*/!0,*/*/*'
[opencl_init] opencl_size_roundup: 16
[opencl_init] opencl_async_pixelpipe: 0
[opencl_init] opencl_synch_cache: 0
[opencl_init] opencl_number_event_handles: 25
[opencl_init] opencl_micro_nap: 1000
[opencl_init] opencl_use_pinned_memory: 0
[opencl_init] opencl_use_cpu_devices: 0
[opencl_init] opencl_avoid_atomics: 0
[opencl_init] opencl_enable_markesteijn: 1
[opencl_init] 
[opencl_init] could not find opencl runtime library 'libOpenCL'
[opencl_init] could not find opencl runtime library 'libOpenCL.so'
[opencl_init] found opencl runtime library 'libOpenCL.so.1'
[opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
darktable-cltest: /usr/include/llvm/Support/Casting.h:236: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::CompositeType; Y = llvm::Type; typename llvm::cast_retty<X, Y*>::ret_type = llvm::CompositeType*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
[1]    4914 abort (core dumped)  darktable-cltest

➜  ~ locate libOpenCL
/usr/lib/libOpenCL.so.1
/usr/lib/libOpenCL.so.1.0.0
/usr/lib64/libOpenCL.so.1
/usr/lib64/libOpenCL.so.1.0.0
Comment 6 axel 2017-06-10 06:48:53 EDT
Ok, sorry for doing this bug report slice by slice.

It definitly is an libOpenCL problem. Starting darktable with "--disable-opencl" works fine (but slow).

➜  ~ darktable-cltest --disable-opencl 
[opencl_init] do not try to find and use an opencl runtime library due to explicit user request
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.

This bug is affected on wayland and Xorg.

However, on fedora 25 it starts on the same hardware with openCL.Therefore it might be a grafic driver problem.
Comment 7 Germano Massullo 2017-06-10 07:05:25 EDT
Yes it is definitely an OpenCL problem, but I want to find out which implementation you are using.
# dnf list installed | grep opencl | sort
Comment 8 axel 2017-06-10 07:15:29 EDT
➜  ~ dnf list installed | grep opencl | sort                   
opencl-filesystem.noarch             1.0-5.fc26                 @fedora         
wine-opencl.i686                     2.9-1.fc26                 @updates-testing
wine-opencl.x86_64                   2.9-1.fc26                 @updates-testing
Comment 9 Germano Massullo 2017-06-10 07:26:41 EDT
It should be pocl, but let's get some other infos
# dnf debuginfo-install darktable
$ gdb darktable
(gdb) run
and when the crash occurs, enter
(gdb) thread apply all backtrace

Then attach output
Comment 10 axel 2017-06-10 08:27:13 EDT
ok, i installed a bunch of additional debuginfo packages.

(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/darktable 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: the debug information found in "/usr/lib/debug//lib64/libgomp.so.1.0.0.debug" does not match "/lib64/libgomp.so.1" (CRC mismatch).

warning: the debug information found in "/usr/lib/debug//usr/lib64/libgomp.so.1.0.0.debug" does not match "/lib64/libgomp.so.1" (CRC mismatch).

warning: the debug information found in "/usr/lib/debug//lib64/libstdc++.so.6.0.23.debug" does not match "/lib64/libstdc++.so.6" (CRC mismatch).

warning: the debug information found in "/usr/lib/debug//usr/lib64/libstdc++.so.6.0.23.debug" does not match "/lib64/libstdc++.so.6" (CRC mismatch).

[New Thread 0x7fffd8f6a700 (LWP 14883)]
[New Thread 0x7fffd3fff700 (LWP 14884)]
[New Thread 0x7fffd2cf8700 (LWP 14885)]
[New Thread 0x7fffd24f7700 (LWP 14886)]
[New Thread 0x7fffd1cf6700 (LWP 14887)]
[New Thread 0x7fffd14f5700 (LWP 14888)]
[New Thread 0x7fffd0cf4700 (LWP 14889)]
[New Thread 0x7fffb4020700 (LWP 14890)]
[New Thread 0x7fffb381f700 (LWP 14891)]
[New Thread 0x7fffb301e700 (LWP 14892)]
[New Thread 0x7fffb281d700 (LWP 14893)]
[Thread 0x7fffb281d700 (LWP 14893) exited]
[Thread 0x7fffb301e700 (LWP 14892) exited]
[Thread 0x7fffb381f700 (LWP 14891) exited]
[Thread 0x7fffb4020700 (LWP 14890) exited]
X server found. dri2 connection failed! 
[New Thread 0x7fffb281d700 (LWP 14894)]
[New Thread 0x7fffb301e700 (LWP 14895)]
[New Thread 0x7fffb381f700 (LWP 14896)]
[New Thread 0x7fffb4020700 (LWP 14897)]
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
[New Thread 0x7fffb0c93700 (LWP 14898)]
darktable: /usr/include/llvm/Support/Casting.h:236: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::CompositeType; Y = llvm::Type; typename llvm::cast_retty<X, Y*>::ret_type = llvm::CompositeType*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

Thread 1 "darktable" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	}


(gdb) thread apply all backtrace

Thread 17 (Thread 0x7fffb0c93700 (LWP 14898)):
#0  0x00007ffff305881b in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x555555c26378) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x555555c26328, cond=0x555555c26350) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=cond@entry=0x555555c26350, mutex=mutex@entry=0x555555c26328) at pthread_cond_wait.c:655
#3  0x00007fffb175b43d in cl_object_wait_on_cond (obj=obj@entry=0x555555c26300) at /usr/src/debug/Beignet-1.3.1-Source/src/cl_base_object.c:132
#4  0x00007fffb177caf1 in worker_thread_function (Arg=0x555555c26388) at /usr/src/debug/Beignet-1.3.1-Source/src/cl_command_queue_enqueue.c:56
#5  0x00007ffff305236d in start_thread (arg=0x7fffb0c93700) at pthread_create.c:456
#6  0x00007fffef99fe9f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Thread 16 (Thread 0x7fffb4020700 (LWP 14897)):
#0  0x00007ffff3058dc6 in futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fffb4440080 <time_to_wait>, expected=0, futex_word=0x7fffb4440118 <scheduler+120>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  __pthread_cond_wait_common (abstime=0x7fffb4440080 <time_to_wait>, mutex=0x7fffb4440120 <scheduler+128>, cond=0x7fffb44400f0 <scheduler+80>) at pthread_cond_wait.c:539
#2  __pthread_cond_timedwait (cond=cond@entry=0x7fffb44400f0 <scheduler+80>, mutex=mutex@entry=0x7fffb4440120 <scheduler+128>, abstime=abstime@entry=0x7fffb4440080 <time_to_wait>)
    at pthread_cond_wait.c:667
#3  0x00007fffb41ed03a in pthread_scheduler_sleep () at /usr/src/debug/pocl-0.14/lib/CL/devices/pthread/pthread_scheduler.c:185
#4  pocl_pthread_driver_thread (p=0x555555c15608) at /usr/src/debug/pocl-0.14/lib/CL/devices/pthread/pthread_scheduler.c:371
#5  0x00007ffff305236d in start_thread (arg=0x7fffb4020700) at pthread_create.c:456
#6  0x00007fffef99fe9f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Thread 15 (Thread 0x7fffb381f700 (LWP 14896)):
#0  0x00007ffff3058dc6 in futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fffb4440080 <time_to_wait>, expected=0, futex_word=0x7fffb4440118 <scheduler+120>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  __pthread_cond_wait_common (abstime=0x7fffb4440080 <time_to_wait>, mutex=0x7fffb4440120 <scheduler+128>, cond=0x7fffb44400f0 <scheduler+80>) at pthread_cond_wait.c:539
#2  __pthread_cond_timedwait (cond=cond@entry=0x7fffb44400f0 <scheduler+80>, mutex=mutex@entry=0x7fffb4440120 <scheduler+128>, abstime=abstime@entry=0x7fffb4440080 <time_to_wait>)
    at pthread_cond_wait.c:667
#3  0x00007fffb41ed03a in pthread_scheduler_sleep () at /usr/src/debug/pocl-0.14/lib/CL/devices/pthread/pthread_scheduler.c:185
#4  pocl_pthread_driver_thread (p=0x555555c15540) at /usr/src/debug/pocl-0.14/lib/CL/devices/pthread/pthread_scheduler.c:371
#5  0x00007ffff305236d in start_thread (arg=0x7fffb381f700) at pthread_create.c:456
#6  0x00007fffef99fe9f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Thread 14 (Thread 0x7fffb301e700 (LWP 14895)):
#0  0x00007ffff3058dc6 in futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fffb4440080 <time_to_wait>, expected=0, futex_word=0x7fffb4440118 <scheduler+120>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  __pthread_cond_wait_common (abstime=0x7fffb4440080 <time_to_wait>, mutex=0x7fffb4440120 <scheduler+128>, cond=0x7fffb44400f0 <scheduler+80>) at pthread_cond_wait.c:539
Comment 11 axel 2017-06-10 08:31 EDT
Created attachment 1286666 [details]
gdb apply all backtraces output (darktable)
Comment 12 Germano Massullo 2017-06-10 09:53:38 EDT
It is a Beignet OpenCL driver crash.
Since such driver is blacklisted, darktable should not crash, so I opened bugreport https://redmine.darktable.org/issues/11648
I riassign the bugreport to Beignet since it is the source of the crash
Comment 13 axel 2017-06-10 10:34:24 EDT
confirmed: 

➜  ~ sudo dnf remove beignet

solved the problem. Thank you Germano
Comment 14 Germano Massullo 2017-06-16 16:22:46 EDT
*** Bug 1462298 has been marked as a duplicate of this bug. ***
Comment 15 Petr Schindler 2017-06-19 11:00:59 EDT
Similar problem has been detected:

This happens on f26 whenever I run darktable. It crashes right after the start.

reporter:       libreport-2.9.1
backtrace_rating: 4
cmdline:        darktable
crash_function: llvm::cast<llvm::CompositeType, llvm::Type>
executable:     /usr/bin/darktable
journald_cursor: s=078b1ea96182461aa07ae046b755b2f1;i=a8b3c;b=d69c1bab29c14531961eef10788529de;m=658f23958c;t=5525069c9131b;x=e7b8713b57b9dc48
kernel:         4.11.4-300.fc26.x86_64
package:        darktable-2.2.5-2.fc26
reason:         darktable killed by signal 6
rootdir:        /
runlevel:       N 5
type:           CCpp
uid:            1000
Comment 16 Petr Schindler 2017-06-19 11:01:07 EDT
Created attachment 1289123 [details]
File: backtrace
Comment 17 Fedora Update System 2017-07-14 05:44:25 EDT
beignet-1.3.1-3.git20170622.36f6a8b.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-10cd9f1c4c
Comment 18 Fedora Update System 2017-07-14 18:56:44 EDT
beignet-1.3.1-3.git20170622.36f6a8b.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-10cd9f1c4c
Comment 19 Fedora Update System 2017-07-16 16:21:52 EDT
beignet-1.3.1-3.git20170622.36f6a8b.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.