[Pkg-opencl-devel] Bug#852746: beignet+mesa-opencl-icd crash if installed together

Rebecca N. Palmer rebecca_palmer at zoho.com
Fri Jan 27 22:03:30 UTC 2017


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 at entry=1, argv=argv at entry=0x7fffffffe4e8, 
env=env at 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 at entry=0x61a520, argc=1, 
argv=0x7fffffffe4e8, env=0x7fffffffe4f8) at dl-init.c:120
#6  0x00007ffff7deccd8 in dl_open_worker (a=a at entry=0x7fffffffdfc0) at 
dl-open.c:575
#7  0x00007ffff7de84f4 in _dl_catch_error 
(objname=objname at entry=0x7fffffffdfb0, 
errstring=errstring at entry=0x7fffffffdfb8, 
mallocedp=mallocedp at entry=0x7fffffffdfaf, 
operate=operate at entry=0x7ffff7dec8f0 <dl_open_worker>, 
args=args at 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 at 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 at entry=0x7ffff75c1e90 <dlopen_doit>, 
args=args at entry=0x7fffffffe1f0) at dlerror.c:163
#12 0x00007ffff75c1f82 in __dlopen (file=file at entry=0x61a4b0 
"libMesaOpenCL.so.1", mode=mode at entry=1) at dlopen.c:87
#13 0x00007ffff77c926f in _load_icd (num_icds=num_icds at entry=0, 
lib_path=lib_path at entry=0x61a4b0 "libMesaOpenCL.so.1") at 
ocl_icd_loader.c:184
#14 0x00007ffff77c93bd in _open_driver (num_icds=num_icds at entry=0, 
dir_path=<optimized out>, dir_path at entry=0x7ffff77cb78e 
"/etc/OpenCL/vendors", file_path=<optimized out>, 
file_path at 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 at entry=1, argv=argv at entry=0x7fffffffe4e8, 
env=env at 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 at 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 at 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 at entry=0x7fffffffda50, 
errstring=errstring at entry=0x7fffffffda58, 
mallocedp=mallocedp at entry=0x7fffffffda4f, 
operate=operate at entry=0x7ffff7dec8f0 <dl_open_worker>, 
args=args at 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 at 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 at entry=0x7ffff75c1e90 <dlopen_doit>, 
args=args at entry=0x7fffffffdc90) at dlerror.c:163
         result = 0x7ffff77c40c0 <last_result>
#12 0x00007ffff75c1f82 in __dlopen (file=<optimized out>, 
mode=mode at 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 at entry=1, argv=argv at entry=0x7fffffffe4e8, 
env=env at 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 at 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 at 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 at entry=0x7fffffffdfb0, 
errstring=errstring at entry=0x7fffffffdfb8, 
mallocedp=mallocedp at entry=0x7fffffffdfaf, 
operate=operate at entry=0x7ffff7dec8f0 <dl_open_worker>, 
args=args at 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 at 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 at entry=0x7ffff75c1e90 <dlopen_doit>, 
args=args at entry=0x7fffffffe1f0) at dlerror.c:163
         result = 0x7ffff77c40c0 <last_result>
#26 0x00007ffff75c1f82 in __dlopen (file=file at entry=0x666cb0 
"/usr/lib/x86_64-linux-gnu/beignet//libcl.so", mode=mode at 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 at entry=2, 
lib_path=lib_path at 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 at entry=2, 
dir_path=<optimized out>, dir_path at entry=0x7ffff77cb78e 
"/etc/OpenCL/vendors", file_path=<optimized out>, 
file_path at 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]



More information about the Pkg-opencl-devel mailing list