memory leaks - Crash in Destructor in C++11, after shared pointer goes out of scope -


i facing crash in destructor. below code snippet of object creation of carrier , destructor of object once erase map

here code snippet

/* object creation */

shared_ptr<icarrier> factory::makecarrier(int carrierid, int beamid) {     return make_shared < carrier > (carrierid, beamid); } 

/* dest */

shared_ptr<icarrier> pcarrier = nullptr;  (auto carrieriterator = mcarrieridtocarriermap.cbegin();     carrieriterator != mcarrieridtocarriermap.cend();) {     carrieriterator = mcarrieridtocarriermap.erase(carrieriterator); }  virtual ~icarrier() { }  carrier::carrier(int carrierid, int beamid) {     // create new logger level appending beam id.     string newloggerlevel = "rgw.beam." + to_string(beamid) + ".carrier."+ to_string(carrierid);     // retrieve logger newly created logger level     mlogger = log4cxx::logger::getlogger(newloggerlevel);     log4cxx_info(mlogger, " carrier created id :" << carrierid);     mpmcip = 0; }  carrier::~carrier() { } 

gdb o/p

breakpoint 2, carrier::~carrier (this=0xccc478, __in_chrg=<value optimized out>) @ carrier.cpp:24      24      carrier::~carrier()      (gdb) bt      #0  carrier::~carrier (this=0xccc478, __in_chrg=<value optimized out>) @ carrier.cpp:24      #1  0x00000000004469de in carrier::~carrier (this=0xccc478, __in_chrg=<value optimized out>) @ carrier.cpp:27      #2  0x0000000000422f5d in __gnu_cxx::new_allocator<carrier>::destroy<carrier> (this=0xccc470, __p=0xccc478) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/ext/new_allocator.h:124      #3  0x0000000000422e21 in std::allocator_traits<std::allocator<carrier> >::_s_destroy<carrier> (__a=..., __p=0xccc478) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/alloc_traits.h:281      #4  0x0000000000422cf9 in std::allocator_traits<std::allocator<carrier> >::destroy<carrier> (__a=..., __p=0xccc478) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/alloc_traits.h:405      #5  0x0000000000422a81 in std::_sp_counted_ptr_inplace<carrier, std::allocator<carrier>, (__gnu_cxx::_lock_policy)2>::_m_dispose (this=0xccc460) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/shared_ptr_base.h:407      #6  0x000000000040aee0 in std::_sp_counted_base<(__gnu_cxx::_lock_policy)2>::_m_release (this=0xccc460) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/shared_ptr_base.h:144      #7  0x000000000040acd0 in std::__shared_count<(__gnu_cxx::_lock_policy)2>::operator= (this=0x7ffffffe25f8, __r=...) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/shared_ptr_base.h:565      #8  0x0000000000419f27 in std::__shared_ptr<icarrier, (__gnu_cxx::_lock_policy)2>::operator= (this=0x7ffffffe25f0) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/shared_ptr_base.h:728      #9  0x0000000000419f51 in std::shared_ptr<icarrier>::operator= (this=0x7ffffffe25f0) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/shared_ptr.h:93      #10 0x00000000004154c6 in beam::deleteallcarriers (this=0xccca58) @ beam.cpp:383      #11 0x00000000004151eb in beam::ondeleting (this=0xccca58, tllibvcivector=...) @ beam.cpp:352      #12 0x0000000000428134 in pbsc::deletebeamswithtraversedflagset (this=0xcc8080) @ pbsc.cpp:587      #13 0x0000000000428ceb in pbsc::oncarriermapping (this=0xcc8080, pcarriermapping=...) @ pbsc.cpp:682      #14 0x0000000000409615 in pbsc::rms::handlermscarriermappingmsg (this=0xccb970, recvdcarriermapping=...) @ rms.cpp:133      #15 0x0000000000408f10 in pbsc::rms::handlemessage (this=0xccb970, portnumber=21015, precvmsg=0x7ffffffea470 "\n\002\b\003\f\003\204", sizeofmessageread=4) @ rms.cpp:55      #16 0x0000000000481630 in inframe::modulemanager::processrxmessage (this=0xcc9280, msgbuf=0x7ffffffea470 "\n\002\b\003\f\003\204", numofbytes=@0x7fffffff9ea8, portnumber=@0x7ffffffe69c4, remoteaddr=...) @ modulemanager.cpp:1054      #17 0x000000000047fdb0 in inframe::modulemanager::recvandforwardmessage (this=0xcc9280, portnumber=21015) @ modulemanager.cpp:612      #18 0x0000000000451f9f in pbsc::pbscapp::actoninterrupt (this=0x7fffffffdb90, tick=83118159) @ pbscapp.cpp:101      #19 0x00000000004798a1 in inframe::apptask::readinterrupt (this=0x7fffffffdb90) @ apptask.cpp:263      #20 0x0000000000455d60 in pbsc::pbscappmain (argc=7, argv=0x7fffffffe1c8) @ pbscapp.cpp:699      #21 0x00000000004550b4 in main (argc=7, argv=0x7fffffffe1c8) @ pbscapp.cpp:550      (gdb) n 

crash:

* glibc detected * /home/nverma/test/pbsc_1/bin/pbsc_1: free(): invalid pointer: 0x0000000000ccc478 ***

 backtrace:  /lib64/libc.so.6[0x3cb1c76166]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x4469ea]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x422f5d]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x422e21]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x422cf9]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x422a81]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x40aee0]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x40acd0]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x419f27]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x419f51]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x4154c6]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x4151eb]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x428134]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x428ceb]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x409615]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x408f10]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x481630]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x47fdb0]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x451f9f]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x4798a1]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x455d60]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x4550b4]  /lib64/libc.so.6(__libc_start_main+0xfd)[0x3cb1c1ed1d]  /home/nverma/test/pbsc_1/bin/pbsc_1[0x408489]  ======= memory map: ========  00400000-005f8000 r-xp 00000000 fd:02 540387                             /home/nverma/test/pbsc_1/bin/pbsc_1  007f8000-007f9000 rw-p 001f8000 fd:02 540387                             /home/nverma/test/pbsc_1/bin/pbsc_1  007f9000-00cd7000 rw-p 00000000 00:00 0                                  [heap]  33a0800000-33a081d000 r-xp 00000000 fd:00 1310819                        /lib64/libselinux.so.1  33a081d000-33a0a1c000 ---p 0001d000 fd:00 1310819                        /lib64/libselinux.so.1  33a0a1c000-33a0a1d000 r--p 0001c000 fd:00 1310819                        /lib64/libselinux.so.1  33a0a1d000-33a0a1e000 rw-p 0001d000 fd:00 1310819                        /lib64/libselinux.so.1  33a0a1e000-33a0a1f000 rw-p 00000000 00:00 0  33a5c00000-33a5c04000 r-xp 00000000 fd:00 1327246                        /lib64/libuuid.so.1.3.0  33a5c04000-33a5e03000 ---p 00004000 fd:00 1327246                        /lib64/libuuid.so.1.3.0  33a5e03000-33a5e04000 rw-p 00003000 fd:00 1327246                        /lib64/libuuid.so.1.3.0  33a6000000-33a6027000 r-xp 00000000 fd:00 2756506                        /usr/lib64/libssh2.so.1.0.1  33a6027000-33a6226000 ---p 00027000 fd:00 2756506                        /usr/lib64/libssh2.so.1.0.1  33a6226000-33a6227000 rw-p 00026000 fd:00 2756506                        /usr/lib64/libssh2.so.1.0.1  33a6227000-33a6228000 rw-p 00000000 00:00 0  33a6400000-33a6403000 r-xp 00000000 fd:00 1327243                        /lib64/libcom_err.so.2.1  33a6403000-33a6602000 ---p 00003000 fd:00 1327243                        /lib64/libcom_err.so.2.1  33a6602000-33a6603000 r--p 00002000 fd:00 1327243                        /lib64/libcom_err.so.2.1  33a6603000-33a6604000 rw-p 00003000 fd:00 1327243                        /lib64/libcom_err.so.2.1  33a6800000-33a680a000 r-xp 00000000 fd:00 1310815                        /lib64/libkrb5support.so.0.1  33a680a000-33a6a09000 ---p 0000a000 fd:00 1310815                        /lib64/libkrb5support.so.0.1  33a6a09000-33a6a0a000 r--p 00009000 fd:00 1310815                        /lib64/libkrb5support.so.0.1  33a6a0a000-33a6a0b000 rw-p 0000a000 fd:00 1310815                        /lib64/libkrb5support.so.0.1  33a6c00000-33a6c29000 r-xp 00000000 fd:00 1327242                        /lib64/libk5crypto.so.3.1  33a6c29000-33a6e29000 ---p 00029000 fd:00 1327242                        /lib64/libk5crypto.so.3.1  33a6e29000-33a6e2a000 r--p 00029000 fd:00 1327242                        /lib64/libk5crypto.so.3.1  33a6e2a000-33a6e2b000 rw-p 0002a000 fd:00 1327242                        /lib64/libk5crypto.so.3.1  33a6e2b000-33a6e2c000 rw-p 00000000 00:00 0  33a7000000-33a70db000 r-xp 00000000 fd:00 1327244                        /lib64/libkrb5.so.3.3  33a70db000-33a72da000 ---p 000db000 fd:00 1327244                        /lib64/libkrb5.so.3.3  33a72da000-33a72e4000 r--p 000da000 fd:00 1327244                        /lib64/libkrb5.so.3.3  33a72e4000-33a72e6000 rw-p 000e4000 fd:00 1327244                        /lib64/libkrb5.so.3.3  33a7400000-33a7441000 r-xp 00000000 fd:00 1327245                        /lib64/libgssapi_krb5.so.2.2  33a7441000-33a7641000 ---p 00041000 fd:00 1327245                        /lib64/libgssapi_krb5.so.2.2  33a7641000-33a7642000 r--p 00041000 fd:00 1327245                        /lib64/libgssapi_krb5.so.2.2  33a7642000-33a7644000 rw-p 00042000 fd:00 1327245                        /lib64/libgssapi_krb5.so.2.2  33a7800000-33a7861000 r-xp 00000000 fd:00 2764023                        /usr/lib64/libssl.so.1.0.1e  33a7861000-33a7a60000 ---p 00061000 fd:00 2764023                        /usr/lib64/libssl.so.1.0.1e  33a7a60000-33a7a64000 r--p 00060000 fd:00 2764023                        /usr/lib64/libssl.so.1.0.1e  33a7a64000-33a7a6b000 rw-p 00064000 fd:00 2764023                        /usr/lib64/libssl.so.1.0.1e  33a8800000-33a8851000 r-xp 00000000 fd:00 2767573                        /usr/lib64/libcurl.so.4.1.1  33a8851000-33a8a50000 ---p 00051000 fd:00 2767573                        /usr/lib64/libcurl.so.4.1.1  33a8a50000-33a8a53000 rw-p 00050000 fd:00 2767573                        /usr/lib64/libcurl.so.4.1.1  3585000000-35851b5000 r-xp 00000000 fd:00 2761539                        /usr/lib64/libcrypto.so.1.0.1e  35851b5000-35853b5000 ---p 001b5000 fd:00 2761539                        /usr/lib64/libcrypto.so.1.0.1e  35853b5000-35853d0000 r--p 001b5000 fd:00 2761539                        /usr/lib64/libcrypto.so.1.0.1e  35853d0000-35853dc000 rw-p 001d0000 fd:00 2761539                        /usr/lib64/libcrypto.so.1.0.1e  35853dc000-35853e0000 rw-p 00000000 00:00 0  3cb1800000-3cb1820000 r-xp 00000000 fd:00 1327173                        /lib64/ld-2.12.so  3cb1a1f000-3cb1a20000 r--p 0001f000 fd:00 1327173                        /lib64/ld-2.12.so  3cb1a20000-3cb1a21000 rw-p 00020000 fd:00 1327173                        /lib64/ld-2.12.so  3cb1a21000-3cb1a22000 rw-p 00000000 00:00 0  3cb1c00000-3cb1d8b000 r-xp 00000000 fd:00 1327174                        /lib64/libc-2.12.so  3cb1d8b000-3cb1f8a000 ---p 0018b000 fd:00 1327174                        /lib64/libc-2.12.so  3cb1f8a000-3cb1f8e000 r--p 0018a000 fd:00 1327174                        /lib64/libc-2.12.so  3cb1f8e000-3cb1f8f000 rw-p 0018e000 fd:00 1327174                        /lib64/libc-2.12.so 

