compute-runtime: `clBuildProgram` segfaults on Intel UHD Graphics 630
Our libraries using OpenCL through intel-compute-runtime segfault on both Ubuntu 18.04 and Arch on an Intel 9900K. Running this on both NVIDIA 1660 and Radeon RX550 did not crash. Compiling just the snippet of OpenCL in a minimal program calling clBuildProgram and running it on Intel did not crash.
I am inlining a minimal DockerFile to reproduce the crash.
FROM ubuntu:bionic
RUN apt-get update
RUN apt-get install -y wget clinfo p7zip-full g++
WORKDIR /root
RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.5.0+63f281e2-26/u18/zivid-telicam-driver_2.0.0.1-1_amd64.deb
RUN wget http://www.zivid.com/hubfs/softwarefiles/releases/1.5.0+63f281e2-26/u18/zivid_1.5.0+63f281e2-26_amd64.deb
RUN wget https://github.com/intel/compute-runtime/releases/download/19.36.14103/intel-gmmlib_19.2.3_amd64.deb
RUN wget https://github.com/intel/compute-runtime/releases/download/19.36.14103/intel-igc-core_1.0.11-2500_amd64.deb
RUN wget https://github.com/intel/compute-runtime/releases/download/19.36.14103/intel-igc-opencl_1.0.11-2500_amd64.deb
RUN wget https://github.com/intel/compute-runtime/releases/download/19.36.14103/intel-opencl_19.36.14103_amd64.deb
RUN wget https://github.com/intel/compute-runtime/releases/download/19.36.14103/intel-ocloc_19.36.14103_amd64.deb
RUN dpkg --install *.deb; exit 0
RUN apt-get install -fy
RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.5.0+63f281e2-26/Zivid-1.5.0+63f281e2-26-Samples.zip
RUN 7z x Zivid-1.5.0+63f281e2-26-Samples.zip
RUN wget https://zivid.com/software/ZividSampleData.zip
RUN 7z x ZividSampleData.zip
WORKDIR /root/Samples/CPP/SampleCaptureFromFile
RUN g++ SampleCaptureFromFile.cpp -lZividCore -o SampleCaptureFromFile
ENV ZIVID_DATA /root
Steps to reproduce
- Build the image with
docker build -t neocrash . - Run it with
docker run -it --rm --device /dev/dri:/dev/dri neocrash:latest - Run
./SampleCaptureFromFilein the shell
Stack trace from the container
#0 0x0000000000000000 in ?? ()
#1 0x00007fb2e49bd827 in __pthread_once_slow (once_control=0x7fb2dbfc1e60, init_routine=0x7fb2e5a93830 <__once_proxy>) at pthread_once.c:116
#2 0x00007fb2d9c99725 in ?? () from /usr/local/lib/libopencl-clang.so.8
#3 0x00007fb2d9c876ae in ?? () from /usr/local/lib/libopencl-clang.so.8
#4 0x00007fb2d8635aef in ?? () from /usr/local/lib/libopencl-clang.so.8
#5 0x00007fb2e8c0f733 in call_init (env=0x7ffd677a17c8, argv=0x7ffd677a17b8, argc=1, l=<optimized out>) at dl-init.c:72
#6 _dl_init (main_map=main_map@entry=0x55baec6ffe30, argc=1, argv=0x7ffd677a17b8, env=0x7ffd677a17c8) at dl-init.c:119
#7 0x00007fb2e8c141ff in dl_open_worker (a=a@entry=0x7ffd6779ffb0) at dl-open.c:522
#8 0x00007fb2e55352df in __GI__dl_catch_exception (exception=0x7ffd6779ff90, operate=0x7fb2e8c13dc0 <dl_open_worker>, args=0x7ffd6779ffb0) at dl-error-skeleton.c:196
#9 0x00007fb2e8c137ca in _dl_open (file=0x7ffd677a02e0 "libigdfcl.so.1", mode=-2147483639, caller_dlopen=0x7fb2e2b70bc9, nsid=<optimized out>, argc=1, argv=<optimized out>, env=0x7ffd677a17c8) at dl-open.c:605
#10 0x00007fb2e4204f96 in dlopen_doit (a=a@entry=0x7ffd677a01e0) at dlopen.c:66
#11 0x00007fb2e55352df in __GI__dl_catch_exception (exception=exception@entry=0x7ffd677a0180, operate=0x7fb2e4204f40 <dlopen_doit>, args=0x7ffd677a01e0) at dl-error-skeleton.c:196
#12 0x00007fb2e553536f in __GI__dl_catch_error (objname=0x55baec5d94a0, errstring=0x55baec5d94a8, mallocedp=0x55baec5d9498, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#13 0x00007fb2e4205735 in _dlerror_run (operate=operate@entry=0x7fb2e4204f40 <dlopen_doit>, args=args@entry=0x7ffd677a01e0) at dlerror.c:162
#14 0x00007fb2e4205051 in __dlopen (file=<optimized out>, mode=<optimized out>) at dlopen.c:87
#15 0x00007fb2e2b70bc9 in ?? () from /usr/local/lib/intel-opencl/libigdrcl.so
#16 0x00007fb2e2b70c1d in ?? () from /usr/local/lib/intel-opencl/libigdrcl.so
#17 0x00007fb2e2b196e2 in ?? () from /usr/local/lib/intel-opencl/libigdrcl.so
#18 0x00007fb2e2b2fbed in ?? () from /usr/local/lib/intel-opencl/libigdrcl.so
#19 0x00007fb2e2b75146 in ?? () from /usr/local/lib/intel-opencl/libigdrcl.so
#20 0x00007fb2e2ae46fa in ?? () from /usr/local/lib/intel-opencl/libigdrcl.so
#21 0x00007fb2e6419f84 in clBuildProgram () from /usr/lib/libZividCore.so
Stacktrace from crash reproduced on Arch
intel-compute-runtime 19.36.14103-1intel-gmmlib 19.2.4-1intel-graphics-compiler 1:1.0.11-1intel-opencl-clang 8.0.1-2
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff7d3cdbf in __pthread_once_slow () from /usr/lib/libpthread.so.0
#2 0x00007fff790e5719 in llvm::ManagedStaticBase::RegisterManagedStatic(void* (*)(), void (*)(void*)) const () from /usr/lib/libLLVM-8.so
#3 0x00007fff7908d973 in llvm::cl::OptionCategory::registerCategory() () from /usr/lib/libLLVM-8.so
#4 0x00007fff78f84930 in llvm::X86ATTInstPrinter::printCustomAliasOperand(llvm::MCInst const*, unsigned int, unsigned int, llvm::raw_ostream&) () from /usr/lib/libLLVM-8.so
#5 0x00007ffff7fe279a in call_init.part () from /lib64/ld-linux-x86-64.so.2
#6 0x00007ffff7fe28a1 in _dl_init () from /lib64/ld-linux-x86-64.so.2
#7 0x00007ffff7fe6683 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#8 0x00007ffff1eec3d9 in _dl_catch_exception () from /usr/lib/libc.so.6
#9 0x00007ffff7fe5f5e in _dl_open () from /lib64/ld-linux-x86-64.so.2
#10 0x00007ffff7d4e34c in ?? () from /usr/lib/libdl.so.2
#11 0x00007ffff1eec3d9 in _dl_catch_exception () from /usr/lib/libc.so.6
#12 0x00007ffff1eec473 in _dl_catch_error () from /usr/lib/libc.so.6
#13 0x00007ffff7d4eab9 in ?? () from /usr/lib/libdl.so.2
#14 0x00007ffff7d4e3da in dlopen () from /usr/lib/libdl.so.2
#15 0x00007fffe481dc37 in ?? () from /usr/lib/intel-opencl/libigdrcl.so
#16 0x00007fffe481dc8c in ?? () from /usr/lib/intel-opencl/libigdrcl.so
#17 0x00007fffe47c252a in ?? () from /usr/lib/intel-opencl/libigdrcl.so
#18 0x00007fffe47c17e5 in ?? () from /usr/lib/intel-opencl/libigdrcl.so
#19 0x00007fffe47d41e2 in ?? () from /usr/lib/intel-opencl/libigdrcl.so
#20 0x00007fffe4822269 in ?? () from /usr/lib/intel-opencl/libigdrcl.so
#21 0x00007fffe4781bd0 in ?? () from /usr/lib/intel-opencl/libigdrcl.so
#22 0x00007ffff494a9b8 in clBuildProgram () from xxx/libZividCore.so
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 20 (10 by maintainers)
Yes we use RTLD_DEEPBIND, because Neo loads IGC using dlopen, and IGC can be linked statically with llvm libraries. Closing issue, as it was fixed on libZividCore side.
It was added to fix issue #122 If you see problems with this flag you can set -DSANITIZER_BUILD in CMAKE_CXX_FLAGS.
I can confirm that the
LD_PRELOADworkaround fixes the issue.With below patch
I was able to reproduce similar segfault in Ubuntu 18.04 docker container
When I set LD_PRELOAD to load libstdc++.so.6, application executed correctly:
When I removed mentioned patch, and used original intel-opencl package (19.36.14103) with LD_PRELOAD set as earlier, application also executed correctly.