Closed zydxhs closed 1 year ago
Thanks @zydxhs. It looks like you've got some CI issues to work through. When you're ready, just holler.
@kiplingw I fixed this 'conventional-commits / commitlint (pull_request)', but others I don't why failed.
I run the tests successed.
It seems that the failures are related to the changes made with this PR. They seem to point to a memory management error.
GCC on Debian Testing with no sanitizers
[ RUN ] rest_server_test.basic_test
Cores = 2
Using 1 threads
Port = 46391
free(): double free detected in tcache 2
GCC on Debian Testing with undefined behaviour sanitizer
[ RUN ] rest_server_test.basic_test
Cores = 2
Using 1 threads
Port = 46879
/usr/include/c++/12/bits/unique_ptr.h:95:2: runtime error: member call on address 0x7fd5a00014e0 which does not point to an object of type 'Header'
0x7fd5a00014e0: note: object has invalid vptr
00 00 00 00 51 15 5a 5d d2 7f 00 00 91 7a d4 23 50 5e f6 e3 12 00 00 00 00 00 00 00 1e 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
/usr/include/c++/12/bits/unique_ptr.h:95:2: runtime error: load of misaligned address 0x7fd25d5a1559 for type '<unknown> *', which requires 8 byte alignment
0x7fd25d5a1559: note: pointer points here
<memory cannot be printed>
Clang on Debian Testing with undefined behaviour sanitizer
[ RUN ] rest_server_test.basic_test
Cores = 2
Using 1 threads
Port = 37509
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h:341:16: runtime error: downcast of misaligned address 0x7f0908ef9581 for type 'std::__detail::_Hash_node<std::pair<const std::basic_string<char>, std::shared_ptr<Pistache::Http::Header::Header>>, true>', which requires 8 byte alignment
0x7f0908ef9581: note: pointer points here
<memory cannot be printed>
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h:341:16 in
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:1071:11: runtime error: member call on address 0x7f0ef80013f0 which does not point to an object of type 'std::_Sp_counted_base<__gnu_cxx::_S_atomic>'
0x7f0ef80013f0: note: object has invalid vptr
00 00 00 00 11 95 ef 08 09 7f 00 00 64 c1 16 f7 90 ff b5 85 b0 13 00 f8 0e 7f 00 00 55 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:1071:11 in
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:334:55: runtime error: member access within address 0x7f0ef80013f0 which does not point to an object of type 'std::_Sp_counted_base<__gnu_cxx::_S_atomic>'
0x7f0ef80013f0: note: object has invalid vptr
00 00 00 00 11 95 ef 08 09 7f 00 00 64 c1 16 f7 90 ff b5 85 b0 13 00 f8 0e 7f 00 00 55 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:334:55 in
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:350:48: runtime error: member access within address 0x7f0ef80013f0 which does not point to an object of type 'std::_Sp_counted_base<__gnu_cxx::_S_atomic>'
0x7f0ef80013f0: note: object has invalid vptr
00 00 00 00 11 95 ef 08 09 7f 00 00 64 c1 16 f7 90 ff b5 85 b0 13 00 f8 0e 7f 00 00 55 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:350:48 in
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==5177==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address (pc 0x7f0f08b8b74a bp 0x7f0f064cb280 sp 0x7f0f064cb230 T5181)
==5177==The signal is caused by a READ memory access.
==5177==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used.
#0 0x7f0f08b8b74a in __libc_free (/lib/x86_64-linux-gnu/libc.so.6+0x9774a) (BuildId: a4c98c0c7c7803311fbd918df8fb08db852cef3d)
#1 0x55dd456057b6 in std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >::~pair() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_iterator.h:2593:12
#2 0x55dd45605701 in void std::__new_allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >*) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/new_allocator.h:181:10
#3 0x55dd45605347 in void std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >(std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >*) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/alloc_traits.h:535:8
#4 0x55dd45605292 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h:1984:7
#5 0x55dd45604eaa in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h:2006:4
#6 0x7f0f09aea0b8 in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_move_assign(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >&&, std::integral_constant<bool, true>) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h:1404:13
#7 0x7f0f09ae9ef7 in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::operator=(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h:593:2
#8 0x7f0f09ae9bbb in std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >::operator=(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unordered_map.h:276:42
#9 0x7f0f09ae8e5b in Pistache::Http::Header::Collection::operator=(Pistache::Http::Header::Collection&&) /__w/pistache/pistache/build/../include/pistache/http_headers.h:51:11
#10 0x7f0f09ad3a43 in Pistache::Http::Message::operator=(Pistache::Http::Message&&) /__w/pistache/pistache/build/../include/pistache/http.h:100:57
#11 0x7f0f09ad995c in Pistache::Http::Request::operator=(Pistache::Http::Request&&) /__w/pistache/pistache/build/../include/pistache/http.h:188:57
#12 0x7f0f09aac3b3 in Pistache::Http::Private::ParserImpl<Pistache::Http::Request>::reset() /__w/pistache/pistache/build/../src/common/http.cc:1063:17
#13 0x7f0f09aa6333 in Pistache::Http::ResponseWriter::sendImpl(Pistache::Http::Code, char const*, unsigned long, Pistache::Http::Mime::MediaType const&) /__w/pistache/pistache/build/../src/common/http.cc:835:48
#14 0x55dd4560e2bc in Pistache::Async::Promise<long> Pistache::Http::ResponseWriter::send<2ul>(Pistache::Http::Code, char const (&) [2ul], Pistache::Http::Mime::MediaType const&) /__w/pistache/pistache/build/../include/pistache/http.h:429:24
#15 0x55dd4560e121 in StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter)::operator()(Pistache::Http::ResponseWriter) const /__w/pistache/pistache/build/../tests/rest_server_test.cc:68:54
#16 0x55dd4560dfff in void std::__invoke_impl<void, StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter>(std::__invoke_other, StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter)&&, Pistache::Http::ResponseWriter&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/invoke.h:61:14
#17 0x55dd4560dae4 in std::__invoke_result<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter>::type std::__invoke<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter>(StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter)&&, Pistache::Http::ResponseWriter&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/invoke.h:96:14
#18 0x55dd4560d974 in void std::thread::_Invoker<std::tuple<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_thread.h:252:13
#19 0x55dd4560d729 in std::thread::_Invoker<std::tuple<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_thread.h:259:11
#20 0x55dd4560cd5d in std::thread::_State_impl<std::thread::_Invoker<std::tuple<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_thread.h:210:13
#21 0x7f0f08ec63d2 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xd43d2) (BuildId: 7dfada477db09980819a1c06025334829974291d)
#22 0x7f0f08b7bb26 (/lib/x86_64-linux-gnu/libc.so.6+0x87b26) (BuildId: a4c98c0c7c7803311fbd918df8fb08db852cef3d)
#23 0x7f0f08bfdabf in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x109abf) (BuildId: a4c98c0c7c7803311fbd918df8fb08db852cef3d)
UndefinedBehaviorSanitizer can not provide additional info.
SUMMARY: UndefinedBehaviorSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x9774a) (BuildId: a4c98c0c7c7803311fbd918df8fb08db852cef3d) in __libc_free
==5177==ABORTING
GCC on Debian Testing with address sanitizer
[ RUN ] rest_server_test.basic_test
Cores = 2
Using 1 threads
Port = 45125
=================================================================
==5192==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000027978 at pc 0x55be60dcb29f bp 0x7f69f12fc1a0 sp 0x7f69f12fc198
READ of size 8 at 0x603000027978 thread T3
#0 0x55be60dcb29e in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/12/bits/shared_ptr_base.h:337
#1 0x55be60dd11db in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/12/bits/shared_ptr_base.h:1071
#2 0x55be60de6a8b in std::__shared_ptr<Pistache::Http::Header::Header, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/12/bits/shared_ptr_base.h:1524
#3 0x55be60de6adb in std::shared_ptr<Pistache::Http::Header::Header>::~shared_ptr() /usr/include/c++/12/bits/shared_ptr.h:175
#4 0x55be60de6b2f in std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >::~pair() /usr/include/c++/12/bits/stl_pair.h:185
#5 0x55be60de6b99 in void std::__new_allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >*) /usr/include/c++/12/bits/new_allocator.h:181
#6 0x55be60de3fa4 in void std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >(std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >*) /usr/include/c++/12/bits/alloc_traits.h:535
#7 0x55be60de0cc4 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/include/c++/12/bits/hashtable_policy.h:1984
#8 0x55be60ddbe1e in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/include/c++/12/bits/hashtable_policy.h:2006
#9 0x7f69f63884dc in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_move_assign(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >&&, std::integral_constant<bool, true>) /usr/include/c++/12/bits/hashtable.h:1404
#10 0x7f69f637c704 in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::operator=(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8c3704)
#11 0x7f69f6375e3a in std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >::operator=(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8bce3a)
#12 0x7f69f6375ef6 in Pistache::Http::Header::Collection::operator=(Pistache::Http::Header::Collection&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8bcef6)
#13 0x7f69f63760b8 in Pistache::Http::Message::operator=(Pistache::Http::Message&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8bd0b8)
#14 0x7f69f637726f in Pistache::Http::Request::operator=(Pistache::Http::Request&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8be26f)
#15 0x7f69f636082b in Pistache::Http::Private::ParserImpl<Pistache::Http::Request>::reset() ../src/common/http.cc:1063
#16 0x7f69f635b42e in Pistache::Http::ResponseWriter::sendImpl(Pistache::Http::Code, char const*, unsigned long, Pistache::Http::Mime::MediaType const&) ../src/common/http.cc:835
#17 0x55be60dd439e in Pistache::Async::Promise<long> Pistache::Http::ResponseWriter::send<2ul>(Pistache::Http::Code, char const (&) [2ul], Pistache::Http::Mime::MediaType const&) ../include/pistache/http.h:429
#18 0x55be60dd0114 in StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::{lambda(Pistache::Http::ResponseWriter)#1}::operator()(Pistache::Http::ResponseWriter) const ../tests/rest_server_test.cc:68
#19 0x55be60decbc4 in void std::__invoke_impl<void, StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::{lambda(Pistache::Http::ResponseWriter)#1}, Pistache::Http::ResponseWriter>(std::__invoke_other, StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::{lambda(Pistache::Http::ResponseWriter)#1}&&, Pistache::Http::ResponseWriter&&) /usr/include/c++/12/bits/invoke.h:61
#20 0x55be60dec9e5 in std::__invoke_result<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::{lambda(Pistache::Http::ResponseWriter)#1}, Pistache::Http::ResponseWriter>::type std::__invoke<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::{lambda(Pistache::Http::ResponseWriter)#1}, Pistache::Http::ResponseWriter>(StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::{lambda(Pistache::Http::ResponseWriter)#1}&&, Pistache::Http::ResponseWriter&&) /usr/include/c++/12/bits/invoke.h:96
#21 0x55be60dec860 in void std::thread::_Invoker<std::tuple<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::{lambda(Pistache::Http::ResponseWriter)#1}, Pistache::Http::ResponseWriter> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /usr/include/c++/12/bits/std_thread.h:252
#22 0x55be60dec693 in std::thread::_Invoker<std::tuple<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::{lambda(Pistache::Http::ResponseWriter)#1}, Pistache::Http::ResponseWriter> >::operator()() /usr/include/c++/12/bits/std_thread.h:259
#23 0x55be60dec1f1 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::{lambda(Pistache::Http::ResponseWriter)#1}, Pistache::Http::ResponseWriter> > >::_M_run() /usr/include/c++/12/bits/std_thread.h:210
#24 0x7f69f58e93d2 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xd43d2)
#25 0x7f69f559eb26 (/lib/x86_64-linux-gnu/libc.so.6+0x87b26)
#26 0x7f69f5620abf in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x109abf)
0x603000027978 is located 8 bytes inside of 24-byte region [0x603000027970,0x603000027988)
freed by thread T2 here:
#0 0x7f69f72823c8 in operator delete(void*, unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:164
#1 0x7f69f63b5f2c in std::__new_allocator<std::_Sp_counted_deleter<Pistache::Http::Header::Header*, std::default_delete<Pistache::Http::Header::Header>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2> >::deallocate(std::_Sp_counted_deleter<Pistache::Http::Header::Header*, std::default_delete<Pistache::Http::Header::Header>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8fcf2c)
#2 0x7f69f63b545e in std::allocator_traits<std::allocator<std::_Sp_counted_deleter<Pistache::Http::Header::Header*, std::default_delete<Pistache::Http::Header::Header>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2> > >::deallocate(std::allocator<std::_Sp_counted_deleter<Pistache::Http::Header::Header*, std::default_delete<Pistache::Http::Header::Header>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_deleter<Pistache::Http::Header::Header*, std::default_delete<Pistache::Http::Header::Header>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8fc45e)
#3 0x7f69f63b3c7b in std::__allocated_ptr<std::allocator<std::_Sp_counted_deleter<Pistache::Http::Header::Header*, std::default_delete<Pistache::Http::Header::Header>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2> > >::~__allocated_ptr() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8fac7b)
#4 0x7f69f63b2342 in std::_Sp_counted_deleter<Pistache::Http::Header::Header*, std::default_delete<Pistache::Http::Header::Header>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_destroy() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8f9342)
#5 0x55be60dcb407 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/12/bits/shared_ptr_base.h:347
#6 0x55be60dd11db in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/12/bits/shared_ptr_base.h:1071
#7 0x55be60de6a8b in std::__shared_ptr<Pistache::Http::Header::Header, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/12/bits/shared_ptr_base.h:1524
#8 0x55be60de6adb in std::shared_ptr<Pistache::Http::Header::Header>::~shared_ptr() /usr/include/c++/12/bits/shared_ptr.h:175
#9 0x55be60de6b2f in std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >::~pair() /usr/include/c++/12/bits/stl_pair.h:185
#10 0x55be60de6b99 in void std::__new_allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >*) /usr/include/c++/12/bits/new_allocator.h:181
#11 0x55be60de3fa4 in void std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::destroy<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >(std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >*) /usr/include/c++/12/bits/alloc_traits.h:535
#12 0x55be60de0cc4 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/include/c++/12/bits/hashtable_policy.h:1984
#13 0x55be60ddbe1e in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/include/c++/12/bits/hashtable_policy.h:2006
#14 0x7f69f63884dc in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_move_assign(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >&&, std::integral_constant<bool, true>) /usr/include/c++/12/bits/hashtable.h:1404
#15 0x7f69f637c704 in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::operator=(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8c3704)
#16 0x7f69f6375e3a in std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >::operator=(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8bce3a)
#17 0x7f69f6375ef6 in Pistache::Http::Header::Collection::operator=(Pistache::Http::Header::Collection&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8bcef6)
#18 0x7f69f63760b8 in Pistache::Http::Message::operator=(Pistache::Http::Message&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8bd0b8)
#19 0x7f69f637726f in Pistache::Http::Request::operator=(Pistache::Http::Request&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8be26f)
#20 0x7f69f636082b in Pistache::Http::Private::ParserImpl<Pistache::Http::Request>::reset() ../src/common/http.cc:1063
#21 0x7f69f6361a8a in Pistache::Http::Handler::onInput(char const*, unsigned long, std::shared_ptr<Pistache::Tcp::Peer> const&) ../src/common/http.cc:1115
#22 0x7f69f64ad84b in Pistache::Tcp::Transport::handleIncoming(std::shared_ptr<Pistache::Tcp::Peer> const&) ../src/common/transport.cc:195
#23 0x7f69f64ac601 in Pistache::Tcp::Transport::onReady(Pistache::Aio::FdSet const&) ../src/common/transport.cc:103
#24 0x7f69f64e72a6 in Pistache::Http::TransportImpl::onReady(Pistache::Aio::FdSet const&) ../src/server/endpoint.cc:97
#25 0x7f69f6481601 in Pistache::Aio::SyncImpl::handleFds(std::vector<Pistache::Polling::Event, std::allocator<Pistache::Polling::Event> >) const (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9c8601)
#26 0x7f69f6480997 in Pistache::Aio::SyncImpl::runOnce() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9c7997)
#27 0x7f69f6480cd8 in Pistache::Aio::SyncImpl::run() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9c7cd8)
#28 0x7f69f6485f14 in Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}::operator()() const (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9ccf14)
#29 0x7f69f649e982 in void std::__invoke_impl<void, Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}>(std::__invoke_other, Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}&&) /usr/include/c++/12/bits/invoke.h:61
previously allocated by thread T2 here:
#0 0x7f69f72814c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
#1 0x7f69f639e5db in std::__new_allocator<std::_Sp_counted_deleter<Pistache::Http::Header::Header*, std::default_delete<Pistache::Http::Header::Header>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8e55db)
#2 0x7f69f6398543 in std::allocator_traits<std::allocator<std::_Sp_counted_deleter<Pistache::Http::Header::Header*, std::default_delete<Pistache::Http::Header::Header>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_deleter<Pistache::Http::Header::Header*, std::default_delete<Pistache::Http::Header::Header>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8df543)
#3 0x7f69f6390c63 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<Pistache::Http::Header::Header, std::default_delete<Pistache::Http::Header::Header> >(std::unique_ptr<Pistache::Http::Header::Header, std::default_delete<Pistache::Http::Header::Header> >&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8d7c63)
#4 0x7f69f6386007 in std::__shared_ptr<Pistache::Http::Header::Header, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<Pistache::Http::Header::Header, std::default_delete<Pistache::Http::Header::Header>, void>(std::unique_ptr<Pistache::Http::Header::Header, std::default_delete<Pistache::Http::Header::Header> >&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8cd007)
#5 0x7f69f637a36a in std::shared_ptr<Pistache::Http::Header::Header>::shared_ptr<Pistache::Http::Header::Header, std::default_delete<Pistache::Http::Header::Header>, void>(std::unique_ptr<Pistache::Http::Header::Header, std::default_delete<Pistache::Http::Header::Header> >&&) (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x8c136a)
#6 0x7f69f635424c in Pistache::Http::Private::HeadersStep::apply(Pistache::StreamCursor&) ../src/common/http.cc:360
#7 0x7f69f6356bd3 in Pistache::Http::Private::ParserBase::parse() ../src/common/http.cc:544
#8 0x7f69f6361504 in Pistache::Http::Handler::onInput(char const*, unsigned long, std::shared_ptr<Pistache::Tcp::Peer> const&) ../src/common/http.cc:1090
#9 0x7f69f64ad84b in Pistache::Tcp::Transport::handleIncoming(std::shared_ptr<Pistache::Tcp::Peer> const&) ../src/common/transport.cc:195
#10 0x7f69f64ac601 in Pistache::Tcp::Transport::onReady(Pistache::Aio::FdSet const&) ../src/common/transport.cc:103
#11 0x7f69f64e72a6 in Pistache::Http::TransportImpl::onReady(Pistache::Aio::FdSet const&) ../src/server/endpoint.cc:97
#12 0x7f69f6481601 in Pistache::Aio::SyncImpl::handleFds(std::vector<Pistache::Polling::Event, std::allocator<Pistache::Polling::Event> >) const (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9c8601)
#13 0x7f69f6480997 in Pistache::Aio::SyncImpl::runOnce() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9c7997)
#14 0x7f69f6480cd8 in Pistache::Aio::SyncImpl::run() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9c7cd8)
#15 0x7f69f6485f14 in Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}::operator()() const (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9ccf14)
#16 0x7f69f649e982 in void std::__invoke_impl<void, Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}>(std::__invoke_other, Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}&&) /usr/include/c++/12/bits/invoke.h:61
#17 0x7f69f649e8d1 in std::__invoke_result<Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}>::type std::__invoke<Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}>(Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}&&) /usr/include/c++/12/bits/invoke.h:96
#18 0x7f69f649e7d1 in void std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/include/c++/12/bits/std_thread.h:252
#19 0x7f69f649e70f in std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}> >::operator()() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9e570f)
#20 0x7f69f649e61b in std::thread::_State_impl<std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}> > >::_M_run() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9e561b)
#21 0x7f69f58e93d2 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xd43d2)
Thread T3 created by T2 here:
#0 0x7f69f7211726 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:207
#1 0x7f69f58e94a8 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xd44a8)
#2 0x55be60dd03c2 in StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter) ../tests/rest_server_test.cc:69
#3 0x55be60dd3b03 in Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::{lambda(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)#1}::operator()(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter) const ../include/pistache/router.h:413
#4 0x55be60de5265 in Pistache::Rest::Route::Result std::__invoke_impl<Pistache::Rest::Route::Result, Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::{lambda(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)#1}&, Pistache::Rest::Request, Pistache::Http::ResponseWriter>(std::__invoke_other, Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::{lambda(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)#1}&, Pistache::Rest::Request&&, Pistache::Http::ResponseWriter&&) /usr/include/c++/12/bits/invoke.h:61
#5 0x55be60de24aa in std::enable_if<is_invocable_r_v<Pistache::Rest::Route::Result, Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::{lambda(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)#1}&, Pistache::Rest::Request, Pistache::Http::ResponseWriter>, Pistache::Rest::Route::Result>::type std::__invoke_r<Pistache::Rest::Route::Result, Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::{lambda(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)#1}&, Pistache::Rest::Request, Pistache::Http::ResponseWriter>(Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::{lambda(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)#1}&, Pistache::Rest::Request&&, Pistache::Http::ResponseWriter&&) /usr/include/c++/12/bits/invoke.h:114
#6 0x55be60ddd230 in std::_Function_handler<Pistache::Rest::Route::Result (Pistache::Rest::Request, Pistache::Http::ResponseWriter), Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::{lambda(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)#1}>::_M_invoke(std::_Any_data const&, Pistache::Rest::Request&&, Pistache::Http::ResponseWriter&&) /usr/include/c++/12/bits/std_function.h:290
#7 0x7f69f65465d6 in std::function<Pistache::Rest::Route::Result (Pistache::Rest::Request, Pistache::Http::ResponseWriter)>::operator()(Pistache::Rest::Request, Pistache::Http::ResponseWriter) const /usr/include/c++/12/bits/std_function.h:591
#8 0x7f69f6546ebd in void Pistache::Rest::Route::invokeHandler<Pistache::Rest::Request, Pistache::Http::ResponseWriter>(Pistache::Rest::Request&&, Pistache::Http::ResponseWriter&&) const ../include/pistache/router.h:99
#9 0x7f69f6537db0 in Pistache::Rest::Router::route(Pistache::Http::Request const&, Pistache::Http::ResponseWriter) ../src/server/router.cc:517
#10 0x7f69f6534af5 in Pistache::Rest::Private::RouterHandler::onRequest(Pistache::Http::Request const&, Pistache::Http::ResponseWriter) ../src/server/router.cc:367
#11 0x7f69f63619e1 in Pistache::Http::Handler::onInput(char const*, unsigned long, std::shared_ptr<Pistache::Tcp::Peer> const&) ../src/common/http.cc:1114
#12 0x7f69f64ad84b in Pistache::Tcp::Transport::handleIncoming(std::shared_ptr<Pistache::Tcp::Peer> const&) ../src/common/transport.cc:195
#13 0x7f69f64ac601 in Pistache::Tcp::Transport::onReady(Pistache::Aio::FdSet const&) ../src/common/transport.cc:103
#14 0x7f69f64e72a6 in Pistache::Http::TransportImpl::onReady(Pistache::Aio::FdSet const&) ../src/server/endpoint.cc:97
#15 0x7f69f6481601 in Pistache::Aio::SyncImpl::handleFds(std::vector<Pistache::Polling::Event, std::allocator<Pistache::Polling::Event> >) const (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9c8601)
#16 0x7f69f6480997 in Pistache::Aio::SyncImpl::runOnce() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9c7997)
#17 0x7f69f6480cd8 in Pistache::Aio::SyncImpl::run() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9c7cd8)
#18 0x7f69f6485f14 in Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}::operator()() const (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9ccf14)
#19 0x7f69f649e982 in void std::__invoke_impl<void, Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}>(std::__invoke_other, Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}&&) /usr/include/c++/12/bits/invoke.h:61
#20 0x7f69f649e8d1 in std::__invoke_result<Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}>::type std::__invoke<Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}>(Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}&&) /usr/include/c++/12/bits/invoke.h:96
#21 0x7f69f649e7d1 in void std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/include/c++/12/bits/std_thread.h:252
#22 0x7f69f649e70f in std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}> >::operator()() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9e570f)
#23 0x7f69f649e61b in std::thread::_State_impl<std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}> > >::_M_run() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9e561b)
#24 0x7f69f58e93d2 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xd43d2)
Thread T2 created by T1 here:
#0 0x7f69f7211726 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:207
#1 0x7f69f58e94a8 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xd44a8)
#2 0x7f69f64860c6 in Pistache::Aio::AsyncImpl::Worker::run() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9cd0c6)
#3 0x7f69f6485188 in Pistache::Aio::AsyncImpl::run() (/__w/pistache/pistache/build/tests/../src/libpistache.so.0+0x9cc188)
#4 0x7f69f647d0fc in Pistache::Aio::Reactor::run() ../src/common/reactor.cc:613
#5 0x7f69f64fb3d2 in Pistache::Tcp::Listener::run() ../src/server/listener.cc:344
#6 0x7f69f64fc3af in operator() ../src/server/listener.cc:387
#7 0x7f69f6505574 in __invoke_impl<void, Pistache::Tcp::Listener::runThreaded()::<lambda()> > /usr/include/c++/12/bits/invoke.h:61
#8 0x7f69f65054c3 in __invoke<Pistache::Tcp::Listener::runThreaded()::<lambda()> > /usr/include/c++/12/bits/invoke.h:96
#9 0x7f69f65053c3 in _M_invoke<0> /usr/include/c++/12/bits/std_thread.h:252
#10 0x7f69f65052b5 in operator() /usr/include/c++/12/bits/std_thread.h:259
#11 0x7f69f6504deb in _M_run /usr/include/c++/12/bits/std_thread.h:210
#12 0x7f69f58e93d2 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xd43d2)
Thread T1 created by T0 here:
#0 0x7f69f7211726 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:207
#1 0x7f69f58e94a8 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xd44a8)
#2 0x7f69f64fc4f6 in Pistache::Tcp::Listener::runThreaded() ../src/server/listener.cc:387
#3 0x7f69f64f1bde in void Pistache::Http::Endpoint::serveImpl<void (Pistache::Tcp::Listener::*)()>(void (Pistache::Tcp::Listener::*)()) ../include/pistache/endpoint.h:206
#4 0x7f69f64ea978 in Pistache::Http::Endpoint::serveThreaded() ../src/server/endpoint.cc:287
#5 0x55be60dcf5c4 in StatsEndpoint::start() ../tests/rest_server_test.cc:42
#6 0x55be60dc125b in rest_server_test_basic_test_Test::TestBody() ../tests/rest_server_test.cc:92
#7 0x55be60e1e726 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (/__w/pistache/pistache/build/tests/run_rest_server_test+0xcf726)
SUMMARY: AddressSanitizer: heap-use-after-free /usr/include/c++/12/bits/shared_ptr_base.h:337 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()
Shadow bytes around the buggy address:
0x0c067fffced0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fffcee0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fffcef0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fd fd
0x0c067fffcf00: fd fd fa fa fd fd fd fd fa fa 00 00 00 00 fa fa
0x0c067fffcf10: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fa
=>0x0c067fffcf20: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd[fd]
0x0c067fffcf30: fd fa fa fa fd fd fd fa fa fa fd fd fd fd fa fa
0x0c067fffcf40: fd fd fd fa fa fa fd fd fd fa fa fa fd fd fd fa
0x0c067fffcf50: fa fa fd fd fd fa fa fa 00 00 00 00 fa fa fd fd
0x0c067fffcf60: fd fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fffcf70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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
==5192==ABORTING
Clang on Debian Stable with address sanitizer
[ RUN ] rest_server_test.basic_test
Cores = 2
Using 1 threads
Port = 45721
=================================================================
==4930==ERROR: AddressSanitizer: attempting double-free on 0x606000006260 in thread T2:
#0 0x4846ad in operator delete(void*) (/__w/pistache/pistache/build/tests/run_rest_server_test+0x4846ad)
#1 0x500a94 in __gnu_cxx::new_allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >::deallocate(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ext/new_allocator.h:133:2
#2 0x50087c in std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::deallocate(std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >&, std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:492:13
#3 0x500231 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_node_ptr(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable_policy.h:2064:7
#4 0x4fff45 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable_policy.h:2054:7
#5 0x4ffc4a in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable_policy.h:2075:4
#6 0x7f0e779ed913 in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_move_assign(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >&&, std::integral_constant<bool, true>) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable.h:1219:13
#7 0x7f0e779ed734 in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::operator=(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable.h:519:2
#8 0x7f0e779ed58b in std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >::operator=(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unordered_map.h:275:42
#9 0x7f0e779ec97b in Pistache::Http::Header::Collection::operator=(Pistache::Http::Header::Collection&&) /__w/pistache/pistache/build/../include/pistache/http_headers.h:51:11
#10 0x7f0e779d681d in Pistache::Http::Message::operator=(Pistache::Http::Message&&) /__w/pistache/pistache/build/../include/pistache/http.h:100:57
#11 0x7f0e779dd5dc in Pistache::Http::Request::operator=(Pistache::Http::Request&&) /__w/pistache/pistache/build/../include/pistache/http.h:188:57
#12 0x7f0e7799a3b6 in Pistache::Http::Private::ParserImpl<Pistache::Http::Request>::reset() /__w/pistache/pistache/build/../src/common/http.cc:1063:17
#13 0x7f0e7799cd2f in Pistache::Http::Handler::onInput(char const*, unsigned long, std::shared_ptr<Pistache::Tcp::Peer> const&) /__w/pistache/pistache/build/../src/common/http.cc:1115:25
#14 0x7f0e77ca55c6 in Pistache::Tcp::Transport::handleIncoming(std::shared_ptr<Pistache::Tcp::Peer> const&) /__w/pistache/pistache/build/../src/common/transport.cc:195:27
#15 0x7f0e77ca2046 in Pistache::Tcp::Transport::onReady(Pistache::Aio::FdSet const&) /__w/pistache/pistache/build/../src/common/transport.cc:103:21
#16 0x7f0e77d2ac1b in Pistache::Http::TransportImpl::onReady(Pistache::Aio::FdSet const&) /__w/pistache/pistache/build/../src/server/endpoint.cc:97:15
#17 0x7f0e77c48460 in Pistache::Aio::SyncImpl::handleFds(std::vector<Pistache::Polling::Event, std::allocator<Pistache::Polling::Event> >) const /__w/pistache/pistache/build/../src/common/reactor.cc:205:34
#18 0x7f0e77c3f4d6 in Pistache::Aio::SyncImpl::runOnce() /__w/pistache/pistache/build/../src/common/reactor.cc:165:21
#19 0x7f0e77c3fb0b in Pistache::Aio::SyncImpl::run() /__w/pistache/pistache/build/../src/common/reactor.cc:177:17
#20 0x7f0e77c76156 in Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()::operator()() const /__w/pistache/pistache/build/../src/common/reactor.cc:515:27
#21 0x7f0e77c75e01 in void std::__invoke_impl<void, Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()>(std::__invoke_other, Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:60:14
#22 0x7f0e77c75c01 in std::__invoke_result<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()>::type std::__invoke<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()>(Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:95:14
#23 0x7f0e77c75b59 in void std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:264:13
#24 0x7f0e77c75aa9 in std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:271:11
#25 0x7f0e77c75870 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:215:13
#26 0x7f0e77260ecf (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xceecf)
#27 0x7f0e77034ea6 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8ea6)
#28 0x7f0e76f37dee in clone (/lib/x86_64-linux-gnu/libc.so.6+0xfddee)
0x606000006260 is located 0 bytes inside of 64-byte region [0x606000006260,0x6060000062a0)
freed by thread T3 here:
#0 0x4846ad in operator delete(void*) (/__w/pistache/pistache/build/tests/run_rest_server_test+0x4846ad)
#1 0x500a94 in __gnu_cxx::new_allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >::deallocate(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ext/new_allocator.h:133:2
#2 0x50087c in std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::deallocate(std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >&, std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:492:13
#3 0x500231 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_node_ptr(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable_policy.h:2064:7
#4 0x4fff45 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable_policy.h:2054:7
#5 0x4ffc4a in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable_policy.h:2075:4
#6 0x7f0e779ed913 in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_move_assign(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >&&, std::integral_constant<bool, true>) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable.h:1219:13
#7 0x7f0e779ed734 in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::operator=(std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable.h:519:2
#8 0x7f0e779ed58b in std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >::operator=(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unordered_map.h:275:42
#9 0x7f0e779ec97b in Pistache::Http::Header::Collection::operator=(Pistache::Http::Header::Collection&&) /__w/pistache/pistache/build/../include/pistache/http_headers.h:51:11
#10 0x7f0e779d681d in Pistache::Http::Message::operator=(Pistache::Http::Message&&) /__w/pistache/pistache/build/../include/pistache/http.h:100:57
#11 0x7f0e779dd5dc in Pistache::Http::Request::operator=(Pistache::Http::Request&&) /__w/pistache/pistache/build/../include/pistache/http.h:188:57
#12 0x7f0e7799a3b6 in Pistache::Http::Private::ParserImpl<Pistache::Http::Request>::reset() /__w/pistache/pistache/build/../src/common/http.cc:1063:17
#13 0x7f0e779910ce in Pistache::Http::ResponseWriter::sendImpl(Pistache::Http::Code, char const*, unsigned long, Pistache::Http::Mime::MediaType const&) /__w/pistache/pistache/build/../src/common/http.cc:835:48
#14 0x508c6f in Pistache::Async::Promise<long> Pistache::Http::ResponseWriter::send<2ul>(Pistache::Http::Code, char const (&) [2ul], Pistache::Http::Mime::MediaType const&) /__w/pistache/pistache/build/../include/pistache/http.h:429:24
#15 0x50891a in StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter)::operator()(Pistache::Http::ResponseWriter) const /__w/pistache/pistache/build/../tests/rest_server_test.cc:68:54
#16 0x5084fd in void std::__invoke_impl<void, StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter>(std::__invoke_other, StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter)&&, Pistache::Http::ResponseWriter&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:60:14
#17 0x508111 in std::__invoke_result<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter>::type std::__invoke<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter>(StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter)&&, Pistache::Http::ResponseWriter&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:95:14
#18 0x50804c in void std::thread::_Invoker<std::tuple<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:264:13
#19 0x507f7c in std::thread::_Invoker<std::tuple<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:271:11
#20 0x507753 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::'lambda'(Pistache::Http::ResponseWriter), Pistache::Http::ResponseWriter> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:215:13
#21 0x7f0e77260ecf (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xceecf)
previously allocated by thread T2 here:
#0 0x483e4d in operator new(unsigned long) (/__w/pistache/pistache/build/tests/run_rest_server_test+0x483e4d)
#1 0x7f0e779f65cf in __gnu_cxx::new_allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >::allocate(unsigned long, void const*) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ext/new_allocator.h:115:27
#2 0x7f0e779f622f in std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::allocate(std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> >&, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:460:20
#3 0x7f0e77bc779a in std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true>* std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >::_M_allocate_node<std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> > >(std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable_policy.h:2032:16
#4 0x7f0e77bc6461 in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_Scoped_node::_Scoped_node<std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> > >(std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, true> > >*, std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable.h:272:19
#5 0x7f0e77bc52b0 in std::pair<std::__detail::_Node_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, false, true>, bool> std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_emplace<std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> > >(std::integral_constant<bool, true>, std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable.h:1673:15
#6 0x7f0e77bc4eb5 in std::pair<std::__detail::_Node_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, false, true>, bool> std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > >, std::__detail::_Select1st, Pistache::Http::Header::LowercaseEqual, Pistache::Http::Header::LowercaseHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::emplace<std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> > >(std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable.h:788:11
#7 0x7f0e77b8b54e in std::enable_if<is_constructible<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> >&&>::value, std::pair<std::__detail::_Node_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> >, false, true>, bool> >::type std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<Pistache::Http::Header::Header>, Pistache::Http::Header::LowercaseHash, Pistache::Http::Header::LowercaseEqual, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<Pistache::Http::Header::Header> > > >::insert<std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> > >(std::pair<char const*, std::shared_ptr<Pistache::Http::Header::Header> >&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unordered_map.h:592:23
#8 0x7f0e77b789b5 in Pistache::Http::Header::Collection::add(std::shared_ptr<Pistache::Http::Header::Header> const&) /__w/pistache/pistache/build/../src/common/http_headers.cc:112:17
#9 0x7f0e77979c16 in Pistache::Http::Private::HeadersStep::apply(Pistache::StreamCursor&) /__w/pistache/pistache/build/../src/common/http.cc:362:39
#10 0x7f0e7797f742 in Pistache::Http::Private::ParserBase::parse() /__w/pistache/pistache/build/../src/common/http.cc:544:36
#11 0x7f0e7799bc0d in Pistache::Http::Handler::onInput(char const*, unsigned long, std::shared_ptr<Pistache::Tcp::Peer> const&) /__w/pistache/pistache/build/../src/common/http.cc:1090:34
#12 0x7f0e77ca55c6 in Pistache::Tcp::Transport::handleIncoming(std::shared_ptr<Pistache::Tcp::Peer> const&) /__w/pistache/pistache/build/../src/common/transport.cc:195:27
#13 0x7f0e77ca2046 in Pistache::Tcp::Transport::onReady(Pistache::Aio::FdSet const&) /__w/pistache/pistache/build/../src/common/transport.cc:103:21
#14 0x7f0e77d2ac1b in Pistache::Http::TransportImpl::onReady(Pistache::Aio::FdSet const&) /__w/pistache/pistache/build/../src/server/endpoint.cc:97:15
#15 0x7f0e77c48460 in Pistache::Aio::SyncImpl::handleFds(std::vector<Pistache::Polling::Event, std::allocator<Pistache::Polling::Event> >) const /__w/pistache/pistache/build/../src/common/reactor.cc:205:34
#16 0x7f0e77c3f4d6 in Pistache::Aio::SyncImpl::runOnce() /__w/pistache/pistache/build/../src/common/reactor.cc:165:21
#17 0x7f0e77c3fb0b in Pistache::Aio::SyncImpl::run() /__w/pistache/pistache/build/../src/common/reactor.cc:177:17
#18 0x7f0e77c76156 in Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()::operator()() const /__w/pistache/pistache/build/../src/common/reactor.cc:515:27
#19 0x7f0e77c75e01 in void std::__invoke_impl<void, Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()>(std::__invoke_other, Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:60:14
#20 0x7f0e77c75c01 in std::__invoke_result<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()>::type std::__invoke<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()>(Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:95:14
#21 0x7f0e77c75b59 in void std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:264:13
#22 0x7f0e77c75aa9 in std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:271:11
#23 0x7f0e77c75870 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:215:13
#24 0x7f0e77260ecf (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xceecf)
Thread T2 created by T1 here:
#0 0x43ebba in pthread_create (/__w/pistache/pistache/build/tests/run_rest_server_test+0x43ebba)
#1 0x7f0e77261144 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xcf144)
#2 0x7f0e77c744f3 in Pistache::Aio::AsyncImpl::Worker::run() /__w/pistache/pistache/build/../src/common/reactor.cc:509:26
#3 0x7f0e77c66d9b in Pistache::Aio::AsyncImpl::run() /__w/pistache/pistache/build/../src/common/reactor.cc:450:22
#4 0x7f0e77c30fd3 in Pistache::Aio::Reactor::run() /__w/pistache/pistache/build/../src/common/reactor.cc:613:35
#5 0x7f0e77d5d555 in Pistache::Tcp::Listener::run() /__w/pistache/pistache/build/../src/server/listener.cc:344:18
#6 0x7f0e77d671f7 in Pistache::Tcp::Listener::runThreaded()::$_0::operator()() const /__w/pistache/pistache/build/../src/server/listener.cc:387:50
#7 0x7f0e77d67121 in void std::__invoke_impl<void, Pistache::Tcp::Listener::runThreaded()::$_0>(std::__invoke_other, Pistache::Tcp::Listener::runThreaded()::$_0&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:60:14
#8 0x7f0e77d66f21 in std::__invoke_result<Pistache::Tcp::Listener::runThreaded()::$_0>::type std::__invoke<Pistache::Tcp::Listener::runThreaded()::$_0>(Pistache::Tcp::Listener::runThreaded()::$_0&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:95:14
#9 0x7f0e77d66e79 in void std::thread::_Invoker<std::tuple<Pistache::Tcp::Listener::runThreaded()::$_0> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:264:13
#10 0x7f0e77d66dc9 in std::thread::_Invoker<std::tuple<Pistache::Tcp::Listener::runThreaded()::$_0> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:271:11
#11 0x7f0e77d66b90 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<Pistache::Tcp::Listener::runThreaded()::$_0> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:215:13
#12 0x7f0e77260ecf (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xceecf)
Thread T1 created by T0 here:
#0 0x43ebba in pthread_create (/__w/pistache/pistache/build/tests/run_rest_server_test+0x43ebba)
#1 0x7f0e77261144 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xcf144)
#2 0x7f0e77d616c1 in Pistache::Tcp::Listener::runThreaded() /__w/pistache/pistache/build/../src/server/listener.cc:387:24
#3 0x7f0e77d46ce5 in void Pistache::Http::Endpoint::serveImpl<void (Pistache::Tcp::Listener::*)()>(void (Pistache::Tcp::Listener::*)()) /__w/pistache/pistache/build/../include/pistache/endpoint.h:205:13
#4 0x7f0e77d323bf in Pistache::Http::Endpoint::serveThreaded() /__w/pistache/pistache/build/../src/server/endpoint.cc:287:38
#5 0x4e5ed5 in StatsEndpoint::start() /__w/pistache/pistache/build/../tests/rest_server_test.cc:42:23
#6 0x486f54 in rest_server_test_basic_test_Test::TestBody() /__w/pistache/pistache/build/../tests/rest_server_test.cc:92:11
#7 0x9d2718 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/src/gtest.cc:2607:10
#8 0x935e6d in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/src/gtest.cc:2643:14
#9 0x80e4af in testing::Test::Run() /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/src/gtest.cc:2682:5
#10 0x813e59 in testing::TestInfo::Run() /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/src/gtest.cc:2861:11
#11 0x816ef7 in testing::TestSuite::Run() /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/src/gtest.cc:3015:28
#12 0x87e4b2 in testing::internal::UnitTestImpl::RunAllTests() /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/src/gtest.cc:5855:44
#13 0x9e47f8 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/src/gtest.cc:2607:10
#14 0x945a5d in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/src/gtest.cc:2643:14
#15 0x87c7b1 in testing::UnitTest::Run() /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/src/gtest.cc:5438:10
#16 0xa04b24 in RUN_ALL_TESTS() /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/include/gtest/gtest.h:2490:46
#17 0xa0475c in main /__w/pistache/pistache/build/../subprojects/googletest-release-1.11.0/googletest/src/gtest_main.cc:52:10
#18 0x7f0e76e60d09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26d09)
Thread T3 created by T2 here:
#0 0x43ebba in pthread_create (/__w/pistache/pistache/build/tests/run_rest_server_test+0x43ebba)
#1 0x7f0e77261144 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xcf144)
#2 0x4f8ea1 in StatsEndpoint::doAuth(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter) /__w/pistache/pistache/build/../tests/rest_server_test.cc:67:21
#3 0x4fb3dc in std::function<Pistache::Rest::Route::Result (Pistache::Rest::Request, Pistache::Http::ResponseWriter)> Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::'lambda'(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)::operator()(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter) const /__w/pistache/pistache/build/../include/pistache/router.h:413:17
#4 0x4fad12 in void std::__invoke_impl<Pistache::Rest::Route::Result, std::function<Pistache::Rest::Route::Result (Pistache::Rest::Request, Pistache::Http::ResponseWriter)> Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::'lambda'(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)&, Pistache::Rest::Request, Pistache::Http::ResponseWriter>(std::__invoke_other, StatsEndpoint&&, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:60:14
#5 0x4fa8be in std::enable_if<is_invocable_r_v<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter>, void>::type std::__invoke_r<Pistache::Rest::Route::Result, std::function<Pistache::Rest::Route::Result (Pistache::Rest::Request, Pistache::Http::ResponseWriter)> Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::'lambda'(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)&, Pistache::Rest::Request, Pistache::Http::ResponseWriter>(StatsEndpoint&&, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:113:9
#6 0x4fa25e in std::_Function_handler<Pistache::Rest::Route::Result (Pistache::Rest::Request, Pistache::Http::ResponseWriter), std::function<Pistache::Rest::Route::Result (Pistache::Rest::Request, Pistache::Http::ResponseWriter)> Pistache::Rest::Routes::bind<void, StatsEndpoint, Pistache::Rest::Request const&, Pistache::Http::ResponseWriter, StatsEndpoint*>(void (StatsEndpoint::*)(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter), StatsEndpoint*)::'lambda'(Pistache::Rest::Request const&, Pistache::Http::ResponseWriter)>::_M_invoke(std::_Any_data const&, Pistache::Rest::Request&&, Pistache::Http::ResponseWriter&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/std_function.h:291:9
#7 0x7f0e77e1ca85 in std::function<Pistache::Rest::Route::Result (Pistache::Rest::Request, Pistache::Http::ResponseWriter)>::operator()(Pistache::Rest::Request, Pistache::Http::ResponseWriter) const /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/std_function.h:622:14
#8 0x7f0e77e1dea0 in void Pistache::Rest::Route::invokeHandler<Pistache::Rest::Request, Pistache::Http::ResponseWriter>(Pistache::Rest::Request&&, Pistache::Http::ResponseWriter&&) const /__w/pistache/pistache/build/../include/pistache/router.h:99:13
#9 0x7f0e77dddd3c in Pistache::Rest::Router::route(Pistache::Http::Request const&, Pistache::Http::ResponseWriter) /__w/pistache/pistache/build/../src/server/router.cc:517:20
#10 0x7f0e77ddc388 in Pistache::Rest::Private::RouterHandler::onRequest(Pistache::Http::Request const&, Pistache::Http::ResponseWriter) /__w/pistache/pistache/build/../src/server/router.cc:367:21
#11 0x7f0e7799cc27 in Pistache::Http::Handler::onInput(char const*, unsigned long, std::shared_ptr<Pistache::Tcp::Peer> const&) /__w/pistache/pistache/build/../src/common/http.cc:1114:17
#12 0x7f0e77ca55c6 in Pistache::Tcp::Transport::handleIncoming(std::shared_ptr<Pistache::Tcp::Peer> const&) /__w/pistache/pistache/build/../src/common/transport.cc:195:27
#13 0x7f0e77ca2046 in Pistache::Tcp::Transport::onReady(Pistache::Aio::FdSet const&) /__w/pistache/pistache/build/../src/common/transport.cc:103:21
#14 0x7f0e77d2ac1b in Pistache::Http::TransportImpl::onReady(Pistache::Aio::FdSet const&) /__w/pistache/pistache/build/../src/server/endpoint.cc:97:15
#15 0x7f0e77c48460 in Pistache::Aio::SyncImpl::handleFds(std::vector<Pistache::Polling::Event, std::allocator<Pistache::Polling::Event> >) const /__w/pistache/pistache/build/../src/common/reactor.cc:205:34
#16 0x7f0e77c3f4d6 in Pistache::Aio::SyncImpl::runOnce() /__w/pistache/pistache/build/../src/common/reactor.cc:165:21
#17 0x7f0e77c3fb0b in Pistache::Aio::SyncImpl::run() /__w/pistache/pistache/build/../src/common/reactor.cc:177:17
#18 0x7f0e77c76156 in Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()::operator()() const /__w/pistache/pistache/build/../src/common/reactor.cc:515:27
#19 0x7f0e77c75e01 in void std::__invoke_impl<void, Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()>(std::__invoke_other, Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:60:14
#20 0x7f0e77c75c01 in std::__invoke_result<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()>::type std::__invoke<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()>(Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:95:14
#21 0x7f0e77c75b59 in void std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:264:13
#22 0x7f0e77c75aa9 in std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:271:11
#23 0x7f0e77c75870 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<Pistache::Aio::AsyncImpl::Worker::run()::'lambda'()> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:215:13
#24 0x7f0e77260ecf (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xceecf)
SUMMARY: AddressSanitizer: double-free (/__w/pistache/pistache/build/tests/run_rest_server_test+0x4846ad) in operator delete(void*)
==4930==ABORTING
I'm really happy to see how effective it is to run the same tests under different platforms on different compiler versions and different sanitizers :D
For example, look how the same compiler version on the same OS family behaves differently on two different OS releases; both RHEL 8 and RHEL 9 ship LLVM 13, but Clang only detects issues on RHEL 9. Fascinating.
Less happy about the fact that this PR has issues, but they can be fixed :)
Nice job @Tachi107. Thanks to your efforts at ensuring our CI infrastructure works properly, we can now all see that it does! Obviously this isn't a solution to the failures, but at least now we know that there may be problems with his PR.
@zydxhs, you might want to play with Valgrind locally. It's a very helpful tool. I suggest starting by trying to reproduce the problem.
@kiplingw @Tachi107 I can't reproduce it.
It is possible that Http::Header::Collection does not define the movement constructor and the movement assignment function caused the problem, but I couldn't verify it. so can you verify it?
I can't reproduce it.
What compiler and flags did you use?
@Tachi107 I got it. I'm not add this param to meson -Db_coverage=true -Db_lundef=false -Db_sanitize=address
Merging #1095 (9809038) into master (dc04fdc) will decrease coverage by
0.00%
. The diff coverage is96.72%
.
@@ Coverage Diff @@
## master #1095 +/- ##
==========================================
- Coverage 78.32% 78.32% -0.01%
==========================================
Files 53 53
Lines 6657 6707 +50
==========================================
+ Hits 5214 5253 +39
- Misses 1443 1454 +11
Impacted Files | Coverage Δ | |
---|---|---|
include/pistache/listener.h | 0.00% <ø> (ø) |
|
include/pistache/transport.h | 53.75% <ø> (-6.25%) |
:arrow_down: |
src/server/endpoint.cc | 83.33% <93.75%> (+1.71%) |
:arrow_up: |
include/pistache/endpoint.h | 95.65% <100.00%> (+0.65%) |
:arrow_up: |
src/common/http.cc | 74.65% <100.00%> (+0.19%) |
:arrow_up: |
src/common/peer.cc | 77.02% <100.00%> (-0.44%) |
:arrow_down: |
src/common/transport.cc | 67.94% <100.00%> (-0.70%) |
:arrow_down: |
src/server/listener.cc | 69.87% <100.00%> (+1.31%) |
:arrow_up: |
... and 4 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
LGTM. @Tachi107?
I'll review the changes later today, but as CI is passing I believe this is mergeable
Ok, feel free to merge after you've had a look through his changes. I'm fine with them.
Good eye @Tachi107.
@Tachi107 I have updated it according to your suggestion.
Thanks @zydxhs!
Thanks for the patch, @zydxhs :)
This is a follow up to #1061, add feature keepalive, and fix the issue #1030.