-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Software using OpenCV doesn't work. #1194
Comments
Hi, Jack |
This is the same issue as #286. |
@zingmars Are you familiar with the OpenCV source? I looked into it a bit yesterday and I'm stumped. I see the shared libraries flagged for execstack (use scanelf -qeR . in the cmake build directory), but I don't see any .o files that are. Nor do I have system libraries (scanelf -lqe) such as zlib that might cause it. Which leaves linker options, maybe? |
Closing as this is marked as duplicated. Please refer to #286 for future comments/reports on this topic. |
Please use the following bug reporting template to help produce actionable and reproducible issues. Please try to ensure that the reproduction is minimal so that the team can go through more bugs!
When trying to run any program compiled against opencv it will fail to run with an error message.
Program executes correctly.
./opencv_test: error while loading shared libraries: libopencv_imgproc.so.3.1: cannot enable executable stack as shared object requires: Invalid argument
Microsoft Windows [Version 10.0.14393]
Download and install opencv
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
cd opencv
mkdir bin
cd bin
cmake -DCMAKE_BUILD_TYPE=Release -DOPENCV_EXTRA_MODULES_PATH="../../opencv_contrib/modules" -DBUILD_TESTS=NO -DBUILD_PERF_TESTS=NO ..
make -j$(nproc)
sudo make install
sudo ldconfig
Compile and run any program that requires opencv. To recreate the examples from OpenCV's website can be used. (I.e. http://docs.opencv.org/3.1.0/d0/d2a/contours2_8cpp-example.html)
`g++ -o opencv_test contours2.cpp
pkg-config opencv --cflags --libs
./opencv_test
execve("./opencv_test", ["./opencv_test"], [/* 19 vars */]) = 0
brk(0) = 0x1998000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fccacd30000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("tls/x86_64/libopencv_highgui.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("tls/libopencv_highgui.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("x86_64/libopencv_highgui.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("libopencv_highgui.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/tls/x86_64/libopencv_highgui.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/tls/x86_64", 0x7fffce0e2f40) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/tls/libopencv_highgui.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/tls", 0x7fffce0e2f40) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/x86_64/libopencv_highgui.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/x86_64", 0x7fffce0e2f40) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/libopencv_highgui.so.3.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320@\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0644, st_size=63635, ...}) = 0
mmap(NULL, 2144008, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fccac7f0000
mprotect(0x7fccac7fb000, 2093056, PROT_NONE) = 0
mmap(0x7fccac9fa000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa000) = 0x7fccac9fa000
close(3) = 0
open("tls/x86_64/libopencv_imgproc.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("tls/libopencv_imgproc.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("x86_64/libopencv_imgproc.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("libopencv_imgproc.so.3.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/libopencv_imgproc.so.3.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \222\r\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=24103817, ...}) = 0
mmap(NULL, 25281328, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fccaafd0000
mprotect(0x7fccac52a000, 2093056, PROT_NONE) = 0
mmap(0x7fccac729000, 184320, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1559000) = 0x7fccac729000
mmap(0x7fccac756000, 615216, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fccac756000
mprotect(0x7fffce0e3000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) = -1 EINVAL (Invalid argument)
close(3) = 0
writev(2, [{"./opencv_test", 13}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"libopencv_imgproc.so.3.1", 24}, {": ", 2}, {"cannot enable executable stack a"..., 56}, {": ", 2}, {"Invalid argument", 16}, {"\n", 1}], 10./opencv_test: error while loading shared libraries: libopencv_imgproc.so.3.1: cannot enable executable stack as shared object requires: Invalid argument
) = 154
exit_group(127) = ?
+++ exited with 127 +++
OpenCV, g++, git, cmake, make
Also seems to be reported here, although not by me.
The text was updated successfully, but these errors were encountered: