I know this question is similar to may other ones but none of them seem to solve my problem.
Symptoms
gdb_test
with gdb.SIGILL
's:~/projects/gdb_test/build> gdb gdb_test
GNU gdb (GDB; openSUSE Tumbleweed) 8.3.1
(...)
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gdb_test...
(gdb) r
Starting program: /home/jaques/projects/gdb_test/build/gdb_test
Missing separate debuginfos, use: zypper install glibc-debuginfo-2.31-5.9.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffebae8700 (LWP 1210)]
[New Thread 0x7fffeb2e7700 (LWP 1211)]
[New Thread 0x7fffe6ae6700 (LWP 1212)]
Thread 1 "gdb_test" received signal SIGILL, Illegal instruction.
0x00007ffff7d90617 in ?? () from /usr/lib64/libopencv_gapi.so.4.2
(gdb)
Sample project:
"main.cpp"
#include <iostream>
int main(int argc, char **argv) {
std::cout << "Hello, world!" << std::endl;
return 0;
}
CMakeLists.txt:
cmake_minimum_required(VERSION 3.0)
project(gdb_test)
find_package( OpenCV REQUIRED ) # Works fine if this line is removed.
add_executable(gdb_test main.cpp)
install(TARGETS gdb_test RUNTIME DESTINATION bin)
Environment
NAME="openSUSE Tumbleweed" VERSION="20200622"
gdb_test/build> file gdb_test gdb_test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=28f8c835686d92c15cb8b0cfb201c5f45a8a89c7, for GNU/Linux 3.2.0, with debug_info, not stripped
What can be wrong?
How to solve?
Any ideas?
Thanks.
According to your comment:
I downgraded from opencv-devel-4.2.0-4.1.x86_64 to opencv3-3.4.9-2.4.x86_64 and it is not crashing anymore..
I can only conclude the package is broken.
In case you really need OpenCV 4, I suggest you to build from sources.