Hi,
I am getting the following error in my code.
malloc: *** error for object 0x3b0fe80: double free
*** set a breakpoint in malloc_error_break to debug
When i debug it and do a backtrace i get the following
#0 0x90c994a9 in malloc_error_break ()
#1 0x90c94497 in szone_error ()
#2 0x90bbe463 in szone_free ()
#3 0x90bbe2cd in free ()
#4 0x0000a89d in __gnu_cxx::new_allocator<int>::deallocate (this=0x700048, __p=0x3b0fe80) at ext/new_allocator.h:94
#5 0x0000a8c7 in std::_Vector_base<int, std::allocator<int> >::_M_deallocate (this=0x700048, __p=0x3b0fe80, __n=2) at stl_vector.h:123
#6 0x0000a900 in std::_Vector_base<int, std::allocator<int> >::~_Vector_base (this=0x700048) at stl_vector.h:109
#7 0x0000a95d in std::vector<int, std::allocator<int> >::~vector (this=0x700048) at stl_vector.h:273
#8 0x0000a971 in std::vector<int, std::allocator<int> >::~vector (this=0x700048) at stl_vector.h:273
#9 0x0000a985 in __gnu_cxx::new_allocator<std::vector<int, std::allocator<int> > >::destroy (this=0xbfffe8cf, __p=0x700048) at ext/new_allocator.h:107
#10 0x0000b1ce in std::_Destroy<__gnu_cxx::__normal_iterator<std::vector<int, std::allocator<int> >*, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > >, std::allocator<std::vector<int, std::allocator<int> > > > (__first={_M_current = 0x700048}, __last={_M_current = 0x700060}, __alloc=@0xbfffe8cf) at stl_construct.h:174
#11 0x0000cb1d in std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >::erase (this=0x8000fc, __first={_M_current = 0x700000}, __last={_M_current = 0x700060}) at vector.tcc:125
#12 0x0000cb90 in std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >::clear (this=0x8000fc) at stl_vector.h:749
#13 0x00006f1f in circuit::more_illegal (this=0x800000, maxno2=22223, fname=0xbffff710 "../SEQUENTIAL_MITER/s15850.cnf", CONST_INITIAL_STATES=1) at main_program_version_1.cpp:1087
I am not sure is it a memory leak because in my code i am clearing the vectors using clear() function everytime. I wish to know the probable causes for the error and where to look in the code.
Any help is appreciated