Actions
Bug #4147
closedstack-use-after-scope in Mgmt/TestDispatcher/StatusDataset
Start date:
Due date:
% Done:
0%
Estimated time:
Description
With gcc 7.1.0
Entering test case "StatusDataset"
=================================================================
==7859==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffdab602f08 at pc 0x7f63933fac60 bp 0x7ffdab602eb0 sp 0x7ffdab602ea8
READ of size 8 at 0x7ffdab602f08 thread T0
#0 0x7f63933fac5f in __gnu_cxx::__normal_iterator<ndn::Block*, std::vector<ndn::Block, std::allocator<ndn::Block> > >::difference_type __gnu_cxx::operator-<ndn::Block*, std::vector<ndn::Block, std::allocator<ndn::Block> > >(__gnu_cxx::__normal_iterator<ndn::Block*, std::vector<ndn::Block, std::allocator<ndn::Block> > > const&, __gnu_cxx::__normal_iterator<ndn::Block*, std::vector<ndn::Block, std::allocator<ndn::Block> > > const&) /usr/include/c++/7/bits/stl_iterator.h:965
#1 0x7f63933fac5f in void std::vector<ndn::Block, std::allocator<ndn::Block> >::_M_realloc_insert<ndn::Block const&>(__gnu_cxx::__normal_iterator<ndn::Block*, std::vector<ndn::Block, std::allocator<ndn::Block> > >, ndn::Block const&) /usr/include/c++/7/bits/vector.tcc:405
#2 0x7f63933e7cee in std::vector<ndn::Block, std::allocator<ndn::Block> >::push_back(ndn::Block const&) /usr/include/c++/7/bits/stl_vector.h:948
#3 0x7f63933e7cee in ndn::Block::push_back(ndn::Block const&) ../src/encoding/block.cpp:571
#4 0x7f639354be64 in ndn::mgmt::ControlResponse::wireEncode() const ../src/mgmt/control-response.cpp:58
#5 0x7f6393b57e2b in operator() ../src/util/dummy-client-face.cpp:212
#6 0x7f6393b5873c in _M_invoke /usr/include/c++/7/bits/std_function.h:316
#7 0x1028c9f in std::function<void (ndn::Interest const&)>::operator()(ndn::Interest const&) const /usr/include/c++/7/bits/std_function.h:706
#8 0x7f6393b5c290 in ndn::util::signal::Signal<ndn::util::DummyClientFace, ndn::Interest>::operator()(ndn::Interest const&) ../src/util/signal-signal.hpp:237
#9 0x7f6393b52dff in operator() ../src/util/dummy-client-face.cpp:152
#10 0x7f6393b5433f in _M_invoke /usr/include/c++/7/bits/std_function.h:316
#11 0x886707 in std::function<void (ndn::Block const&)>::operator()(ndn::Block const&) const /usr/include/c++/7/bits/std_function.h:706
#12 0x7f6393b5a7be in ndn::util::signal::Signal<ndn::util::DummyClientFace::Transport, ndn::Block>::operator()(ndn::Block const&) ../src/util/signal-signal.hpp:237
#13 0x7f6393b5a9f8 in ndn::util::DummyClientFace::Transport::send(ndn::Block const&) ../src/util/dummy-client-face.cpp:64
#14 0x7f639348a9c9 in ndn::Face::Impl::asyncExpressInterest(std::shared_ptr<ndn::Interest const>, std::function<void (ndn::Interest const&, ndn::Data const&)> const&, std::function<void (ndn::Interest const&, ndn::lp::Nack const&)> const&, std::function<void (ndn::Interest const&)> const&) (/usr/local/lib/libndn-cxx.so.0.5.1+0x3099c9)
#15 0x7f6393455f18 in operator() ../src/face.cpp:180
#16 0x7f6393455f18 in asio_handler_invoke<ndn::Face::expressInterest(const ndn::Interest&, const DataCallback&, const NackCallback&, const TimeoutCallback&)::<lambda()> > /usr/include/boost/asio/handler_invoke_hook.hpp:64
#17 0x7f6393455f18 in invoke<ndn::Face::expressInterest(const ndn::Interest&, const DataCallback&, const NackCallback&, const TimeoutCallback&)::<lambda()>, ndn::Face::expressInterest(const ndn::Interest&, const DataCallback&, const NackCallback&, const TimeoutCallback&)::<lambda()> > /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#18 0x7f6393455f18 in do_complete /usr/include/boost/asio/detail/completion_handler.hpp:68
#19 0x6cd951 in ndn::tests::UnitTestTimeFixture::advanceClocks(boost::chrono::duration<long, boost::ratio<1l, 1000000000l> > const&, unsigned long) (build/unit-tests+0x6cd951)
#20 0x8509ea in ndn::mgmt::tests::Mgmt::TestDispatcher::StatusDataset::test_method() ../tests/unit-tests/mgmt/dispatcher.t.cpp:347
#21 0x881a48 in StatusDataset_invoker ../tests/unit-tests/mgmt/dispatcher.t.cpp:306
#22 0x4b291c in boost::unit_test::ut_detail::unused boost::unit_test::ut_detail::invoker<boost::unit_test::ut_detail::unused>::invoke<void (*)()>(void (*&)()) /usr/include/boost/test/utils/callback.hpp:56
#23 0x4b291c in boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused, void (*)()>::invoke() /usr/include/boost/test/utils/callback.hpp:89
#24 0x7f63922f31f0 (/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0+0x681f0)
#25 0x7f63922ce545 in boost::execution_monitor::catch_signals(boost::unit_test::callback0<int> const&) (/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0+0x43545)
#26 0x7f63922ced82 in boost::execution_monitor::execute(boost::unit_test::callback0<int> const&) (/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0+0x43d82)
#27 0x7f63922f32f1 in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::unit_test::test_case const&) (/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0+0x682f1)
#28 0x7f63922dcf93 in boost::unit_test::framework_impl::visit(boost::unit_test::test_case const&) (/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0+0x51f93)
#29 0x7f639230bd22 in boost::unit_test::traverse_test_tree(boost::unit_test::test_suite const&, boost::unit_test::test_tree_visitor&) (/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0+0x80d22)
#30 0x7f639230bd22 in boost::unit_test::traverse_test_tree(boost::unit_test::test_suite const&, boost::unit_test::test_tree_visitor&) (/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0+0x80d22)
#31 0x7f639230bd22 in boost::unit_test::traverse_test_tree(boost::unit_test::test_suite const&, boost::unit_test::test_tree_visitor&) (/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0+0x80d22)
#32 0x7f63922d84b9 in boost::unit_test::framework::run(unsigned long, bool) (/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0+0x4d4b9)
#33 0x7f63922f0ed3 in boost::unit_test::unit_test_main(bool (*)(), int, char**) (/usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.54.0+0x65ed3)
#34 0x47ae17 in main ../tests/main.cpp:109
#35 0x7f6390a3bf44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21f44)
#36 0x47a2b8 (build/unit-tests+0x47a2b8)
Address 0x7ffdab602f08 is located in stack of thread T0
SUMMARY: AddressSanitizer: stack-use-after-scope /usr/include/c++/7/bits/stl_iterator.h:965 in __gnu_cxx::__normal_iterator<ndn::Block*, std::vector<ndn::Block, std::allocator<ndn::Block> > >::difference_type __gnu_cxx::operator-<ndn::Block*, std::vector<ndn::Block, std::allocator<ndn::Block> > >(__gnu_cxx::__normal_iterator<ndn::Block*, std::vector<ndn::Block, std::allocator<ndn::Block> > > const&, __gnu_cxx::__normal_iterator<ndn::Block*, std::vector<ndn::Block, std::allocator<ndn::Block> > > const&)
Shadow bytes around the buggy address:
0x1000356b8590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000356b85a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000356b85b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000356b85c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000356b85d0: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1000356b85e0: f8[f8]00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000356b85f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000356b8600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000356b8610: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000356b8620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1000356b8630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==7859==ABORTING
Actions