i'm working with Opencv, trying to copy some frame that captured from web camera. when copying the frame, i'm getting segmentation fault in __memcpy_ssse3()
, line 160 or 1675.
gdb shows:
0 __memmove_ssse3 () at ../sysdeps/i386/i686/multiarch/memcpy-ssse3.S:1675
1 0xb75ec6d0 in cv::Mat::copyTo (this=0xbfca3450, _dst=...) at /home/david/opencv/OpenCV-2.4.2/modules/core/src/copy.cpp:181
2 0xb75984f6 in cv::Mat::Mat (this=0xbfca358c, img=0xb1300c90, copyData=true) at /home/david/opencv/OpenCV-2.4.2/modules/core/src/matrix.cpp:510
The function that calls it is cv::MAt::Mat(IplImg *I, bool copy)
.
When I'm opening USB camera or file, everything is perfect, but when trying to read the video stream from webcam, via IP, it crashes after a minute.
I'v try to build ffmpeg and opencv without ssse3 support, and my application compiled with -mno-seee3
flag too.
Opencv vesion is 2.4.2, but the problem exists in 2.3.1 too. ffmpeg version is 11.1, same problem in 8.X. gcc version is 4.6.3, Ubuntu's branch. The processor is Intel core2.
Any hints?
Thank you all, solved. There was a mistake in locking between threads, and somehow the memory was override or freed in other thread. After fixing the lock dependencies the problem of segfault solved.