Pure Virtual Function being called (Bug #3493)
Description
When my program is exiting, I get this backtrace under GDB:
#0 0x00007ffff0772c59 in raise () from /lib64/libc.so.6
#1 0x00007ffff0774368 in abort () from /lib64/libc.so.6
#2 0x00007ffff1079f85 in _gnu_cxx::_verbose_terminate_handler() () from /lib64/libstdc++.so.6
#3 0x00007ffff1077ee6 in ?? () from /lib64/libstdc++.so.6
#4 0x00007ffff1077f13 in std::terminate() () from /lib64/libstdc++.so.6
#5 0x00007ffff1078a7f in __cxa_pure_virtual () from /lib64/libstdc++.so.6
#6 0x00007ffff3b415dc in cv::Mat::deallocate() () from /usr/local/src/lib/libopencv_core.so.3.0
#7 0x0000000000420d55 in cv::Mat::release (this=0x63f8a0 <g_matThresh>) at /usr/local/src/include/opencv2/core/mat.inl.hpp:625
#8 0x0000000000420a5e in cv::Mat::~Mat (this=0x63f8a0 <g_matThresh>, __in_chrg=<optimized out>) at /usr/local/src/include/opencv2/core/mat.inl.hpp:512
#9 0x00007ffff07764e9 in __run_exit_handlers () from /lib64/libc.so.6
#10 0x00007ffff0776535 in exit () from /lib64/libc.so.6
#11 0x00007ffff075ed6c in __libc_start_main () from /lib64/libc.so.6
#12 0x000000000041d839 in _start ()
In the past I used to get this problem with the resize function when I compiled OpenCV using TBB, which doesn't seem to be happening anymore. Let me know if you need any other information.
The problem is caused by having global cv::Mat variables. I needed to call release on all the global cv::Mat's to not have this error.
-Sam
Associated revisions
Merge pull request #3493 from vbystricky:createsamples
History
Updated by Philippe FOUBERT about 11 years ago
See the bug #3355 I have reported 3 months ago. I am agree: it was not the case in the past (before november 2013 to be more precise).
Before the correction of this problem, you have at least 2 possibilities:- Removing static declarations of matrix: in my case, it has been a way to avoid this behavior.
- An other possible workaround is to add a
extern "C" void __cxa_pure_virtual(void)
callback in your application to silently catch this GCC interruption (this function will be called instead of the GCC crash function).
I hope it may help you.
Regards,
Philippe.
Updated by Andrew Senin about 11 years ago
Hi Sanuel,
Thanks for sending this issue. Could you please send reproducing code and describe your working environment (OS, g compiler version).
Thanks
- Assignee set to Samuel Petrocelli
Updated by Andrew Senin about 11 years ago
- Status changed from New to Open
Updated by Vladislav Vinogradov about 11 years ago
- Category set to core
Updated by Ilya Lavrenov about 11 years ago
Hi Philippe, Samuel,
Unfortunately we can not reproduce the problem on our build system, but we've created the PR that hopefully fix the problem (see https://github.com/Itseez/opencv/pull/2280). Could you cherry-pick commit d957e8e and check whether it works or not?
Updated by Samuel Petrocelli over 10 years ago
I am no longer experiencing this error with the recent pull.
-Sam
- Status changed from Open to Done