Open
Description
Describe the bug
Affected tests:
TaskSequence/concurrent-loops.cpp
TaskSequence/in-order-async-get.cpp
TaskSequence/mult-and-add.cpp
TaskSequence/multi-kernel-task-function-reuse.cpp
TaskSequence/producer-consumer.cpp
TaskSequence/struct-array-args-and-return.cpp
They all fail during compilation with Segmentation fault
both on Linux and Windows.
Linux:
user@host:/llvm/sycl/test-e2e/TaskSequence$ clang++ -fsycl -fintelfpga concurrent-loops.cpp
llvm-foreach: Segmentation fault (core dumped)
clang++: error: fpga compiler command failed with exit code 254 (use -v to see invocation)
clang version 19.0.0git (https://github.com/intel/llvm.git caabc3714462cd46958e3fb04280c9b467a8e0e8)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /compiler/build/bin
Build config: +assertions
clang++: note: diagnostic msg: Error generating preprocessed source(s).
Windows:
bash-3.2$ clang-cl /EHsc -fsycl -fintelfpga concurrent-loops.cpp
llvm-foreach:
clang-cl: error: fpga compiler command failed due to signal (use -v to see invocation)
clang version 19.0.0git (https://github.com/intel/llvm.git caabc3714462cd46958e3fb04280c9b467a8e0e8)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: \\compiler\build\bin
Build config: +assertions
clang-cl: note: diagnostic msg: Error generating preprocessed source(s).
To reproduce
- Include a code snippet that is as short as possible
See sources of tests which were listed above - Specify the command which should be used to compile the program
Use command in // RUN comment of these tests - Specify the command which should be used to launch the program
Not needed, the failure is compfail - Indicate what is wrong and what was expected
Tests should compile without any errors/crashes
Environment
- OS: Windows, Linux
- Target device and vendor: accelerator (FPGA Fast Emu)
- DPC++ version: latest available, e.g. caabc37
- Dependencies version:
[opencl:fpga][opencl:0] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [LATEST_AVAILABLE_INTERNAL_VERSION_AS_OF_20240625]
Additional context
Investigation
Using -###
it was found that crash happens during OpenCL offline compilation in opencl-aot
tool: there is a failure in FPGA Fast Emu RT:
user@host:/llvm/sycl/test-e2e/TaskSequence$ "/compiler/build/bin/opencl-aot" "-device=fpga_fast_emu" "-spv=/tmp/concurrent-loops-7c30ad-b55332.spv" "-ir=/tmp/concurrent-loops-c376cd.aocx" "--bo=-g"
Segmentation fault (core dumped)
Backtrace leads to a crash in FPGA Fast Emu RT:
user@host:/llvm/sycl/test-e2e/TaskSequence$ gdb "/compiler/build/bin/opencl-aot"
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /compiler/build/bin/opencl-aot...
(No debugging symbols found in /compiler/build/bin/opencl-aot)
(gdb) r "-device=fpga_fast_emu" "-spv=/tmp/concurrent-loops-7c30ad-b55332.spv" "-ir=/tmp/concurrent-loops-c376cd.aocx" "--bo=-g"
Starting program: /compiler/build/bin/opencl-aot "-device=fpga_fast_emu" "-spv=/tmp/concurrent-loops-7c30ad-b55332.spv" "-ir=/tmp/concurrent-loops-c376cd.aocx" "--bo=-g"
[Detaching after fork from child process 2658328]
[Detaching after fork from child process 2658329]
process 2658325 is executing new program: /compiler/build/bin/opencl-aot
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe1714640 (LWP 2658342)]
[New Thread 0x7fffc89c2640 (LWP 2658343)]
[New Thread 0x7fffc01c1640 (LWP 2658344)]
[New Thread 0x7fffc3fff640 (LWP 2658345)]
[New Thread 0x7fffc27fc640 (LWP 2658347)]
[New Thread 0x7fffc37fe640 (LWP 2658346)]
[New Thread 0x7fffc2ffd640 (LWP 2658348)]
[New Thread 0x7fffc1ffb640 (LWP 2658349)]
[New Thread 0x7fffc17fa640 (LWP 2658350)]
[New Thread 0x7fffbf9c0640 (LWP 2658352)]
[New Thread 0x7fffc0ff9640 (LWP 2658351)]
[New Thread 0x7fffbf1bf640 (LWP 2658353)]
[New Thread 0x7fffbe9be640 (LWP 2658354)]
[New Thread 0x7fffbc9ba640 (LWP 2658359)]
[New Thread 0x7fffbe1bd640 (LWP 2658355)]
[New Thread 0x7fff977fe640 (LWP 2658358)]
[New Thread 0x7fff97fff640 (LWP 2658357)]
[New Thread 0x7fff96ffd640 (LWP 2658361)]
[New Thread 0x7fffbd9bc640 (LWP 2658356)]
[New Thread 0x7fffbd1bb640 (LWP 2658360)]
[New Thread 0x7fff95ffb640 (LWP 2658363)]
[New Thread 0x7fff967fc640 (LWP 2658362)]
[New Thread 0x7fff79ffb640 (LWP 2658370)]
[New Thread 0x7fff957fa640 (LWP 2658364)]
[New Thread 0x7fff94ff9640 (LWP 2658367)]
[New Thread 0x7fff7affd640 (LWP 2658368)]
[New Thread 0x7fff7b7fe640 (LWP 2658366)]
[New Thread 0x7fff7a7fc640 (LWP 2658369)]
[New Thread 0x7fff7bfff640 (LWP 2658365)]
[New Thread 0x7fff78ff9640 (LWP 2658371)]
[New Thread 0x7fff797fa640 (LWP 2658372)]
[New Thread 0x7fff4ffff640 (LWP 2658373)]
Thread 1 "opencl-aot" received signal SIGSEGV, Segmentation fault.
0x00007ffff5a72f90 in SPIRV::SPIRVEntry::setModule(SPIRV::SPIRVModule*) () from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
(gdb) bt
#0 0x00007ffff5a72f90 in SPIRV::SPIRVEntry::setModule(SPIRV::SPIRVModule*) () from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#1 0x00007ffff5aba44e in SPIRV::SPIRVDecoder::getEntry() () from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#2 0x00007ffff5ab063e in SPIRV::operator>>(std::__1::basic_istream<char, std::__1::char_traits<char> >&, SPIRV::SPIRVModule&) ()
from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#3 0x00007ffff59e37e1 in llvm::readSpirv(llvm::LLVMContext&, SPIRV::TranslatorOpts const&, std::__1::basic_istream<char, std::__1::char_traits<char> >&, llvm::Module*&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) () from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#4 0x00007ffff4e90773 in Intel::OpenCL::ClangFE::ClangFECompilerParseSPIRVTask::ParseSPIRV(Intel::OpenCL::ClangFE::IOCLFEBinaryResult**) ()
from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#5 0x00007ffff4e87ab2 in Intel::OpenCL::ClangFE::ClangFECompiler::ParseSPIRV(Intel::OpenCL::FECompilerAPI::FESPIRVProgramDescriptor*, Intel::OpenCL::ClangFE::IOCLFEBinaryResult**) ()
from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#6 0x00007ffff4e71966 in Intel::OpenCL::Framework::FrontEndCompiler::ParseSpirv(char const*, unsigned int, char const*, unsigned long, unsigned int const*, unsigned long const*, char**, unsigned long*, char**) const () from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#7 0x00007ffff4e18957 in Intel::OpenCL::Framework::CompileTask::Execute() () from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#8 0x00007ffff4e18d7d in non-virtual thunk to Intel::OpenCL::Framework::CompileTask::Execute() () from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#9 0x00007ffff4eab0e6 in Intel::OpenCL::TaskExecutor::execute_command(Intel::OpenCL::Utils::SharedPtr<Intel::OpenCL::TaskExecutor::ITaskBase> const&, Intel::OpenCL::TaskExecutor::base_command_list&) ()
from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#10 0x00007ffff4ec45ca in tbb::detail::d1::task_arena_function<Intel::OpenCL::TaskExecutor::immediate_executor_task, void>::operator()() const ()
from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#11 0x00007fffeae15617 in tbb::detail::r1::task_arena_impl::execute (ta=..., d=warning: RTTI symbol not found for class 'SPIRV::SPIRVModuleImpl'
...) at /tmp/onetbb-ci/onetbb_source_code/src/tbb/arena.cpp:796
#12 0x00007ffff4ec20c0 in Intel::OpenCL::TaskExecutor::immediate_command_list::LaunchExecutorTask(bool, Intel::OpenCL::Utils::SharedPtr<Intel::OpenCL::TaskExecutor::ITaskBase> const&) ()
from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#13 0x00007ffff4dd6506 in Intel::OpenCL::Framework::FrameworkProxy::ExecuteImmediate(Intel::OpenCL::Utils::SharedPtr<Intel::OpenCL::TaskExecutor::ITaskBase> const&) const ()
from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#14 0x00007ffff4e17c8f in Intel::OpenCL::Framework::BuildTask::Launch() () from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#15 0x00007ffff4e2003f in Intel::OpenCL::Framework::ProgramService::BuildProgram(Intel::OpenCL::Utils::SharedPtr<Intel::OpenCL::Framework::Program>&, unsigned int, _cl_device_id* const*, char const*, void (*)(--Type <RET> for more, q to quit, c to continue without paging--
_cl_program*, void*), void*) () from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#16 0x00007ffff4dfef8b in Intel::OpenCL::Framework::Context::BuildProgram(_cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*) ()
from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#17 0x00007ffff4de14b3 in Intel::OpenCL::Framework::ContextModule::BuildProgram(_cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*) ()
from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#18 0x00007ffff4d931cf in clBuildProgram () from /opencl/runtime/linux/oclfpgaemu/INTERNAL_VERSION/libintelocl_emu.so
#19 0x00007ffff7c068b5 in clBuildProgram () from /compiler/build/bin/../lib/libOpenCL.so.1
#20 0x000000000040790a in main ()
(gdb)