OpenThermal / libseek-thermal

SEEK thermal compact camera driver supporting the thermal Compact, thermal CompactXR and and thermal CompactPRO
MIT License
286 stars 99 forks source link

Segmentation Fault on Raspberry Pi 4 when running executables #73

Open cluesang opened 2 years ago

cluesang commented 2 years ago

Steps to Reproduce

Follow README to generate executables. Run any of the example executables:

pi@raspberry:~/libseek-thermal/build/examples $ ls
CMakeFiles  cmake_install.cmake  Makefile  seek_create_flat_field  seek_snapshot  seek_test  seek_test_pro  seek_viewer
pi@raspberry:~/libseek-thermal/build/examples $ ./seek_create_flat_field 
Segmentation fault
pi@raspberry:~/libseek-thermal/build/examples $ ./seek_snapshot 
Segmentation fault
pi@raspberry:~/libseek-thermal/build/examples $ ./seek_test
Segmentation fault
pi@raspberry:~/libseek-thermal/build/examples $ ./seek_test_pro 
Segmentation fault
pi@raspberry:~/libseek-thermal/build/examples $ ./seek_viewer 
Segmentation fault

Running gdb produces:

pi@raspberry:~/libseek-thermal/build/examples $ gdb ./seek_snapshot 
GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 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 "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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 ./seek_snapshot...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/pi/libseek-thermal/build/examples/seek_snapshot 

Program received signal SIGSEGV, Segmentation fault.
_dl_check_map_versions (map=map@entry=0xb6ff4af8, verbose=-1239222416, verbose@entry=1, trace_mode=trace_mode@entry=0) at dl-version.c:218
218 dl-version.c: No such file or directory.
(gdb) bt
#0  _dl_check_map_versions (map=map@entry=0xb6ff4af8, verbose=-1239222416, verbose@entry=1, trace_mode=trace_mode@entry=0) at dl-version.c:218
#1  0xb6fdfb48 in _dl_check_all_versions (map=<optimized out>, verbose=verbose@entry=1, trace_mode=0) at dl-version.c:367
#2  0xb6fcf314 in version_check_doit (a=0xbefff448, a@entry=<error reading variable: value has been optimized out>) at rtld.c:624
#3  0xb6fe69ac in _dl_receive_error (fct=<optimized out>, operate=<optimized out>, args=args@entry=0xbefff448) at dl-error-skeleton.c:234
#4  0xb6fd19e8 in dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=<optimized out>, auxv=<optimized out>) at rtld.c:1796
#5  0xb6fe5988 in _dl_sysdep_start (start_argptr=start_argptr@entry=0xbefff620, dl_main=0xb6fcff0c <dl_main>) at ../elf/dl-sysdep.c:253
#6  0xb6fcf684 in _dl_start_final (arg=0xbefff620) at rtld.c:415
#7  _dl_start (arg=0xbefff620) at rtld.c:522
#8  0xb6fcea40 in _start () from /lib/ld-linux-armhf.so.3
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Not sure what the problem is exactly. Perhaps a statically linked object isn't being called correctly.

Here's an strace:

pi@raspberry:~/libseek-thermal/build/examples $ sudo strace ./seek_snapshot --help
[...]
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/liblz4.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\240\31\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=112144, ...}) = 0
mmap2(NULL, 176352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa8c56000
mprotect(0xa8c70000, 65536, PROT_NONE)  = 0
mmap2(0xa8c80000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a000) = 0xa8c80000
close(3)                                = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa8c54000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x4} ---
+++ killed by SIGSEGV +++
Segmentation fault