program received signal sigabrt, aborted.

0x0000003cb1c32925 in raise () /lib64/libc.so.6

(gdb) bt  #0  0x0000003cb1c32925 in raise () /lib64/libc.so.6  #1  0x0000003cb1c34105 in abort () /lib64/libc.so.6  #2  0x0000003cb1c70837 in __libc_message () /lib64/libc.so.6  #3  0x0000003cb1c76166 in malloc_printerr () /lib64/libc.so.6  #4  0x00000000004469ea in carrier::~carrier (this=0xccc478, __in_chrg=<value optimized out>) @ carrier.cpp:27  #5  0x0000000000422f5d in __gnu_cxx::new_allocator<carrier>::destroy<carrier> (this=0xccc470, __p=0xccc478) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/ext/new_allocator.h:124  #6  0x0000000000422e21 in std::allocator_traits<std::allocator<carrier> >::_s_destroy<carrier> (__a=..., __p=0xccc478) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/alloc_traits.h:281  #7  0x0000000000422cf9 in std::allocator_traits<std::allocator<carrier> >::destroy<carrier> (__a=..., __p=0xccc478) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/alloc_traits.h:405  #8  0x0000000000422a81 in std::_sp_counted_ptr_inplace<carrier, std::allocator<carrier>, (__gnu_cxx::_lock_policy)2>::_m_dispose (this=0xccc460) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/shared_ptr_base.h:407  #9  0x000000000040aee0 in std::_sp_counted_base<(__gnu_cxx::_lock_policy)2>::_m_release (this=0xccc460) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/shared_ptr_base.h:144  #10 0x000000000040acd0 in std::__shared_count<(__gnu_cxx::_lock_policy)2>::operator= (this=0x7ffffffe25f8, __r=...) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/shared_ptr_base.h:565  #11 0x0000000000419f27 in std::__shared_ptr<icarrier, (__gnu_cxx::_lock_policy)2>::operator= (this=0x7ffffffe25f0) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/shared_ptr_base.h:728  #12 0x0000000000419f51 in std::shared_ptr<icarrier>::operator= (this=0x7ffffffe25f0) @ /usr/local/tools/gcc/4.8.2/include/c++/4.8.2/bits/shared_ptr.h:93  #13 0x00000000004154c6 in beam::deleteallcarriers (this=0xccca58) @ beam.cpp:383  #14 0x00000000004151eb in beam::ondeleting (this=0xccca58, tllibvcivector=...) @ beam.cpp:352  #15 0x0000000000428134 in pbsc::deletebeamswithtraversedflagset (this=0xcc8080) @ pbsc.cpp:587  #16 0x0000000000428ceb in pbsc::oncarriermapping (this=0xcc8080, pcarriermapping=...) @ pbsc.cpp:682  #17 0x0000000000409615 in pbsc::rms::handlermscarriermappingmsg (this=0xccb970, recvdcarriermapping=...) @ rms.cpp:133  #18 0x0000000000408f10 in pbsc::rms::handlemessage (this=0xccb970, portnumber=21015, precvmsg=0x7ffffffea470 "\n\002\b\003\f\003\204", sizeofmessageread=4) @ rms.cpp:55  #19 0x0000000000481630 in inframe::modulemanager::processrxmessage (this=0xcc9280, msgbuf=0x7ffffffea470 "\n\002\b\003\f\003\204", numofbytes=@0x7fffffff9ea8, portnumber=@0x7ffffffe69c4, remoteaddr=...) @ modulemanager.cpp:1054  #20 0x000000000047fdb0 in inframe::modulemanager::recvandforwardmessage (this=0xcc9280, portnumber=21015) @ modulemanager.cpp:612  #21 0x0000000000451f9f in pbsc::pbscapp::actoninterrupt (this=0x7fffffffdb90, tick=83118159) @ pbscapp.cpp:101  #22 0x00000000004798a1 in inframe::apptask::readinterrupt (this=0x7fffffffdb90) @ apptask.cpp:263  #23 0x0000000000455d60 in pbsc::pbscappmain (argc=7, argv=0x7fffffffe1c8) @ pbscapp.cpp:699  #24 0x00000000004550b4 in main (argc=7, argv=0x7fffffffe1c8) @ pbscapp.cpp:550 

