Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#852746: beignet-opencl-icd: Every OpenCL application crashes (CLInfo, LibreOffice, etc.)

462 views
Skip to first unread message

Ivan Baldo

unread,
Jan 26, 2017, 5:10:03 PM1/26/17
to
Package: beignet-opencl-icd
Version: 1.2.1-1+b1
Severity: important

Hello.
Every application that uses OpenCL crashes in this way:
$ clinfo
X server found. dri2 connection failed!
/dev/dri/card0 not authenticated
: CommandLine Error: Option 'enable-value-profiling' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

Uninstalling this package fixes every application.
Installing the version in Sid 1.3.0-1 also crashes in the same way.
Running as root it crashes like this (with 1.3.0-1):
# clinfo
X server found. dri2 connection failed!
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
: CommandLine Error: Option 'enable-value-profiling' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

I know that under KVM I don't need this package, but I will run this same Linux in different PCs,
some Intel, some AMD, some virtualized.
The expected behaviour is that it would not load and use another ICD instead, without crashing.
Thanks!!!

-- Package-specific info:
Graphics hardware:
Providers: number : 1
Provider 0: id: 0x41 cap: 0x0 crtcs: 1 outputs: 1 associated providers: 0 name:modesetting
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
Extended renderer info (GLX_MESA_query_renderer):
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.9, 128 bits)
00:02.0 VGA compatible controller [0300]: Device [1234:1111]

Processor:
Architecture: i686
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 4
Vendor ID: GenuineIntel
CPU family: 6
Model: 2
Model name: QEMU Virtual CPU version 2.1.2
Stepping: 3
CPU MHz: 3199.996
BogoMIPS: 6399.99
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 4096K
Flags: fpu de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm eagerfpu pni cx16 popcnt hypervisor lahf_lm abm

OpenCL library:
un libopencl-1.1-1
un libopencl-1.2-1
un libopencl-2.0-1
un libopencl-2.1-1
un libopencl1
un nvidia-libopencl1-dev
ii ocl-icd-libopencl1:i386 2.2.10-2
ii beignet-opencl-icd:i386 1.2.1-1+b1
ii mesa-opencl-icd:i386 13.0.3-1
un opencl-icd
un opencl-icd-1.1-1
un opencl-icd-1.2-1
ii pocl-opencl-icd 0.13-8
==> /etc/OpenCL/vendors/intel-beignet-i386-linux-gnu.icd <==
/usr/lib/i386-linux-gnu/beignet//libcl.so

==> /etc/OpenCL/vendors/mesa.icd <==
libMesaOpenCL.so.1

==> /etc/OpenCL/vendors/pocl.icd <==
libpocl.so.1

-- System Information:
Debian Release: 9.0
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 4.9.0-1-686-pae (SMP w/4 CPU cores)
Locale: LANG=es_UY.UTF-8, LC_CTYPE=es_UY.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to es_UY.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages beignet-opencl-icd depends on:
ii libc6 2.24-8
ii libdrm-intel1 2.4.74-1
ii libdrm2 2.4.74-1
ii libgcc1 1:6.2.1-5
ii libllvm3.9 1:3.9.1-1
ii libstdc++6 6.2.1-5
ii libx11-6 2:1.6.4-2
ii libxext6 2:1.3.3-1
ii libxfixes3 1:5.0.3-1

beignet-opencl-icd recommends no packages.

beignet-opencl-icd suggests no packages.

-- no debconf information

Rebecca N. Palmer

unread,
Jan 26, 2017, 6:10:02 PM1/26/17
to
Control: retitle -1 beignet+mesa-opencl-icd crash if installed together

The lack of hardware isn't the trigger - having beignet-opencl-icd and
mesa-opencl-icd installed at the same time is. (beignet+pocl or
mesa+pocl is OK.)

Looks like some kind of "seeing the other ICD's copy of libllvm instead
of their own" problem (similar to
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=768185 , and possibly
appearing now because beignet just switched to the same LLVM version as
mesa), but I haven't yet had time to confirm this.

Rebecca N. Palmer

