Solution for SIGABRT/SIGSEGV segfault
Created by: heavengate
opencv ENABLE_MEMALIGN
will incur SIGABRT/SIGSEGV segment faults, see https://github.com/opencv/opencv/issues/15691
Segment faults as follows:
SIGSEGV
W0216 11:31:23.561960 79000 init.cc:217] *** Aborted at 1581852683 (unix time) try "date -d @1581852683" if you are using GNU date ***
W0216 11:31:23.563690 79000 init.cc:217] PC: @ 0x0 (unknown)
W0216 11:31:23.563923 79000 init.cc:217] *** SIGSEGV (@0x639cc) received by PID 78894 (TID 0x7fac8bfff700) from PID 408012; stack trace: ***
W0216 11:31:23.565338 79000 init.cc:217] @ 0x7fadcec1e390 (unknown)
W0216 11:31:23.566645 79000 init.cc:217] @ 0x7fadce8c7512 cfree
W0216 11:31:23.567446 79000 init.cc:217] @ 0x7fada076bfd9 (unknown)
W0216 11:31:23.568234 79000 init.cc:217] @ 0x7fada055c318 (unknown)
W0216 11:31:23.569947 79000 init.cc:217] @ 0x7fadcf1b5c34 _PyMethodDef_RawFastCallKeywords
W0216 11:31:23.571638 79000 init.cc:217] @ 0x7fadcf1b5d51 _PyCFunction_FastCallKeywords
W0216 11:31:23.573309 79000 init.cc:217] @ 0x7fadcf2220ac _PyEval_EvalFrameDefault
W0216 11:31:23.574960 79000 init.cc:217] @ 0x7fadcf1651b9 _PyEval_EvalCodeWithName
W0216 11:31:23.576583 79000 init.cc:217] @ 0x7fadcf1662a5 _PyFunction_FastCallDict
W0216 11:31:23.578205 79000 init.cc:217] @ 0x7fadcf184e33 _PyObject_Call_Prepend
W0216 11:31:23.579671 79000 init.cc:217] @ 0x7fadcf1bc2da slot_tp_call
W0216 11:31:23.581300 79000 init.cc:217] @ 0x7fadcf1bd19b _PyObject_FastCallKeywords
W0216 11:31:23.582952 79000 init.cc:217] @ 0x7fadcf221c76 _PyEval_EvalFrameDefault
W0216 11:31:23.584571 79000 init.cc:217] @ 0x7fadcf1661db _PyFunction_FastCallDict
W0216 11:31:23.586191 79000 init.cc:217] @ 0x7fadcf184e33 _PyObject_Call_Prepend
W0216 11:31:23.587656 79000 init.cc:217] @ 0x7fadcf1bc2da slot_tp_call
W0216 11:31:23.589293 79000 init.cc:217] @ 0x7fadcf1bd19b _PyObject_FastCallKeywords
W0216 11:31:23.590940 79000 init.cc:217] @ 0x7fadcf2224d6 _PyEval_EvalFrameDefault
W0216 11:31:23.592558 79000 init.cc:217] @ 0x7fadcf1651b9 _PyEval_EvalCodeWithName
W0216 11:31:23.594178 79000 init.cc:217] @ 0x7fadcf1662a5 _PyFunction_FastCallDict
W0216 11:31:23.595798 79000 init.cc:217] @ 0x7fadcf184e33 _PyObject_Call_Prepend
W0216 11:31:23.597450 79000 init.cc:217] @ 0x7fadcf177a3e PyObject_Call
W0216 11:31:23.598969 79000 init.cc:217] @ 0x7fadcf275a37 partial_call
W0216 11:31:23.600613 79000 init.cc:217] @ 0x7fadcf1bd19b _PyObject_FastCallKeywords
W0216 11:31:23.602301 79000 init.cc:217] @ 0x7fadcf221c76 _PyEval_EvalFrameDefault
W0216 11:31:23.603929 79000 init.cc:217] @ 0x7fadcf1661db _PyFunction_FastCallDict
W0216 11:31:23.605542 79000 init.cc:217] @ 0x7fadcf184e33 _PyObject_Call_Prepend
W0216 11:31:23.607192 79000 init.cc:217] @ 0x7fadcf177a3e PyObject_Call
W0216 11:31:23.608846 79000 init.cc:217] @ 0x7fadcf21f12a _PyEval_EvalFrameDefault
W0216 11:31:23.610447 79000 init.cc:217] @ 0x7fadcf1b51ab _PyFunction_FastCallKeywords
W0216 11:31:23.612099 79000 init.cc:217] @ 0x7fadcf21d893 _PyEval_EvalFrameDefault
W0216 11:31:23.613699 79000 init.cc:217] @ 0x7fadcf1b51ab _PyFunction_FastCallKeywords
SIGABRT
W0216 12:06:28.736833 84444 init.cc:217] *** Aborted at 1581854788 (unix time) try "date -d @1581854788" if you are using GNU date ***
W0216 12:06:28.738698 84444 init.cc:217] PC: @ 0x0 (unknown)
W0216 12:06:28.738801 84444 init.cc:217] *** SIGABRT (@0x14976) received by PID 84342 (TID 0x7f41b9fff700) from PID 84342; stack trace: ***
W0216 12:06:28.740295 84444 init.cc:217] @ 0x7f4236b5b390 (unknown)
W0216 12:06:28.741713 84444 init.cc:217] @ 0x7f42367b5428 gsignal
W0216 12:06:28.743111 84444 init.cc:217] @ 0x7f42367b702a abort
W0216 12:06:28.744024 84444 init.cc:217] @ 0x7f41b611e84a __gnu_cxx::__verbose_terminate_handler()
W0216 12:06:28.744721 84444 init.cc:217] @ 0x7f41b611cf47 __cxxabiv1::__terminate()
W0216 12:06:28.745549 84444 init.cc:217] @ 0x7f41b611cf7d std::terminate()
W0216 12:06:28.746292 84444 init.cc:217] @ 0x7f41b611cc5a __gxx_personality_v0
W0216 12:06:28.746991 84444 init.cc:217] @ 0x7f41e722ab97 _Unwind_ForcedUnwind_Phase2
W0216 12:06:28.747681 84444 init.cc:217] @ 0x7f41e722ae7d _Unwind_ForcedUnwind
W0216 12:06:28.749128 84444 init.cc:217] @ 0x7f4236b5a070 __GI___pthread_unwind
W0216 12:06:28.750536 84444 init.cc:217] @ 0x7f4236b52845 __pthread_exit
W0216 12:06:28.752323 84444 init.cc:217] @ 0x7f4237171c69 PyThread_exit_thread
W0216 12:06:28.753892 84444 init.cc:217] @ 0x7f4236ff7be6 PyEval_RestoreThread.cold.796
W0216 12:06:28.754845 84444 init.cc:217] @ 0x7f421aa6da3d (unknown)
W0216 12:06:28.756631 84444 init.cc:217] @ 0x7f42370f2cd6 _PyMethodDef_RawFastCallKeywords
W0216 12:06:28.758435 84444 init.cc:217] @ 0x7f42370f2d51 _PyCFunction_FastCallKeywords
W0216 12:06:28.760226 84444 init.cc:217] @ 0x7f423715f5a5 _PyEval_EvalFrameDefault
W0216 12:06:28.761986 84444 init.cc:217] @ 0x7f42370a21b9 _PyEval_EvalCodeWithName
W0216 12:06:28.763727 84444 init.cc:217] @ 0x7f42370a32a5 _PyFunction_FastCallDict
W0216 12:06:28.765480 84444 init.cc:217] @ 0x7f42370c1e33 _PyObject_Call_Prepend
W0216 12:06:28.767102 84444 init.cc:217] @ 0x7f42370f92da slot_tp_call
W0216 12:06:28.768848 84444 init.cc:217] @ 0x7f42370fa19b _PyObject_FastCallKeywords
W0216 12:06:28.770627 84444 init.cc:217] @ 0x7f423715ec76 _PyEval_EvalFrameDefault
W0216 12:06:28.772387 84444 init.cc:217] @ 0x7f42370a31db _PyFunction_FastCallDict
W0216 12:06:28.774173 84444 init.cc:217] @ 0x7f42370c1e33 _PyObject_Call_Prepend
W0216 12:06:28.775872 84444 init.cc:217] @ 0x7f42370f92da slot_tp_call
W0216 12:06:28.777649 84444 init.cc:217] @ 0x7f42370fa19b _PyObject_FastCallKeywords
W0216 12:06:28.779443 84444 init.cc:217] @ 0x7f423715f4d6 _PyEval_EvalFrameDefault
W0216 12:06:28.781198 84444 init.cc:217] @ 0x7f42370a21b9 _PyEval_EvalCodeWithName
W0216 12:06:28.782948 84444 init.cc:217] @ 0x7f42370a32a5 _PyFunction_FastCallDict
W0216 12:06:28.784683 84444 init.cc:217] @ 0x7f42370c1e33 _PyObject_Call_Prepend
W0216 12:06:28.786458 84444 init.cc:217] @ 0x7f42370b4a3e PyObject_Call
Solution:
- install opencv <= 4.0.0.21
pip uninstall opencv-python
pip install opencv-python==4.0.0.21
- install opencv by compiling opencv from source code and set
OPENCV_ENABLE_MEMALIGN=OFF