I use DVR-Scan 1.0.1 [1] for video surveillance (scan video files got from an IP camera) under a Raspbian GNU/Linux 8.0 (jessie) system on a Raspberry Pi 3 model B. DVR-Scan depends on Python and OpenCV 3.1.0, this latter was compiled by me from source using: cmake; make; sudo make install; following these instructions: [2]

Everything worked fine for a long time (minimum two years) until last month. After a system reboot, running dvr-scan would result in a Segmentation fault with exit code 139. I also get that error when running OpenCV demo executables (like: opencv_test_core) and running: python -c "import cv2". I temporarily solved it by running fsck at boot time (cause I could see some directory error in /var/log/syslog) by adding fsck.mode=force to file /boot/cmdline.txt; but some days ago, after another system reboot, the problem appeared again and this time does not seem to have to do with a filesystem problem. I'm not an expert but it's like the root problem is related to OpenCV (misconfiguration, missing and/or corrupted files?).

I run gdb and I got these outputs:


pi@raspberrypi:/usr/local/bin $ gdb python
GNU gdb (Raspbian 7.7.1+dfsg-5+rpi1) 7.7.1
(gdb) run dvr-scan
Starting program: /usr/bin/python dvr-scan
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x76871de8 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0


pi@raspberrypi:/opt/opencv-3.1.0/build/bin $ gdb ./opencv_test_core
GNU gdb (Raspbian 7.7.1+dfsg-5+rpi1) 7.7.1
(gdb) run
Starting program: /opt/opencv-3.1.0/build/bin/opencv_test_core
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Cannot access memory at address 0x0

Program received signal SIGSEGV, Segmentation fault.
0x75d86340 in ?? () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0

I also run strace opencv_test_core and got this one too (last lines):

open("/proc/filesystems", O_RDONLY|O_LARGEFILE) = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f46000
read(4, "nodev\tsysfs\nnodev\trootfs\nnodev\tr"..., 1024) = 329
read(4, "", 1024)                       = 0
close(4)                                = 0
munmap(0x76f46000, 4096)                = 0
open("/proc/self/auxv", O_RDONLY)       = 4
read(4, "!\0\0\0\0\260\331~", 8)        = 8
read(4, "\20\0\0\0\326\260?\0", 8)      = 8
read(4, "\6\0\0\0\0\20\0\0", 8)         = 8
read(4, "\21\0\0\0d\0\0\0", 8)          = 8
read(4, "\3\0\0\0004\0\1\0", 8)         = 8
read(4, "\4\0\0\0 \0\0\0", 8)           = 8
read(4, "\5\0\0\0\10\0\0\0", 8)         = 8
read(4, "\7\0\0\0\0\300\365v", 8)       = 8
read(4, "\10\0\0\0\0\0\0\0", 8)         = 8
read(4, "\t\0\0\0\340\222\3\0", 8)      = 8
read(4, "\v\0\0\0\350\3\0\0", 8)        = 8
read(4, "\f\0\0\0\350\3\0\0", 8)        = 8
read(4, "\r\0\0\0\350\3\0\0", 8)        = 8
read(4, "\16\0\0\0\350\3\0\0", 8)       = 8
read(4, "\27\0\0\0\0\0\0\0", 8)         = 8
read(4, "\31\0\0\0\234\344\223~", 8)    = 8
read(4, "\32\0\0\0\20\0\0\0", 8)        = 8
read(4, "\37\0\0\0\351\357\223~", 8)    = 8
read(4, "\17\0\0\0\254\344\223~", 8)    = 8
read(4, "\0\0\0\0\0\0\0\0", 8)          = 8
read(4, "", 8)                          = 0
close(4)                                = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x7e9d7aa0} ---
+++ killed by SIGSEGV +++

I don't know if it may help but there it is. I'm sure that it opencv_test_core (demo app from OpenCV) ran successfully, the root problem would be solved.

I ask for help to patch the problem and/or know what is likely causing it. Am I missing some file(s) due to filesystem or storage corruption (I have seen a lot of entries in /lost+found directory)? Should I try to reinstall OpenCV from source? I don't understand why last month the problem disappeared after a system reboot with fsck.mode=force and this last time that didn't seem to work.

PD: If you ask me why don't I try to update to latest version of DVR-Scan it's just because I have been using version 1.0.1 during a long time and it's very tested and I'm sure it works well. The same applies to the operating system ("If something works, don't fix/touch/update it.").

[1] https://dvr-scan.readthedocs.io/

[2] https://breakthrough.github.io/Installing-OpenCV/

1 Answer 1


You will find no support here for obsolete OS.

This is not your problem. If you need to run fsck your SD Card is failing. One or other of the OS files is damaged. Sooner or later you will lose your system.

You should restore your last good backup to a NEW SD Card. If you don't have a backup (why?) you should copy to a new SD Card and hope there is no permanent damage.

  • Thanks a lot @Milliways , I really appreciate your analysis! If I have understood, do you mean that, even though there are no I/O errors related to the SD card, it's indeed close to be irreversibly damaged? I do have a relatively new backup.
    – Pestro
    Mar 1, 2022 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.