unread,
Jan 27, 2017, 5:10:03 PM1/27/17
to
This bug goes away on rebuilding beignet with LLVM 3.8 (but that isn't a
good solution as it can trigger #848368, and also disables some of
beignet's functionality).

Debug backtraces show mesa-opencl-icd being loaded first, and the crash
happening when beignet-opencl-icd is loaded, suggesting one is jumping
to the other's LLVM globals (similar to #768185).

However, beignet still has the -Bsymbolic that fixed #768185 on all its
libraries, and while mesa-opencl-icd doesn't, adding it (via the obvious
patch to src/gallium/targets/opencl/Makefile.am) doesn't help.

(The missing parameters/locals in the LLVM parts of the traces are
probably #851371; because of this, I was unable to do the
is-this-the-same-pointer check from #768185)

Breakpoint 3, (anonymous
namespace)::CommandLineParser::addOption(llvm::cl::Option*,
llvm::cl::SubCommand*) () at
/build/llvm-toolchain-3.9-3.9.1/lib/Support/CommandLine.cpp:144
144 /build/llvm-toolchain-3.9-3.9.1/lib/Support/CommandLine.cpp: No such
file or directory.
#0 (anonymous
namespace)::CommandLineParser::addOption(llvm::cl::Option*,
llvm::cl::SubCommand*) () at
/build/llvm-toolchain-3.9-3.9.1/lib/Support/CommandLine.cpp:144
#1 0x00007ffff2a073eb in llvm::cl::Option::addArgument() () at
/build/llvm-toolchain-3.9-3.9.1/lib/Support/CommandLine.cpp:190
#2 0x00007ffff29874a9 in __static_initialization_and_destruction_0(int,
int) [clone .constprop.314] () at
/build/llvm-toolchain-3.9-3.9.1/include/llvm/Support/CommandLine.h:1291
#3 0x00007ffff7de864a in call_init (l=<optimized out>,
argc=argc@entry=1, argv=argv@entry=0x7fffffffe4e8,
env=env@entry=0x7fffffffe4f8) at dl-init.c:72
#4 0x00007ffff7de875b in call_init (env=0x7fffffffe4f8,
argv=0x7fffffffe4e8, argc=1, l=<optimized out>) at dl-init.c:30
#5 _dl_init (main_map=main_map@entry=0x61a520, argc=1,
argv=0x7fffffffe4e8, env=0x7fffffffe4f8) at dl-init.c:120
#6 0x00007ffff7deccd8 in dl_open_worker (a=a@entry=0x7fffffffdfc0) at
dl-open.c:575
#7 0x00007ffff7de84f4 in _dl_catch_error
(objname=objname@entry=0x7fffffffdfb0,
errstring=errstring@entry=0x7fffffffdfb8,
mallocedp=mallocedp@entry=0x7fffffffdfaf,
operate=operate@entry=0x7ffff7dec8f0 <dl_open_worker>,
args=args@entry=0x7fffffffdfc0) at dl-error.c:187
#8 0x00007ffff7dec489 in _dl_open (file=0x61a4b0 "libMesaOpenCL.so.1",
mode=-2147483647, caller_dlopen=0x7ffff77c926f <_load_icd+39>, nsid=-2,
argc=<optimized out>, argv=<optimized out>, env=0x7fffffffe4f8) at
dl-open.c:660
#9 0x00007ffff75c1ee9 in dlopen_doit (a=a@entry=0x7fffffffe1f0) at
dlopen.c:66
#10 0x00007ffff7de84f4 in _dl_catch_error (objname=0x7ffff77c40d0
<last_result+16>, errstring=0x7ffff77c40d8 <last_result+24>,
mallocedp=0x7ffff77c40c8 <last_result+8>, operate=0x7ffff75c1e90
<dlopen_doit>, args=0x7fffffffe1f0) at dl-error.c:187
#11 0x00007ffff75c2521 in _dlerror_run
(operate=operate@entry=0x7ffff75c1e90 <dlopen_doit>,
args=args@entry=0x7fffffffe1f0) at dlerror.c:163
#12 0x00007ffff75c1f82 in __dlopen (file=file@entry=0x61a4b0
"libMesaOpenCL.so.1", mode=mode@entry=1) at dlopen.c:87
#13 0x00007ffff77c926f in _load_icd (num_icds=num_icds@entry=0,
lib_path=lib_path@entry=0x61a4b0 "libMesaOpenCL.so.1") at
ocl_icd_loader.c:184
#14 0x00007ffff77c93bd in _open_driver (num_icds=num_icds@entry=0,
dir_path=<optimized out>, dir_path@entry=0x7ffff77cb78e
"/etc/OpenCL/vendors", file_path=<optimized out>,
file_path@entry=0x612463 "mesa.icd") at ocl_icd_loader.c:237
#15 0x00007ffff77c990a in _open_drivers (dir_path=<optimized out>,
dir=<optimized out>) at ocl_icd_loader.c:250
#16 __initClIcd () at ocl_icd_loader.c:646
#17 _initClIcd_real () at ocl_icd_loader.c:702
#18 0x00007ffff77ca103 in _initClIcd () at ocl_icd_loader.c:724
#19 clGetPlatformIDs (num_entries=0, platforms=0x0,
num_platforms=0x611798) at ocl_icd_loader.c:846
#20 0x0000000000401328 in ?? ()
#21 0x00007ffff72432b1 in __libc_start_main (main=0x401180, argc=1,
argv=0x7fffffffe4e8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffe4d8) at
../csu/libc-start.c:291
#22 0x00000000004015a9 in ?? ()