valgrind

==32508== memcheck, memory error detector ==32508== copyright (c) 2002-2012, , gnu gpl'd, julian seward et al. ==32508== using valgrind-3.8.1 , libvex; rerun -h copyright info ==32508== command: ./pbsc_1 1 3145740 3178509 193 45.48.25.21 1  ==32508== syscall param socketcall.recvfrom(fromlen_in) points uninitialised byte(s) ==32508==    @ 0x3cb280ebd3: ??? (in /lib64/libpthread-2.12.so) ==32508==    0x479b18: inframe::apptask::readinterrupt() (apptask.cpp:234) ==32508==    0x45617f: pbsc::pbscappmain(int, char**) (pbscapp.cpp:699) ==32508==    0x4554d3: main (pbscapp.cpp:550) ==32508==  address 0x7fefff99c on thread 1's stack ==32508==  uninitialised value created stack allocation ==32508==    @ 0x479aa0: inframe::apptask::readinterrupt() (apptask.cpp:216)  ==32508==  ==32508== syscall param socketcall.sendto(msg) points uninitialised byte(s) ==32508==    @ 0x3cb280edb3: ??? (in /lib64/libpthread-2.12.so) ==32508==    0x482301: inframe::module::sendmessage(std::string const*, int) (module.cpp:94) ==32508==    0x40e272: pbsc::ems::sendemscompstatusmsg(compunicastmetamessage&) (ems.cpp:378) ==32508==    0x429bf9: pbsc::sendemscomponentstatusmessage() const (pbsc.cpp:800) ==32508==    0x4244ef: pbsc::onsgsnstatuschange(esgsnstatus) (pbsc.cpp:130) ==32508==    0x432fcc: sgsn::decodemessagefromstack(char*) (sgsn.cpp:447) ==32508==    0x43703c: sgsn::handlemessage(unsigned short, char const*, int) (sgsn.cpp:810) ==32508==    0x481a4f: inframe::modulemanager::processrxmessage(char*, int&, unsigned short&, sockaddr_in&) (modulemanager.cpp:1054) ==32508==    0x4801cf: inframe::modulemanager::recvandforwardmessage(unsigned short) (modulemanager.cpp:612) ==32508==    0x4523e0: pbsc::pbscapp::actoninterrupt(unsigned long) (pbscapp.cpp:102) ==32508==    0x479cc0: inframe::apptask::readinterrupt() (apptask.cpp:263) ==32508==    0x45617f: pbsc::pbscappmain(int, char**) (pbscapp.cpp:699) ==32508==  address 0x5fc4baa 170 bytes inside block of size 176 alloc'd ==32508==    @ 0x4a075bc: operator new(unsigned long) (vg_replace_malloc.c:298) ==32508==    0x5813ca8: std::string::_rep::_s_create(unsigned long, unsigned long, std::allocator<char> const&) (new_allocator.h:104) ==32508==    0x581487a: std::string::_rep::_m_clone(std::allocator<char> const&, unsigned long) (basic_string.tcc:629) ==32508==    0x5814913: std::string::reserve(unsigned long) (basic_string.tcc:510) ==32508==    0x5814cd5: std::string::append(unsigned long, char) (basic_string.tcc:288) ==32508==    0x4c6455e: google::protobuf::messagelite::appendpartialtostring(std::string*) const (basic_string.h:667) ==32508==    0x40e172: pbsc::ems::sendemscompstatusmsg(compunicastmetamessage&) (ems.cpp:375) ==32508==    0x429bf9: pbsc::sendemscomponentstatusmessage() const (pbsc.cpp:800) ==32508==    0x4244ef: pbsc::onsgsnstatuschange(esgsnstatus) (pbsc.cpp:130) ==32508==    0x432fcc: sgsn::decodemessagefromstack(char*) (sgsn.cpp:447) ==32508==    0x43703c: sgsn::handlemessage(unsigned short, char const*, int) (sgsn.cpp:810) ==32508==    0x481a4f: inframe::modulemanager::processrxmessage(char*, int&, unsigned short&, sockaddr_in&) (modulemanager.cpp:1054) ==32508==  uninitialised value created heap allocation ==32508==    @ 0x4a075bc: operator new(unsigned long) (vg_replace_malloc.c:298) ==32508==    0x411e42: pbsc::emsmanager::createmodule() const (emsmanager.cpp:67) ==32508==    0x47e386: inframe::modulemanager::associate(unsigned int) (modulemanager.cpp:133) ==32508==    0x45281b: pbsc::pbscapp::initializeemsmanager(unsigned int, unsigned int, unsigned short) const (pbscapp.cpp:164) ==32508==    0x455fc3: pbsc::pbscappmain(int, char**) (pbscapp.cpp:675) ==32508==    0x4554d3: main (pbscapp.cpp:550) ==32508==   ==32508== invalid free() / delete / delete[] / realloc() ==32508==    @ 0x4a05fd6: operator delete(void*) (vg_replace_malloc.c:480) ==32508==    0x446e07: carrier::~carrier() (carrier.cpp:33) ==32508==    0x4231d0: void __gnu_cxx::new_allocator<carrier>::destroy<carrier>(carrier*) (new_allocator.h:124) ==32508==    0x423094: std::enable_if<std::allocator_traits<std::allocator<carrier> >::__destroy_helper<carrier>::value, void>::type std::allocator_traits<std::allocator<carrier> >::_s_destroy<carrier>(std::allocator<carrier>&, carrier*) (alloc_traits.h:281) ==32508==    0x422f6c: void std::allocator_traits<std::allocator<carrier> >::destroy<carrier>(std::allocator<carrier>&, carrier*) (alloc_traits.h:405) ==32508==    0x422cf4: std::_sp_counted_ptr_inplace<carrier, std::allocator<carrier>, (__gnu_cxx::_lock_policy)2>::_m_dispose() (shared_ptr_base.h:407) ==32508==    0x40b04f: std::_sp_counted_base<(__gnu_cxx::_lock_policy)2>::_m_release() (shared_ptr_base.h:144) ==32508==    0x40ae3f: std::__shared_count<(__gnu_cxx::_lock_policy)2>::operator=(std::__shared_count<(__gnu_cxx::_lock_policy)2> const&) (shared_ptr_base.h:565) ==32508==    0x41a154: std::__shared_ptr<icarrier, (__gnu_cxx::_lock_policy)2>::operator=(std::__shared_ptr<icarrier, (__gnu_cxx::_lock_policy)2> const&) (shared_ptr_base.h:728) ==32508==    0x41a17e: std::shared_ptr<icarrier>::operator=(std::shared_ptr<icarrier> const&) (shared_ptr.h:93) ==32508==    0x4156a0: beam::deleteallcarriers() (beam.cpp:386) ==32508==    0x4153c2: beam::ondeleting(std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >&) (beam.cpp:355) ==32508==  address 0x5fe21a8 24 bytes inside block of size 64 alloc'd ==32508==    @ 0x4a075bc: operator new(unsigned long) (vg_replace_malloc.c:298) ==32508==    0x421995: __gnu_cxx::new_allocator<std::_sp_counted_ptr_inplace<carrier, std::allocator<carrier>, (__gnu_cxx::_lock_policy)2> >::allocate(unsigned long, void const*) (new_allocator.h:104) ==32508==    0x4215d9: std::allocator_traits<std::allocator<std::_sp_counted_ptr_inplace<carrier, std::allocator<carrier>, (__gnu_cxx::_lock_policy)2> > >::allocate(std::allocator<std::_sp_counted_ptr_inplace<carrier, std::allocator<carrier>, (__gnu_cxx::_lock_policy)2> >&, unsigned long) (alloc_traits.h:351) ==32508==    0x4211af: std::__shared_count<(__gnu_cxx::_lock_policy)2>::__shared_count<carrier, std::allocator<carrier>, int&, int&>(std::_sp_make_shared_tag, carrier*, std::allocator<carrier> const&, int&, int&) (shared_ptr_base.h:499) ==32508==    0x420dda: std::__shared_ptr<carrier, (__gnu_cxx::_lock_policy)2>::__shared_ptr<std::allocator<carrier>, int&, int&>(std::_sp_make_shared_tag, std::allocator<carrier> const&, int&, int&) (shared_ptr_base.h:957) ==32508==    0x420b97: std::shared_ptr<carrier>::shared_ptr<std::allocator<carrier>, int&, int&>(std::_sp_make_shared_tag, std::allocator<carrier> const&, int&, int&) (shared_ptr.h:316) ==32508==    0x4208b5: std::shared_ptr<carrier> std::allocate_shared<carrier, std::allocator<carrier>, int&, int&>(std::allocator<carrier> const&, int&, int&) (shared_ptr.h:598) ==32508==    0x420576: _zst11make_sharedi7carrieriris1_eest10shared_ptrit_edpot0_ (shared_ptr.h:614) ==32508==    0x4200fe: factory::makecarrier(int, int) (factory.cpp:43) ==32508==    0x415178: beam::addcarrier(int, int) (beam.cpp:318) ==32508==    0x414fb4: beam::update(rgw::common::beaminfo const&, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >&) (beam.cpp:294) ==32508==    0x428d91: pbsc::oncarriermapping(rgw::common::carriermapping const&) (pbsc.cpp:662) ==32508==  

remove destructors, none appear needed.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -