Testing Google测试框架和OpenCV的问题

Testing Google测试框架和OpenCV的问题,testing,segmentation-fault,googletest,Testing,Segmentation Fault,Googletest,我是谷歌测试框架的新手,正在尝试探索它。我尝试了一些简单的例子,一切都成功了 但是当我用gtest测试我的OpneCV程序时(到目前为止opencv没有使用任何功能,只添加了头文件),它给了我一个错误。例如 #include<iostream> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> //for gtest API #include "g

我是谷歌测试框架的新手,正在尝试探索它。我尝试了一些简单的例子,一切都成功了

但是当我用gtest测试我的OpneCV程序时(到目前为止opencv没有使用任何功能,只添加了头文件),它给了我一个错误。例如

#include<iostream>

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

    //for gtest API
    #include "gtest/gtest.h"   ///for google test framework

int main( int argc, char** argv )
    {

    testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();

}

TEST(Test, EqualityCheck) {

ASSERT_EQ(1,1)<<"Test Passed";
}
但如果使用opencv链接编译,我们在运行时会遇到seg错误

g++ -o out cv_gtest.cpp -I/usr/local/include -I./inc  /usr/local/lib/libgtest.a `pkg-config opencv --cflags --libs`
输出:

[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ImageTest
[ RUN      ] Test.EqualityCheck
[       OK ] Test.EqualityCheck (0 ms)
[----------] 1 test from Test (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (0 ms total)
[  PASSED  ] 1 test.
Segmentation fault (core dumped)
After debugging with valgrind (partial output)

    ==8284== Invalid read of size 4
==8284==    at 0x34C049D4B6: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /usr/lib64/libstdc++.so.6.0.13)
==8284==    by 0x4394DD: void std::_Destroy<std::string>(std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x4388A3: void std::_Destroy_aux<false>::__destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x436D92: void std::_Destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x433D98: void std::_Destroy<std::string*, std::string>(std::string*, std::string*, std::allocator<std::string>&) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x42E879: std::vector<std::string, std::allocator<std::string> >::~vector() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x34B943613C: __cxa_finalize (in /lib64/libc-2.12.so)
==8284==    by 0x7613545: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x767D1B0: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x34B9435DA1: exit (in /lib64/libc-2.12.so)
==8284==    by 0x34B941ECE3: (below main) (in /lib64/libc-2.12.so)
==8284==  Address 0x7d99e98 is 8 bytes before a block of size 11 free'd
==8284==    at 0x4A05B26: operator delete[](void*) (vg_replace_malloc.c:515)
==8284==    by 0x425A0E: testing::internal::String::~String() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x43A326: void std::_Destroy<testing::internal::String>(testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x439CCA: void std::_Destroy_aux<false>::__destroy<testing::internal::String*>(testing::internal::String*, testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x4392F1: void std::_Destroy<testing::internal::String*>(testing::internal::String*, testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x438470: void std::_Destroy<testing::internal::String*, testing::internal::String>(testing::internal::String*, testing::internal::String*, std::allocator<testing::internal::String>&) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x43AED3: std::vector<testing::internal::String, std::allocator<testing::internal::String> >::~vector() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x34B9435DA1: exit (in /lib64/libc-2.12.so)
==8284==    by 0x34B941ECE3: (below main) (in /lib64/libc-2.12.so)
==8284== 
==8284== Invalid free() / delete / delete[] / realloc()
==8284==    at 0x4A05FD6: operator delete(void*) (vg_replace_malloc.c:480)
==8284==    by 0x34C049D4C8: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /usr/lib64/libstdc++.so.6.0.13)
==8284==    by 0x4394DD: void std::_Destroy<std::string>(std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x4388A3: void std::_Destroy_aux<false>::__destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x436D92: void std::_Destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x433D98: void std::_Destroy<std::string*, std::string>(std::string*, std::string*, std::allocator<std::string>&) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x42E879: std::vector<std::string, std::allocator<std::string> >::~vector() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x34B943613C: __cxa_finalize (in /lib64/libc-2.12.so)
==8284==    by 0x7613545: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x767D1B0: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x34B9435DA1: exit (in /lib64/libc-2.12.so)
==8284==    by 0x34B941ECE3: (below main) (in /lib64/libc-2.12.so)
==8284==  Address 0x7d99e88 is 24 bytes before a block of size 11 free'd
==8284==    at 0x4A05B26: operator delete[](void*) (vg_replace_malloc.c:515)
==8284==    by 0x425A0E: testing::internal::String::~String() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x43A326: void std::_Destroy<testing::internal::String>(testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x439CCA: void std::_Destroy_aux<false>::__destroy<testing::internal::String*>(testing::internal::String*, testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x4392F1: void std::_Destroy<testing::internal::String*>(testing::internal::String*, testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x438470: void std::_Destroy<testing::internal::String*, testing::internal::String>(testing::internal::String*, testing::internal::String*, std::allocator<testing::internal::String>&) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x43AED3: std::vector<testing::internal::String, std::allocator<testing::internal::String> >::~vector() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x34B9435DA1: exit (in /lib64/libc-2.12.so)
==8284==    by 0x34B941ECE3: (below main) (in /lib64/libc-2.12.so)
==8284== 
==8284== 
==8284== Process terminating with default action of signal 11 (SIGSEGV)
==8284==  Access not within mapped region at address 0x2
==8284==    at 0x34C049D4B6: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /usr/lib64/libstdc++.so.6.0.13)
==8284==    by 0x4394DD: void std::_Destroy<std::string>(std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x4388A3: void std::_Destroy_aux<false>::__destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x436D92: void std::_Destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x433D98: void std::_Destroy<std::string*, std::string>(std::string*, std::string*, std::allocator<std::string>&) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x42E879: std::vector<std::string, std::allocator<std::string> >::~vector() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x34B943613C: __cxa_finalize (in /lib64/libc-2.12.so)
==8284==    by 0x7613545: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x767D1B0: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x34B9435DA1: exit (in /lib64/libc-2.12.so)
==8284==    by 0x34B941ECE3: (below main) (in /lib64/libc-2.12.so)
==8284==  If you believe this happened as a result of a stack
==8284==  overflow in your program's main thread (unlikely but
==8284==  possible), you can try to increase the size of the
==8284==  main thread stack using the --main-stacksize= flag.
==8284==  The main thread stack size used in this run was 10485760.
==8284== 
==8284== HEAP SUMMARY:
==8284==     in use at exit: 2,283,560 bytes in 183 blocks
==8284==   total heap usage: 742 allocs, 560 frees, 3,695,829 bytes allocated
==8284== 
==8284== LEAK SUMMARY:
==8284==    definitely lost: 750,084 bytes in 4 blocks
==8284==    indirectly lost: 0 bytes in 0 blocks
==8284==      possibly lost: 1,503,662 bytes in 73 blocks
==8284==    still reachable: 29,814 bytes in 106 blocks
==8284==         suppressed: 0 bytes in 0 blocks
==8284== Rerun with --leak-check=full to see details of leaked memory
==8284== 
==8284== For counts of detected and suppressed errors, rerun with: -v
[=============]从一个测试用例运行一个测试。
[-------------]全局测试环境设置。
[-------------]1个来自ImageTest的测试
[运行]Test.EqualityCheck
[确定]测试均衡检查(0毫秒)
[-------------]测试中的1个测试(总共0毫秒)
[-------------]全局测试环境拆除
[============]运行了1个测试用例中的1个测试。(总共0毫秒)
[通过]1次测试。
分段故障(堆芯转储)
使用valgrind进行调试后(部分输出)
==8284==大小为4的读取无效
==8284==at 0x34C049D4B6:std::basic_string::~basic_string()(在/usr/lib64/libstdc++.so.6.0.13中)
==8284==by 0x4394DD:void std::(std::string*)(in/home/sairam/Desktop/sagar/CV)GTEST/colormap)
==8284==0x4388A3:void std::_Destroy_aux:_Destroy(std::string*,std::string*)(在/home/sairam/Desktop/sagar/CV_GTEST/colormap中)
==8284==by 0x436D92:void std::(std::string*,std::string*)(in/home/sairam/Desktop/sagar/CV)GTEST/colormap)
==8284==by 0x433D98:void std::(std::string*,std::string*,std::allocator&)(在/home/sairam/Desktop/sagar/CV_GTEST/colormap中)
==8284==by 0x42E879:std::vector::~vector()(在/home/sairam/Desktop/sagar/CVêGTEST/colormap中)
==8284==by0x34b943613c:uu cxa_ufinalize(in/lib64/libc-2.12.so)
==8284==0x7613545:???(在/usr/local/lib/libopencv_ts.so.2.4.5中)
==8284==0x767D1B0:???(在/usr/local/lib/libopencv_ts.so.2.4.5中)
==8284==by0x34b9435da1:exit(在/lib64/libc-2.12.so中)
==8284==0x34B941ECE3:(在main下面)(in/lib64/libc-2.12.so)
==8284==地址0x7d99e98在大小为11的块空闲之前为8字节
==8284==at 0x4A05B26:运算符删除[](void*)(vg_replace_malloc.c:515)
==8284==by 0x425A0E:testing::internal::String::~String()(在/home/sairam/Desktop/sagar/CVêu GTEST/colormap中)
==8284==by 0x43A326:void std:(测试::内部::字符串*)(in/home/sairam/Desktop/sagar/CV)GTEST/colormap)
==8284==0x439CCA:void std::_Destroy_aux:u Destroy(测试::内部::字符串*,测试::内部::字符串*)(在/home/sairam/Desktop/sagar/CV_GTEST/colormap中)
==8284==by 0x4392F1:void std::(测试::内部::字符串*,测试::内部::字符串*)(在/home/sairam/Desktop/sagar/CV\u GTEST/colormap中)
==8284==by 0x438470:void std::(测试::internal::String*,测试::internal::String*,std::allocator&)(in/home/sairam/Desktop/sagar/CV)GTEST/colormap)
==8284==0x43AED3:std::vector::~vector()(在/home/sairam/Desktop/sagar/CVêGTEST/colormap中)
==8284==by0x34b9435da1:exit(在/lib64/libc-2.12.so中)
==8284==0x34B941ECE3:(在main下面)(in/lib64/libc-2.12.so)
==8284== 
==8284==无效的free()/delete/delete[]/realloc()
==8284==at 0x4A05FD6:运算符删除(void*)(vg_replace_malloc.c:480)
==8284==by 0x34C049D4C8:std::basic_string::~basic_string()(in/usr/lib64/libstdc++.so.6.0.13)
==8284==by 0x4394DD:void std::(std::string*)(in/home/sairam/Desktop/sagar/CV)GTEST/colormap)
==8284==0x4388A3:void std::_Destroy_aux:_Destroy(std::string*,std::string*)(在/home/sairam/Desktop/sagar/CV_GTEST/colormap中)
==8284==by 0x436D92:void std::(std::string*,std::string*)(in/home/sairam/Desktop/sagar/CV)GTEST/colormap)
==8284==by 0x433D98:void std::(std::string*,std::string*,std::allocator&)(在/home/sairam/Desktop/sagar/CV_GTEST/colormap中)
==8284==by 0x42E879:std::vector::~vector()(在/home/sairam/Desktop/sagar/CVêGTEST/colormap中)
==8284==by0x34b943613c:uu cxa_ufinalize(in/lib64/libc-2.12.so)
==8284==0x7613545:???(在/usr/local/lib/libopencv_ts.so.2.4.5中)
==8284==0x767D1B0:???(在/usr/local/lib/libopencv_ts.so.2.4.5中)
==8284==by0x34b9435da1:exit(在/lib64/libc-2.12.so中)
==8284==0x34B941ECE3:(在main下面)(in/lib64/libc-2.12.so)
==8284==地址0x7d99e88在大小为11的块空闲之前为24字节
==8284==at 0x4A05B26:运算符删除[](void*)(vg_replace_malloc.c:515)
==8284==by 0x425A0E:testing::internal::String::~String()(在/home/sairam/Desktop/sagar/CVêu GTEST/colormap中)
==8284==by 0x43A326:void std:(测试::内部::字符串*)(in/home/sairam/Desktop/sagar/CV)GTEST/colormap)
==8284==0x439CCA:void std::_Destroy_aux:u Destroy(测试::内部::字符串*,测试::内部::字符串*)(在/home/sairam/Desktop/sagar/CV_GTEST/colormap中)
==8284==by 0x4392F1:void std::(测试::内部::字符串*,测试::内部::字符串*)(在/home/sairam/Desktop/sagar/CV\u GTEST/colormap中)
==8284==by 0x438470:void std::(测试::internal::String*,测试::internal::String*,std::allocator&)(in/home/sairam/Desktop/sagar/CV)GTEST/colormap)
==8284==0x43AED3:std::vector::~vector()(在/home/sairam/Desktop/sagar/CVêGTEST/colormap中)
==8284==by0x34b9435da1:exit(在/lib64/libc-2.12.so中)
==8284==0x34B941ECE3:(在main下面)(in/lib64/libc-2.12.so)
==8284== 
==8284== 
==8284==进程以信号11(SIGSEGV)的默认动作终止
==8284==访问不在地址0x2的映射区域内
==8284==at 0x34C049D4B6:std::basic_string::~basic_string()(在/usr/lib64/libstdc++.so.6.0.13中)
==8284==by 0x4394DD:void std::(std::string*)(in/home/sairam/Desktop/sagar/CV)GTEST/colormap)
==8284==0x4388A3:void std::_Destroy_aux:_Destroy(std::string*,std::string*)(在/home/sairam/Desktop/sagar/CV_GTEST/colormap中)
==8284==by 0x436D92:void std::(std::string*,std::string*)(in/home/sairam/Desktop/sagar/CV)GTEST/colormap)
==8284==by 0x433D98:void std::\u Destroy(std::string*,std::string*,std::a
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ImageTest
[ RUN      ] Test.EqualityCheck
[       OK ] Test.EqualityCheck (0 ms)
[----------] 1 test from Test (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (0 ms total)
[  PASSED  ] 1 test.
Segmentation fault (core dumped)
After debugging with valgrind (partial output)

    ==8284== Invalid read of size 4
==8284==    at 0x34C049D4B6: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /usr/lib64/libstdc++.so.6.0.13)
==8284==    by 0x4394DD: void std::_Destroy<std::string>(std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x4388A3: void std::_Destroy_aux<false>::__destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x436D92: void std::_Destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x433D98: void std::_Destroy<std::string*, std::string>(std::string*, std::string*, std::allocator<std::string>&) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x42E879: std::vector<std::string, std::allocator<std::string> >::~vector() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x34B943613C: __cxa_finalize (in /lib64/libc-2.12.so)
==8284==    by 0x7613545: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x767D1B0: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x34B9435DA1: exit (in /lib64/libc-2.12.so)
==8284==    by 0x34B941ECE3: (below main) (in /lib64/libc-2.12.so)
==8284==  Address 0x7d99e98 is 8 bytes before a block of size 11 free'd
==8284==    at 0x4A05B26: operator delete[](void*) (vg_replace_malloc.c:515)
==8284==    by 0x425A0E: testing::internal::String::~String() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x43A326: void std::_Destroy<testing::internal::String>(testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x439CCA: void std::_Destroy_aux<false>::__destroy<testing::internal::String*>(testing::internal::String*, testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x4392F1: void std::_Destroy<testing::internal::String*>(testing::internal::String*, testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x438470: void std::_Destroy<testing::internal::String*, testing::internal::String>(testing::internal::String*, testing::internal::String*, std::allocator<testing::internal::String>&) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x43AED3: std::vector<testing::internal::String, std::allocator<testing::internal::String> >::~vector() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x34B9435DA1: exit (in /lib64/libc-2.12.so)
==8284==    by 0x34B941ECE3: (below main) (in /lib64/libc-2.12.so)
==8284== 
==8284== Invalid free() / delete / delete[] / realloc()
==8284==    at 0x4A05FD6: operator delete(void*) (vg_replace_malloc.c:480)
==8284==    by 0x34C049D4C8: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /usr/lib64/libstdc++.so.6.0.13)
==8284==    by 0x4394DD: void std::_Destroy<std::string>(std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x4388A3: void std::_Destroy_aux<false>::__destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x436D92: void std::_Destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x433D98: void std::_Destroy<std::string*, std::string>(std::string*, std::string*, std::allocator<std::string>&) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x42E879: std::vector<std::string, std::allocator<std::string> >::~vector() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x34B943613C: __cxa_finalize (in /lib64/libc-2.12.so)
==8284==    by 0x7613545: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x767D1B0: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x34B9435DA1: exit (in /lib64/libc-2.12.so)
==8284==    by 0x34B941ECE3: (below main) (in /lib64/libc-2.12.so)
==8284==  Address 0x7d99e88 is 24 bytes before a block of size 11 free'd
==8284==    at 0x4A05B26: operator delete[](void*) (vg_replace_malloc.c:515)
==8284==    by 0x425A0E: testing::internal::String::~String() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x43A326: void std::_Destroy<testing::internal::String>(testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x439CCA: void std::_Destroy_aux<false>::__destroy<testing::internal::String*>(testing::internal::String*, testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x4392F1: void std::_Destroy<testing::internal::String*>(testing::internal::String*, testing::internal::String*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x438470: void std::_Destroy<testing::internal::String*, testing::internal::String>(testing::internal::String*, testing::internal::String*, std::allocator<testing::internal::String>&) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x43AED3: std::vector<testing::internal::String, std::allocator<testing::internal::String> >::~vector() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x34B9435DA1: exit (in /lib64/libc-2.12.so)
==8284==    by 0x34B941ECE3: (below main) (in /lib64/libc-2.12.so)
==8284== 
==8284== 
==8284== Process terminating with default action of signal 11 (SIGSEGV)
==8284==  Access not within mapped region at address 0x2
==8284==    at 0x34C049D4B6: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (in /usr/lib64/libstdc++.so.6.0.13)
==8284==    by 0x4394DD: void std::_Destroy<std::string>(std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x4388A3: void std::_Destroy_aux<false>::__destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x436D92: void std::_Destroy<std::string*>(std::string*, std::string*) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x433D98: void std::_Destroy<std::string*, std::string>(std::string*, std::string*, std::allocator<std::string>&) (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x42E879: std::vector<std::string, std::allocator<std::string> >::~vector() (in /home/sairam/Desktop/sagar/CV_GTEST/colormap)
==8284==    by 0x34B943613C: __cxa_finalize (in /lib64/libc-2.12.so)
==8284==    by 0x7613545: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x767D1B0: ??? (in /usr/local/lib/libopencv_ts.so.2.4.5)
==8284==    by 0x34B9435DA1: exit (in /lib64/libc-2.12.so)
==8284==    by 0x34B941ECE3: (below main) (in /lib64/libc-2.12.so)
==8284==  If you believe this happened as a result of a stack
==8284==  overflow in your program's main thread (unlikely but
==8284==  possible), you can try to increase the size of the
==8284==  main thread stack using the --main-stacksize= flag.
==8284==  The main thread stack size used in this run was 10485760.
==8284== 
==8284== HEAP SUMMARY:
==8284==     in use at exit: 2,283,560 bytes in 183 blocks
==8284==   total heap usage: 742 allocs, 560 frees, 3,695,829 bytes allocated
==8284== 
==8284== LEAK SUMMARY:
==8284==    definitely lost: 750,084 bytes in 4 blocks
==8284==    indirectly lost: 0 bytes in 0 blocks
==8284==      possibly lost: 1,503,662 bytes in 73 blocks
==8284==    still reachable: 29,814 bytes in 106 blocks
==8284==         suppressed: 0 bytes in 0 blocks
==8284== Rerun with --leak-check=full to see details of leaked memory
==8284== 
==8284== For counts of detected and suppressed errors, rerun with: -v