[...lots more, but none from beignet until...]

Thread 1 "clinfo" hit Breakpoint 4, (anonymous
namespace)::CommandLineParser::addOption(llvm::cl::Option*,
llvm::cl::SubCommand*) () at
/build/llvm-toolchain-3.9-3.9.1/lib/Support/CommandLine.cpp:148
148 in /build/llvm-toolchain-3.9-3.9.1/lib/Support/CommandLine.cpp
(gdb) bt full
#0 (anonymous
namespace)::CommandLineParser::addOption(llvm::cl::Option*,
llvm::cl::SubCommand*) () at
/build/llvm-toolchain-3.9-3.9.1/lib/Support/CommandLine.cpp:148
No locals.
#1 0x00007ffff2a07448 in llvm::cl::Option::addArgument() () at
/build/llvm-toolchain-3.9-3.9.1/lib/Support/CommandLine.cpp:187
No locals.
#2 0x00007fffe7facf89 in _GLOBAL__sub_I_CodeGenPGO.cpp () from
/usr/lib/x86_64-linux-gnu/beignet//libgbe.so
No symbol table info available.
#3 0x00007ffff7de864a in call_init (l=<optimized out>,
argc=argc@entry=1, argv=argv@entry=0x7fffffffe4e8,
env=env@entry=0x7fffffffe4f8) at dl-init.c:72
j = <optimized out>
jm = <optimized out>
addrs = <optimized out>
init_array = <optimized out>
#4 0x00007ffff7de875b in call_init (env=0x7fffffffe4f8,
argv=0x7fffffffe4e8, argc=1, l=<optimized out>) at dl-init.c:30
No locals.
#5 _dl_init (main_map=main_map@entry=0x66b690, argc=1,
argv=0x7fffffffe4e8, env=0x7fffffffe4f8) at dl-init.c:120
preinit_array = <optimized out>
preinit_array_size = <optimized out>
i = 0
#6 0x00007ffff7deccd8 in dl_open_worker (a=a@entry=0x7fffffffda60) at
dl-open.c:575
args = 0x7fffffffda60
file = <optimized out>
mode = <optimized out>
call_map = <optimized out>
dst = <optimized out>
new = <optimized out>
__PRETTY_FUNCTION__ = "dl_open_worker"
r = <optimized out>
reloc_mode = <optimized out>
nmaps = <optimized out>
l = <optimized out>
maps = <optimized out>
any_tls = <optimized out>
first_static_tls = <optimized out>
#7 0x00007ffff7de84f4 in _dl_catch_error
(objname=objname@entry=0x7fffffffda50,
errstring=errstring@entry=0x7fffffffda58,
mallocedp=mallocedp@entry=0x7fffffffda4f,
operate=operate@entry=0x7ffff7dec8f0 <dl_open_worker>,
args=args@entry=0x7fffffffda60) at dl-error.c:187
errcode = 822307730
c = {objname = 0x7fffffffda50, errstring = 0x7fffffffda58,
malloced = 0x7fffffffda4f, errcode = 0x7fffffffd92c, env = {{__jmpbuf =
{140737488345968, 3531784809792301305, 2147483649, 140737124796432,
140737124602632, 140737354125376, 3531784809859410169,
3531802667125336313}, __mask_was_saved = -134224128, __saved_mask =
{__val = {140737488345640, 140737488345636, 140737124589216,
140737341053973, 140737351917860, 140737488345640, 451, 6409728,
140737251206712, 140737251339216, 140737351919971, 451, 140737251339216,
6409728, 140737488345752, 140737488345748}}}}}
catchp = 0x7ffff7fec6f0
old = <optimized out>
#8 0x00007ffff7dec489 in _dl_open (file=0x7fffea548810
"/usr/lib/x86_64-linux-gnu/beignet//libgbe.so", mode=-2147483647,
caller_dlopen=0x7fffea519308
<_GLOBAL__sub_I_cl_gbe_loader.cpp(void)+136>, nsid=-2, argc=<optimized
out>, argv=<optimized out>, env=0x7fffffffe4f8) at dl-open.c:660
args = {file = 0x7fffea548810
"/usr/lib/x86_64-linux-gnu/beignet//libgbe.so", mode = -2147483647,
caller_dlopen = 0x7fffea519308
<_GLOBAL__sub_I_cl_gbe_loader.cpp(void)+136>, caller_dl_open =
0x7ffff75c1ee9 <dlopen_doit+89>, map = 0x66b690, nsid = 0, argc = 1,
argv = 0x7fffffffe4e8, env = 0x7fffffffe4f8}
objname = 0x7fffffffdb70 "\320@|\367\377\177"
errstring = 0x7ffff1dd6638 ""
malloced = false
errcode = <optimized out>
__PRETTY_FUNCTION__ = "_dl_open"
#9 0x00007ffff75c1ee9 in dlopen_doit (a=a@entry=0x7fffffffdc90) at
dlopen.c:66
args = 0x7fffffffdc90
#10 0x00007ffff7de84f4 in _dl_catch_error (objname=0x7ffff77c40d0
<last_result+16>, errstring=0x7ffff77c40d8 <last_result+24>,
mallocedp=0x7ffff77c40c8 <last_result+8>, operate=0x7ffff75c1e90
<dlopen_doit>, args=0x7fffffffdc90) at dl-error.c:187
errcode = 32767
c = {objname = 0x7ffff77c40d0 <last_result+16>, errstring =
0x7ffff77c40d8 <last_result+24>, malloced = 0x7ffff77c40c8
<last_result+8>, errcode = 0x7fffffffdb6c, env = {{__jmpbuf =
{140737488346768, 3531801588205775097, 140737488346256, 140737488348408,
140737126945648, 0, 3531784809767135481, 3531802667125336313},
__mask_was_saved = 0, __saved_mask = {__val = {140737124601232, 6718064,
6, 584115552262, 140737124571288, 140737488346432, 140737351927037, 0,
140737351928106, 140737488346080, 140737124564992, 140737488346296,
140737488346312, 0, 140737488346384, 0}}}}}
catchp = 0x7ffff7fec6f0
old = <optimized out>
#11 0x00007ffff75c2521 in _dlerror_run
(operate=operate@entry=0x7ffff75c1e90 <dlopen_doit>,
args=args@entry=0x7fffffffdc90) at dlerror.c:163
result = 0x7ffff77c40c0 <last_result>
#12 0x00007ffff75c1f82 in __dlopen (file=<optimized out>,
mode=mode@entry=1) at dlopen.c:87
args = {file = 0x7fffea548810
"/usr/lib/x86_64-linux-gnu/beignet//libgbe.so", mode = 1, new =
0x7fffffffe4f8, caller = 0x7fffea519308
<_GLOBAL__sub_I_cl_gbe_loader.cpp(void)+136>}
#13 0x00007fffea519308 in GbeLoaderInitializer::LoadCompiler
(this=0x7fffea78d440 <gbeLoader>) at ./src/cl_gbe_loader.cpp:295
nonCompiler = <optimized out>
gbePath = <optimized out>
#14 GbeLoaderInitializer::GbeLoaderInitializer (this=0x7fffea78d440
<gbeLoader>) at ./src/cl_gbe_loader.cpp:86
path = <optimized out>
#15 __static_initialization_and_destruction_0 (__initialize_p=1,
__priority=65535) at ./src/cl_gbe_loader.cpp:360
No locals.
#16 _GLOBAL__sub_I_cl_gbe_loader.cpp(void) () at ./src/cl_gbe_loader.cpp:368
No locals.
#17 0x00007ffff7de864a in call_init (l=<optimized out>,
argc=argc@entry=1, argv=argv@entry=0x7fffffffe4e8,
env=env@entry=0x7fffffffe4f8) at dl-init.c:72
j = <optimized out>
jm = <optimized out>
addrs = <optimized out>
init_array = <optimized out>
#18 0x00007ffff7de875b in call_init (env=0x7fffffffe4f8,
argv=0x7fffffffe4e8, argc=1, l=<optimized out>) at dl-init.c:30
No locals.
#19 _dl_init (main_map=main_map@entry=0x668270, argc=1,
argv=0x7fffffffe4e8, env=0x7fffffffe4f8) at dl-init.c:120
preinit_array = <optimized out>
preinit_array_size = <optimized out>
i = 0
#20 0x00007ffff7deccd8 in dl_open_worker (a=a@entry=0x7fffffffdfc0) at
dl-open.c:575
args = 0x7fffffffdfc0
file = <optimized out>
mode = <optimized out>
call_map = <optimized out>
dst = <optimized out>
new = <optimized out>
__PRETTY_FUNCTION__ = "dl_open_worker"
r = <optimized out>
reloc_mode = <optimized out>
nmaps = <optimized out>
l = <optimized out>
maps = <optimized out>
any_tls = <optimized out>
first_static_tls = <optimized out>
#21 0x00007ffff7de84f4 in _dl_catch_error
(objname=objname@entry=0x7fffffffdfb0,
errstring=errstring@entry=0x7fffffffdfb8,
mallocedp=mallocedp@entry=0x7fffffffdfaf,
operate=operate@entry=0x7ffff7dec8f0 <dl_open_worker>,
args=args@entry=0x7fffffffdfc0) at dl-error.c:187
errcode = 0
c = {objname = 0x7fffffffdfb0, errstring = 0x7fffffffdfb8,
malloced = 0x7fffffffdfaf, errcode = 0x7fffffffde8c, env = {{__jmpbuf =
{140737488347344, 3531784811751041273, 2147483649, 6712496,
140737345524335, 140737354125376, 3531784809939101945,
3531802667125336313}, __mask_was_saved = -134252328, __saved_mask =
{__val = {140737488347016, 140737488347012, 140737351881616,
140737347663547, 0, 140737488347016, 259121620, 4048775,
140737339670584, 140737488347232, 140737339616656, 140737488347012,
140737488347216, 140737354066808, 9, 140737343372112}}}}}
catchp = 0x7ffff7fec6f0
old = <optimized out>
#22 0x00007ffff7dec489 in _dl_open (file=0x666cb0
"/usr/lib/x86_64-linux-gnu/beignet//libcl.so", mode=-2147483647,
caller_dlopen=0x7ffff77c926f <_load_icd+39>, nsid=-2, argc=<optimized
out>, argv=<optimized out>, env=0x7fffffffe4f8) at dl-open.c:660
args = {file = 0x666cb0
"/usr/lib/x86_64-linux-gnu/beignet//libcl.so", mode = -2147483647,
caller_dlopen = 0x7ffff77c926f <_load_icd+39>, caller_dl_open =
0x7ffff75c1ee9 <dlopen_doit+89>, map = 0x668270, nsid = 0, argc = 1,
argv = 0x7fffffffe4e8, env = 0x7fffffffe4f8}
objname = 0x7ffff75bbb00 <main_arena> ""
errstring = 0x7ffff729bcda <_int_malloc+346>
"L\211\350L\211\353L\211\351H\301\350\006L\211\357L\211\356H\211D$
\203\300\060H\301\353\t\211D$,D\211\350H\301\351\f\301\350\004H\301\357\017H\301\356\022\211D$(I\215E
H\211\\$0H\211L$8H\211|$H\203\301nH\211t$P\203\307w\203\306|\203\303[M\215gX\211t$\\\211|$X\211L$D\211\\$@H\211D$\030\275\020'"
malloced = false
errcode = <optimized out>
__PRETTY_FUNCTION__ = "_dl_open"
#23 0x00007ffff75c1ee9 in dlopen_doit (a=a@entry=0x7fffffffe1f0) at
dlopen.c:66
args = 0x7fffffffe1f0
#24 0x00007ffff7de84f4 in _dl_catch_error (objname=0x7ffff77c40d0
<last_result+16>, errstring=0x7ffff77c40d8 <last_result+24>,
mallocedp=0x7ffff77c40c8 <last_result+8>, operate=0x7ffff75c1e90
<dlopen_doit>, args=0x7fffffffe1f0) at dl-error.c:187
errcode = 0
c = {objname = 0x7ffff77c40d0 <last_result+16>, errstring =
0x7ffff77c40d8 <last_result+24>, malloced = 0x7ffff77c40c8
<last_result+8>, errcode = 0x7fffffffe0cc, env = {{__jmpbuf =
{140737488346768, 3531801588205775097, 140737488347632, 6712496, 45, 45,
3531784811725875449, 3531802667125336313}, __mask_was_saved = 6712560,
__saved_mask = {__val = {140737340499401, 0, 140737340067536, 0,
140733193388067, 65026, 7213466, 1, 33188, 0, 4, 45, 6712560, 0, 0,
6712496}}}}}
catchp = 0x7ffff7fec6f0
old = <optimized out>
#25 0x00007ffff75c2521 in _dlerror_run
(operate=operate@entry=0x7ffff75c1e90 <dlopen_doit>,
args=args@entry=0x7fffffffe1f0) at dlerror.c:163
result = 0x7ffff77c40c0 <last_result>
#26 0x00007ffff75c1f82 in __dlopen (file=file@entry=0x666cb0
"/usr/lib/x86_64-linux-gnu/beignet//libcl.so", mode=mode@entry=1) at
dlopen.c:87
args = {file = 0x666cb0
"/usr/lib/x86_64-linux-gnu/beignet//libcl.so", mode = 1, new = 0x666cb0,
caller = 0x7ffff77c926f <_load_icd+39>}
#27 0x00007ffff77c926f in _load_icd (num_icds=num_icds@entry=2,
lib_path=lib_path@entry=0x666cb0
"/usr/lib/x86_64-linux-gnu/beignet//libcl.so") at ocl_icd_loader.c:184
ret = 0
#28 0x00007ffff77c93bd in _open_driver (num_icds=num_icds@entry=2,
dir_path=<optimized out>, dir_path@entry=0x7ffff77cb78e
"/etc/OpenCL/vendors", file_path=<optimized out>,
file_path@entry=0x6124d3 "intel-beignet-x86_64-linux-gnu.icd") at
ocl_icd_loader.c:237
lib_path = 0x666cb0 "/usr/lib/x86_64-linux-gnu/beignet//libcl.so"
lib_path_length = <optimized out>
f = 0x666cf0
#29 0x00007ffff77c990a in _open_drivers (dir_path=<optimized out>,
dir=<optimized out>) at ocl_icd_loader.c:250
num_icds = 2
ent = 0x6124c0
#30 __initClIcd () at ocl_icd_loader.c:646
num_icds = <optimized out>
is_dir = 1
dir = 0x612420
dir_path = <optimized out>
vendor_path = <optimized out>
#31 _initClIcd_real () at ocl_icd_loader.c:702
No locals.
#32 0x00007ffff77ca103 in _initClIcd () at ocl_icd_loader.c:724
No locals.
#33 clGetPlatformIDs (num_entries=0, platforms=0x0,
num_platforms=0x611798) at ocl_icd_loader.c:846
No locals.
#34 0x0000000000401328 in ?? ()
No symbol table info available.
#35 0x00007ffff72432b1 in __libc_start_main (main=0x401180, argc=1,
argv=0x7fffffffe4e8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffe4d8) at
../csu/libc-start.c:291
result = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0,
-3531784265718404871, 4199808, 140737488348384, 0, 0,
3531784811878967545, 3531800833527671033}, mask_was_saved = 0}}, priv =
{pad = {0x0, 0x0, 0x1, 0x401180}, data = {prev = 0x0, cleanup = 0x0,
canceltype = 1}}}
not_first_call = <optimized out>
#36 0x00000000004015a9 in ?? ()
No symbol table info available.
[...immediately followed by...]
(gdb) c
Continuing.
: CommandLine Error: Option 'enable-value-profiling' registered more
than once!
LLVM ERROR: inconsistency in registered CommandLine options
[Inferior 1 (process 9938) exited with code 01]

