PengZheng opened a new issue, #506:
URL: https://github.com/apache/celix/issues/506
```
60: =================================================================
60: ==40373==ERROR: AddressSanitizer: heap-use-after-free on address
0x6040000439a0 at pc 0x5637427b711f bp 0x7fde4304b230 sp 0x7fde4304b220
60: READ of size 8 at 0x6040000439a0 thread T70
60: #0 0x5637427b711e in std::_Function_base::_M_empty() const
/usr/include/c++/9/bits/std_function.h:263
60: #1 0x5637427d2e24 in std::function<void (double
const&)>::operator()(double const&) const
/usr/include/c++/9/bits/std_function.h:686
60: #2 0x5637427c8176 in
celix::PushStream<double>::forEach(std::function<void (double
const&)>)::{lambda(celix::PushEvent<double>
const&)#1}::operator()(celix::PushEvent<double> const&) const
/home/runner/work/celix/celix/libs/pushstreams/api/celix/PushStream.h:174
60: #3 0x5637427dcf0a in std::_Function_handler<long
(celix::PushEvent<double> const&),
celix::PushStream<double>::forEach(std::function<void (double
const&)>)::{lambda(celix::PushEvent<double>
const&)#1}>::_M_invoke(std::_Any_data const&, celix::PushEvent<double> const&)
/usr/include/c++/9/bits/std_function.h:285
60: #4 0x7fde492ad96c in std::function<long (celix::PushEvent<double>
const&)>::operator()(celix::PushEvent<double> const&) const
/usr/include/c++/9/bits/std_function.h:688
60: #5 0x7fde49294456 in
celix::PushEventConsumer<double>::accept(celix::PushEvent<double> const&)
/home/runner/work/celix/celix/libs/pushstreams/api/celix/impl/PushEventConsumer.h:60
60: #6 0x7fde492f680a in
celix::BufferedPushStream<double>::startWorker()::{lambda()#1}::operator()()
const
/home/runner/work/celix/celix/libs/pushstreams/api/celix/impl/BufferedPushStream.h:103
60: #7 0x7fde492f9ecd in std::_Function_handler<void (),
celix::BufferedPushStream<double>::startWorker()::{lambda()#1}>::_M_invoke(std::_Any_data
const&) /usr/include/c++/9/bits/std_function.h:300
60: #8 0x7fde492314f1 in std::function<void ()>::operator()() const
/usr/include/c++/9/bits/std_function.h:688
60: #9 0x7fde4921653e in celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}::operator()()
/home/runner/work/celix/celix/libs/promises/api/celix/DefaultExecutor.h:40
60: #10 0x7fde492e8fab in void std::__invoke_impl<void,
celix::DefaultExecutor::execute(int, std::function<void
()>)::{lambda()#1}>(std::__invoke_other, celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}&&) /usr/include/c++/9/bits/invoke.h:60
60: #11 0x7fde492e8cd1 in
std::__invoke_result<celix::DefaultExecutor::execute(int, std::function<void
()>)::{lambda()#1}>::type std::__invoke<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}>(std::__invoke_result&&,
(celix::DefaultExecutor::execute(int, std::function<void
()>)::{lambda()#1}&&)...) /usr/include/c++/9/bits/invoke.h:95
60: #12 0x7fde492e879b in void
std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}>
>::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/include/c++/9/thread:244
60: #13 0x7fde492e81df in
std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >::operator()()
/usr/include/c++/9/thread:251
60: #14 0x7fde492e7602 in
std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>,
std::__future_base::_Result_base::_Deleter>,
std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >, void>::operator()() const
/usr/include/c++/9/future:1362
60: #15 0x7fde492e657a in
std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> (),
std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>,
std::__future_base::_Result_base::_Deleter>,
std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data
const&) /usr/include/c++/9/bits/std_function.h:286
60: #16 0x7fde492303e7 in
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>::operator()() const
/usr/include/c++/9/bits/std_function.h:688
60: #17 0x7fde4921432b in
std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*)
/usr/include/c++/9/future:561
60: #18 0x7fde49265f4a in void std::__invoke_impl<void, void
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*,
bool*>(std::__invoke_memfun_deref, void
(std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*&&,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)
/usr/include/c++/9/bits/invoke.h:73
60: #19 0x7fde49248b62 in std::__invoke_result<void
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type
std::__invoke<void
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void
(std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*&&,
std::function<std::unique_ptr<std::__future_base::_Result_base, std::_
_future_base::_Result_base::_Deleter> ()>*&&, bool*&&)
/usr/include/c++/9/bits/invoke.h:95
60: #20 0x7fde4922fe25 in std::call_once<void
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void
(std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*&&,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*&&,
bool*&&)::{lambda()#1}::operator()() const /usr/include/c++/9/mutex:671
60: #21 0x7fde4922fe5c in std::call_once<void
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void
(std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*&&,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*&&,
bool*&&)::{lambda()#2}::operator()() const /usr/include/c++/9/mutex:676
60: #22 0x7fde4922fe71 in std::call_once<void
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void
(std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*&&,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*&&,
bool*&&)::{lambda()#2}::_FUN() /usr/include/c++/9/mutex:676
60: #23 0x7fde57f2f4de in __pthread_once_slow
(/lib/x86_64-linux-gnu/libpthread.so.0+0x114de)
60: #24 0x7fde4920f828 in __gthread_once
/usr/include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:700
60: #25 0x7fde49230077 in void std::call_once<void
(std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void
(std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*, bool*),
std::__future_base::_State_baseV2*&&,
std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)
/usr/include/c++/9/mutex:683
60: #26 0x7fde49213d59 in
std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base,
std::__future_base::_Result_base::_Deleter> ()>, bool)
/usr/include/c++/9/future:401
60: #27 0x7fde492e22b0 in
std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >,
void>::_Async_state_impl(std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}>&&)::{lambda()#1}::operator()() const
/usr/include/c++/9/future:1662
60: #28 0x7fde492fa7ce in void std::__invoke_impl<void,
std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >,
void>::_Async_state_impl(std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}>&&)::{lambda()#1}>(std::__invoke_other,
std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >,
void>::_Async_state_impl(std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}>&&)::{lambda()#1}&&)
/usr/include/c++/9/bits/invoke.h:60
60: #29 0x7fde492f94bc in
std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >,
void>::_Async_state_impl(std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}>&&)::{lambda()#1}>::type
std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >,
void>::_Async_state_impl(std::tuple<celix::DefaultExecutor::execute(int,
std::function<void
()>)::{lambda()#1}>&&)::{lambda()#1}>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >,
void>::_Async_state_impl(std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}>&&)::{lambda()#1}&&,
(std::__invoke_result&&)...) /usr/include/c++/9/bits/invoke.h:95
60: #30 0x7fde492f7639 in void
std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >,
void>::_Async_state_impl(std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}>&&)::{lambda()#1}>
>::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/include/c++/9/thread:244
60: #31 0x7fde492f53a3 in
std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >,
void>::_Async_state_impl(std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}>&&)::{lambda()#1}> >::operator()()
/usr/include/c++/9/thread:251
60: #32 0x7fde492ec067 in
std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}> >,
void>::_Async_state_impl(std::tuple<celix::DefaultExecutor::execute(int,
std::function<void ()>)::{lambda()#1}>&&)::{lambda()#1}> > >::_M_run()
/usr/include/c++/9/thread:195
60: #33 0x7fde57e12de3 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd6de3)
60: #34 0x7fde57f26608 in start_thread
(/lib/x86_64-linux-gnu/libpthread.so.0+0x8608)
60: #35 0x7fde57aff132 in __clone
(/lib/x86_64-linux-gnu/libc.so.6+0x11f132)
60:
60: 0x6040000439a0 is located 16 bytes inside of 40-byte region
[0x604000043990,0x6040000439b8)
60: freed by thread T16 here:
60: #0 0x7fde59730c65 in operator delete(void*, unsigned long)
../../../../src/libsanitizer/asan/asan_new_delete.cc:177
60: #1 0x5637427e572d in
std::_Function_base::_Base_manager<celix::PushStream<double>::forEach(std::function<void
(double const&)>)::{lambda(celix::PushEvent<double>
const&)#1}>::_M_destroy(std::_Any_data&, std::integral_constant<bool, false>)
/usr/include/c++/9/bits/std_function.h:191
60: #2 0x5637427dd031 in
std::_Function_base::_Base_manager<celix::PushStream<double>::forEach(std::function<void
(double const&)>)::{lambda(celix::PushEvent<double>
const&)#1}>::_M_manager(std::_Any_data&,
std::_Function_base::_Base_manager<celix::PushStream<double>::forEach(std::function<void
(double const&)>)::{lambda(celix::PushEvent<double> const&)#1}> const&,
std::_Manager_operation) /usr/include/c++/9/bits/std_function.h:215
60: #3 0x5637427b70e5 in std::_Function_base::~_Function_base()
/usr/include/c++/9/bits/std_function.h:260
60: #4 0x5637427c8825 in std::function<long (celix::PushEvent<double>
const&)>::~function() /usr/include/c++/9/bits/std_function.h:369
60: #5 0x5637427d32ec in std::function<long (celix::PushEvent<double>
const&)>::operator=(std::function<long (celix::PushEvent<double> const&)>&&)
/usr/include/c++/9/bits/std_function.h:482
60: #6 0x5637427c8981 in
celix::PushEventConsumer<double>::operator=(celix::PushEventConsumer<double>&&)
/home/runner/work/celix/celix/libs/pushstreams/api/celix/impl/PushEventConsumer.h:28
60: #7 0x5637427c8b00 in
celix::PushStream<double>::forEach(std::function<void (double const&)>)
/home/runner/work/celix/celix/libs/pushstreams/api/celix/PushStream.h:170
60: #8 0x5637427bdc1c in auto
RemoteServicesIntegrationTestSuite::invokeRemoteCalcService()::{lambda(auto:1&)#1}::operator()<ICalculator>(ICalculator&)
const
/home/runner/work/celix/celix/bundles/cxx_remote_services/integration/gtest/src/RemoteServicesIntegrationTestSuite.cc:126
60: #9 0x5637427d4551 in std::_Function_handler<void (ICalculator&),
RemoteServicesIntegrationTestSuite::invokeRemoteCalcService()::{lambda(auto:1&)#1}>::_M_invoke(std::_Any_data
const&, ICalculator&) /usr/include/c++/9/bits/std_function.h:300
60: #10 0x5637427d1d96 in std::function<void
(ICalculator&)>::operator()(ICalculator&) const
/usr/include/c++/9/bits/std_function.h:688
60: #11 0x5637427c6b85 in
celix::UseServiceBuilder<ICalculator>::build()::{lambda(void*, void*, hashMap
const*, celix_bundle const*)#1}::operator()(void*, void*, hashMap const*,
celix_bundle const*) const
/home/runner/work/celix/celix/libs/framework/include/celix/UseServiceBuilder.h:164
60: #12 0x5637427c701a in
celix::UseServiceBuilder<ICalculator>::build()::{lambda(void*, void*, hashMap
const*, celix_bundle const*)#1}::_FUN(void*, void*, hashMap const*,
celix_bundle const*)
/home/runner/work/celix/celix/libs/framework/include/celix/UseServiceBuilder.h:158
60: #13 0x7fde595de854 in
celix_serviceTracker_useHighestRankingService
/home/runner/work/celix/celix/libs/framework/src/service_tracker.c:767
60: #14 0x7fde595a9c4f in
celix_bundleContext_useServiceWithOptions_2_UseServiceTracker
/home/runner/work/celix/celix/libs/framework/src/bundle_context.c:1188
60: #15 0x7fde595b9a86 in fw_handleEventRequest
/home/runner/work/celix/celix/libs/framework/src/framework.c:1404
60: #16 0x7fde595ba14b in fw_handleEvents
/home/runner/work/celix/celix/libs/framework/src/framework.c:1452
60: #17 0x7fde595ba33f in fw_eventDispatcher
/home/runner/work/celix/celix/libs/framework/src/framework.c:1478
60: #18 0x7fde57f26608 in start_thread
(/lib/x86_64-linux-gnu/libpthread.so.0+0x8608)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]