Yes. It seems that problem. However, I get into another problem.
4096==ERROR: AddressSanitizer: attempting double-free on 0x604000004250 in thread T0:
#0 0x7f818389b630 in operator delete(void*) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc8630)
#1 0x7f817f4d50e1 in fluid_msg::PacketOutCommon::~PacketOutCommon() fluid/ofcommon/msg.cc:307
#2 0x12168ad in void std::_Destroy<fluid_msg::of10::PacketOut>(fluid_msg::of10::PacketOut*) /usr/include/c++/6/bits/stl_construct.h:93
#3 0x121493b in void std::_Destroy_aux<false>::__destroy<fluid_msg::of10::PacketOut*>(fluid_msg::of10::PacketOut*, fluid_msg::of10::PacketOut*) /usr/include/c++/6/bits/stl_construct.h:103
#4 0x1210e07 in void std::_Destroy<fluid_msg::of10::PacketOut*>(fluid_msg::of10::PacketOut*, fluid_msg::of10::PacketOut*) /usr/include/c++/6/bits/stl_construct.h:126
#5 0x120e31b in void std::_Destroy<fluid_msg::of10::PacketOut*, fluid_msg::of10::PacketOut>(fluid_msg::of10::PacketOut*, fluid_msg::of10::PacketOut*, std::allocator<fluid_msg::of10::PacketOut>&) /usr/include/c++/6/bits/stl_construct.h:151
#6 0x1213430 in void std::vector<fluid_msg::of10::PacketOut, std::allocator<fluid_msg::of10::PacketOut> >::_M_emplace_back_aux<fluid_msg::of10::PacketOut>(fluid_msg::of10::PacketOut&&) /usr/include/c++/6/bits/vector.tcc:436
#7 0x120ef66 in void std::vector<fluid_msg::of10::PacketOut, std::allocator<fluid_msg::of10::PacketOut> >::emplace_back<fluid_msg::of10::PacketOut>(fluid_msg::of10::PacketOut&&) /usr/include/c++/6/bits/vector.tcc:101
#8 0x120c1ec in std::vector<fluid_msg::of10::PacketOut, std::allocator<fluid_msg::of10::PacketOut> >::push_back(fluid_msg::of10::PacketOut&&) /usr/include/c++/6/bits/stl_vector.h:933
#9 0x11e890e in ofd::topology_manager::feature_response_process(fluid_msg::of10::FeaturesReply) topo/topologymanager.cc:605
#10 0x11e51cb in ofd::topology_manager::read_queue_msg(ofd::wrap_msg) topo/topologymanager.cc:24
#11 0x11e61d6 in operator()<seastar::future<ofd::wrap_msg> > topo/topologymanager.cc:99
#12 0x11f0649 in apply<ofd::topology_manager::process_Msg()::<lambda()>::<lambda(auto:37)>, seastar::future<ofd::wrap_msg> > /home/sothy/netbricks/development/seastar/core/future.hh:1312
#13 0x1203d0b in operator()<seastar::future_state<ofd::wrap_msg> > /home/sothy/netbricks/development/seastar/core/future.hh:940
#14 0x1204612 in run /home/sothy/netbricks/development/seastar/core/future.hh:395
#15 0x456004 in seastar::reactor::run_tasks(seastar::circular_buffer<std::unique_ptr<seastar::task, std::default_delete<seastar::task> >, std::allocator<std::unique_ptr<seastar::task, std::default_delete<seastar::task> > > >&) core/reactor.cc:2316
#16 0x45cc46 in seastar::reactor::run() core/reactor.cc:2774
#17 0xab585e in seastar::app_template::run_deprecated(int, char**, std::function<void ()>&&) core/app-template.cc:142
#18 0x12193ba in main /home/sothy/netbricks/bitbucket/ofd/ofapp.cc:186
#19 0x7f817eb9582f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#20 0x415428 in _start (/home/sothy/netbricks/bitbucket/ofd/a.out+0x415428)
0x604000004250 is located 0 bytes inside of 45-byte region [0x604000004250,0x60400000427d)
freed by thread T0 here:
#0 0x7f818389b630 in operator delete(void*) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc8630)
#1 0x7f817f4d50e1 in fluid_msg::PacketOutCommon::~PacketOutCommon() fluid/ofcommon/msg.cc:307
#2 0x11e891a in ofd::topology_manager::feature_response_process(fluid_msg::of10::FeaturesReply) topo/topologymanager.cc:577
#3 0x11e51cb in ofd::topology_manager::read_queue_msg(ofd::wrap_msg) topo/topologymanager.cc:24
#4 0x11e61d6 in operator()<seastar::future<ofd::wrap_msg> > topo/topologymanager.cc:99
#5 0x11f0649 in apply<ofd::topology_manager::process_Msg()::<lambda()>::<lambda(auto:37)>, seastar::future<ofd::wrap_msg> > /home/sothy/netbricks/development/seastar/core/future.hh:1312
#6 0x1203d0b in operator()<seastar::future_state<ofd::wrap_msg> > /home/sothy/netbricks/development/seastar/core/future.hh:940
#7 0x1204612 in run /home/sothy/netbricks/development/seastar/core/future.hh:395
#8 0x456004 in seastar::reactor::run_tasks(seastar::circular_buffer<std::unique_ptr<seastar::task, std::default_delete<seastar::task> >, std::allocator<std::unique_ptr<seastar::task, std::default_delete<seastar::task> > > >&) core/reactor.cc:2316
#9 0x45cc46 in seastar::reactor::run() core/reactor.cc:2774
#10 0xab585e in seastar::app_template::run_deprecated(int, char**, std::function<void ()>&&) core/app-template.cc:142
#11 0x12193ba in main /home/sothy/netbricks/bitbucket/ofd/ofapp.cc:186
#12 0x7f817eb9582f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
previously allocated by thread T0 here:
#0 0x7f818389afb0 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc7fb0)
#1 0x7f817f4d59e4 in fluid_msg::PacketOutCommon::data(void*, unsigned long) fluid/ofcommon/msg.cc:380
SUMMARY: AddressSanitizer: double-free (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc8630) in operator delete(void*)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
In summary,
std::vector<of10::PacketOut> vec_packet_out=feature_response_process(std::move(featuresReply));
Within feature_response_process(), I create PacketOut one by one (within for loop) and add into vector.
| PacketOutCommon::~PacketOutCommon() { |
| ::operator delete(this->data_); |
}
As shown in line 307, ::
operator delete(
this->data_); In my understanding, vector keeps copy of PacketOut.
My question is that why this error comes?
Thanks again.
Best regards
Sothy