Rebecca N. Palmer

unread,
Feb 13, 2017, 2:50:02 AM2/13/17
to
Control: forwarded -1 https://bugs.llvm.org/show_bug.cgi?id=30587
(They actually found it independently, but it's clearly the same bug.)

They don't have a fix for this one; they do have fixes for
https://bugs.llvm.org/show_bug.cgi?id=31571 /
https://bugs.llvm.org/show_bug.cgi?id=28127 (similar problems in LLVM's
own tools), but it's not yet clear whether these can help us.

Rebecca N. Palmer

unread,
Feb 18, 2017, 5:20:02 PM2/18/17
to
Control: tags -1 patch

Statically linking to LLVM (see attached) fixes this bug, but I'm not
sure yet whether we want to do that.
852746_static_llvm.patch

Ivan Baldo

unread,
Feb 19, 2017, 8:50:02 PM2/19/17
to
All OpenCL ICDs with shared LLVM are useless if they can't be used
in real programs, so my opinion for whats its worth is that they link
statically with LLVM until the issue is resolved in another way allowing
shared LLVM (probably Stretch+1 material).

Of course this is just my opinion... but, please think about it.

Thanks A LOT!!!



El 18/02/17 a las 19:11, Rebecca N. Palmer escribió:
> Control: tags -1 patch
>
> Statically linking to LLVM (see attached) fixes this bug, but I'm not
> sure yet whether we want to do that.

--
Ivan Baldo - iba...@adinet.com.uy - http://ibaldo.codigolibre.net/
Freelance C++/PHP programmer and GNU/Linux systems administrator.
The sky is not the limit!

Andreas Beckmann

unread,
Feb 20, 2017, 4:00:03 AM2/20/17
to
Dear security team,

we plan to switch the OpenCL ICD beignet (and perhaps other ICDs if
neccessary) to link statically instead of dynamically against LLVM, to
work around #852746.

Currently OpenCL applications crash if both mesa-opencl-icd and
beignet-opencl-icd are installed - both link dynamically against LLVM
and are stepping somehow on each others toes. This makes OpenCL ICDs
pretty useless if the idea of having several of them installed does not
work (all available ICDs will be loaded by the application and queried
for available platforms/devices, thereafter the application can decide
which one to use).

On 2017-02-18 23:11, Rebecca N. Palmer wrote:
> Statically linking to LLVM (see attached) fixes this bug, but I'm not
> sure yet whether we want to do that.

The underlying issue is being investigated further, but I do not expect
a solution to be available for stretch.

I hope the security team agrees with this this workaround.
Since you want to keep track of statically linked packages:
For stretch src:beignet will be linked statically against
src:llvm-toolchain-3.9


Andreas

Moritz Muehlenhoff

unread,
Feb 20, 2017, 4:40:03 AM2/20/17
to
Sounds fine. Please keep us in the loop when/if that has been fixed and
reverted at some point after the stretch release.

Cheers,
Moritz

Andreas Beckmann

unread,
Feb 20, 2017, 5:30:04 AM2/20/17
to
Control: retitle -1 beignet+mesa-opencl-icd crash if installed together and linked dynamically against LLVM
Control: severity -1 important

On 2017-02-18 23:11, Rebecca N. Palmer wrote:
> Statically linking to LLVM (see attached) fixes this bug, but I'm not
> sure yet whether we want to do that.

Please prepare the upload in git, just don't close the bug
(only reference it), I just lowered the severity.

And file an unblock request once this is in sid :-)


Andreas

Rebecca N. Palmer

unread,
Mar 8, 2017, 3:00:02 PM3/8/17
to
Control: tags -1 - patch
Control: tags -1 upstream
Control: reassign -1 libllvm3.9

The real bug here is that libllvm is a shared library with global state,
and that loading it twice from the same application (the process of
checking which OpenCL driver works on the available hardware involves
loading all drivers) hence doesn't work.

beignet-opencl-icd is now statically linked against libllvm to work
around this bug, but I don't know whether anything else is affected.

Rebecca N. Palmer

unread,
Nov 14, 2018, 5:50:03 PM11/14/18
to
Control: reopen -1
Control: reassign -1 libllvm6.0
Control: found -1 1:6.0.1-9.2
Control: affects -1 src:pocl mesa-opencl-icd
Control: retitle -1 crash if multiple ICDs dynamically linked to LLVM
X-Debbugs-CC: pkg-open...@alioth-lists.debian.net

This bug still exists in LLVM 6.0 (and given the still-open upstream
report, probably 7 and snapshot, though I haven't tried to verify that).
It now affects the mesa+pocl combination:

# apt-get install clinfo pocl-opencl-icd mesa-opencl-icd
$ clinfo
: CommandLine Error: Option 'limited-coverage-experimental' registered
more than once!
LLVM ERROR: inconsistency in registered CommandLine options

A similar 'statically link to LLVM' workaround would probably work for
them, but I haven't actually tried this.

Lukáš Durďák

unread,
Aug 6, 2020, 9:20:03 AM8/6/20
to
Hi, I am unsure which bug report is correct for this as there is similar one #898033 and #954849 but I could confirm the problem is back since approximately May 2020 up to today:
It could be basically any program using opencl, I've picked the clinfo as an example:

$ clinfo
: CommandLine Error: Option 'polly' registered more than once!

LLVM ERROR: inconsistency in registered CommandLine options

$ sudo apt remove mesa-opencl-icd
... package mesa-opencl-icd removed...

$ dpkg -l | grep opencl
ii  intel-opencl-icd                      20.13.16352-1                    amd64        Intel graphics compute runtime for OpenCL
ii  libopencl-clang10                     10.0.0-2                         amd64        thin wrapper for clang
ii  libopencl1-amdgpu-pro:amd64           20.20-1098277                    amd64        AMD OpenCL ICD Loader library
rc  mesa-opencl-icd:amd64                 20.1.4-1                         amd64        free implementation of the OpenCL API -- ICD runtime
ii  ocl-icd-libopencl1:amd64              2.2.12-4                         amd64        Generic OpenCL ICD Loader
ii  ocl-icd-opencl-dev:amd64              2.2.12-4                         amd64        OpenCL development files
ii  opencl-c-headers                      3.0~2020.05.12-g5cc337c-1        all          OpenCL (Open Computing Language) C header files
ii  opencl-clhpp-headers                  2.2.0~~2.0.11+git9-g0192662-1    all          C++ headers for OpenCL development
ii  opencl-headers                        3.0~2020.05.12-g5cc337c-1        all          OpenCL (Open Computing Language) header files
ii  opencl-orca-amdgpu-pro-icd:amd64      20.20-1098277                    amd64        non-free AMD OpenCL ICD Loaders

$ clinfo
Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.1 AMD-APP (3110.6)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback cl_amd_offline_devices
  Platform Host timer resolution                  1ns
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing


BR//L.D.


0 new messages