While fixing the last issues from #156 for ns-3 to support cppyy>=3, I hit a new issue and it is quite tricky to figure out why it happens.
I am getting unaligned fast bin chunk detected, even though sanitizers report no issue whatsoever with our code. Seems to be cppyy handling. And since the simulation runs and generates the proper output, I guess the issue is on teardown. I'd appreciate any tips on how to diagnose and fix this.
program + ASAN,LSAN,UBSAN output
```
$ LD_PRELOAD=`gcc --print-file-name=libasan.so` PYTHONPATH=./build/bindings/python python3 ./examples/tutorial/first.py
At time +2s client sent 1024 bytes to 10.1.1.2 port 9
At time +2.00369s server received 1024 bytes from 10.1.1.1 port 49153
At time +2.00369s server sent 1024 bytes to 10.1.1.1 port 49153
At time +2.00737s client received 1024 bytes from 10.1.1.2 port 9
=================================================================
==277772==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 263568 byte(s) in 136 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537cc6892 in PyObject_Malloc (/usr/bin/python3.10+0x11b892)
Direct leak of 86528 byte(s) in 832 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa51e82 in mp_new src/CPPOverload.cxx:852
Direct leak of 4656 byte(s) in 8 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537cc7587 in _PyObject_GC_NewVar (/usr/bin/python3.10+0x11c587)
Direct leak of 4592 byte(s) in 32 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x7f7c8ee3cd50 in clang::Parser::AnnotateTemplateIdToken(clang::OpaquePtr, clang::TemplateNameKind, clang::CXXScopeSpec&, clang::SourceLocation, clang::UnqualifiedId&, bool, bool) (/home/gabriel/.local/lib/python3.10/site-packages/cppyy_backend/lib/libCling.so+0x14edd50)
Direct leak of 4323 byte(s) in 7 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537cc8158 (/usr/bin/python3.10+0x11d158)
Direct leak of 2205 byte(s) in 5 object(s) allocated from:
#0 0x7f7c97d44c38 in __interceptor_realloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:164
#1 0x55b537d386b4 in _PyBytes_Resize (/usr/bin/python3.10+0x18d6b4)
Direct leak of 1888 byte(s) in 2 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537cd2b30 in PyType_GenericAlloc (/usr/bin/python3.10+0x127b30)
Direct leak of 1768 byte(s) in 13 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aabd879 in __gnu_cxx::new_allocator, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aabd879 in std::allocator, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aabd879 in std::allocator_traits, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aabd879 in std::__allocated_ptr
, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded, (__gnu_cxx::_Lock_policy)2> > >(std::allocator, (__gnu_cxx::_Lock_policy)2> >&) /usr/include/c++/11/bits/allocated_ptr.h:98
#5 0x7f7c8aabd879 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count>(CPyCppyy::TemplateInfo*&, std::_Sp_alloc_shared_tag >) /usr/include/c++/11/bits/shared_ptr_base.h:648
#6 0x7f7c8aabd879 in std::__shared_ptr::__shared_ptr>(std::_Sp_alloc_shared_tag >) /usr/include/c++/11/bits/shared_ptr_base.h:1342
#7 0x7f7c8aabd879 in std::shared_ptr::shared_ptr>(std::_Sp_alloc_shared_tag >) /usr/include/c++/11/bits/shared_ptr.h:409
#8 0x7f7c8aabd879 in std::shared_ptr std::allocate_shared>(std::allocator const&) /usr/include/c++/11/bits/shared_ptr.h:863
#9 0x7f7c8aabd879 in std::shared_ptr std::make_shared() /usr/include/c++/11/bits/shared_ptr.h:879
#10 0x7f7c8aabd879 in tpp_new src/TemplateProxy.cxx:329
Direct leak of 1728 byte(s) in 3 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537ce2ec6 in PyDict_Copy (/usr/bin/python3.10+0x137ec6)
Direct leak of 807 byte(s) in 23 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8d92701c in void std::__cxx11::basic_string, std::allocator >::_M_construct(char const*, char const*, std::forward_iterator_tag) /usr/include/c++/11/bits/basic_string.tcc:219
#2 0x7f7c8d92701c in std::__cxx11::basic_string, std::allocator >::basic_string >(char const*, std::allocator const&) /usr/include/c++/11/bits/basic_string.h:539
Direct leak of 733 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537ce5a17 (/usr/bin/python3.10+0x13aa17)
Direct leak of 664 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d44c38 in __interceptor_realloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:164
#1 0x55b537de7fcc in _PyObject_GC_Resize (/usr/bin/python3.10+0x23cfcc)
Direct leak of 547 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537ce54d6 in PyBytes_FromStringAndSize (/usr/bin/python3.10+0x13a4d6)
Direct leak of 536 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537cc696d (/usr/bin/python3.10+0x11b96d)
Direct leak of 147 byte(s) in 7 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8d933666 in void std::__cxx11::basic_string, std::allocator >::_M_construct(char*, char*, std::forward_iterator_tag) /usr/include/c++/11/bits/basic_string.tcc:219
#2 0x7f7c8d933666 in void std::__cxx11::basic_string, std::allocator >::_M_construct_aux(char*, char*, std::__false_type) /usr/include/c++/11/bits/basic_string.h:255
#3 0x7f7c8d933666 in void std::__cxx11::basic_string, std::allocator >::_M_construct(char*, char*) /usr/include/c++/11/bits/basic_string.h:274
#4 0x7f7c8d933666 in std::__cxx11::basic_string, std::allocator >::basic_string(std::__cxx11::basic_string, std::allocator > const&) /usr/include/c++/11/bits/basic_string.h:459
#5 0x7f7c8d933666 in Cppyy::ResolveEnum(std::__cxx11::basic_string, std::allocator > const&) src/clingwrapper.cxx:546
Direct leak of 62 byte(s) in 2 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8d93898d in std::__cxx11::basic_string, std::allocator >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) /usr/include/c++/11/bits/basic_string.tcc:307
Direct leak of 48 byte(s) in 2 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa6c150 in selectInstanceCnv src/Converters.cxx:3002
Indirect leak of 102760 byte(s) in 105 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537cd2b30 in PyType_GenericAlloc (/usr/bin/python3.10+0x127b30)
Indirect leak of 55944 byte(s) in 777 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aaabdb9 in BuildScopeProxyDict src/ProxyWrappers.cxx:254
Indirect leak of 8208 byte(s) in 778 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aaaf9f2 in __gnu_cxx::new_allocator::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aaaf9f2 in std::allocator::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aaaf9f2 in std::allocator_traits >::allocate(std::allocator&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aaaf9f2 in std::_Vector_base >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:346
#5 0x7f7c8aaaf9f2 in std::_Vector_base >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:343
#6 0x7f7c8aaaf9f2 in void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, CPyCppyy::PyCallable* const&) /usr/include/c++/11/bits/vector.tcc:440
Indirect leak of 7819 byte(s) in 252 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa54dcb in std::__cxx11::basic_string, std::allocator >::_M_assign(std::__cxx11::basic_string, std::allocator > const&) /usr/include/c++/11/bits/basic_string.tcc:265
Indirect leak of 6984 byte(s) in 97 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aaac54c in BuildScopeProxyDict src/ProxyWrappers.cxx:248
Indirect leak of 6900 byte(s) in 6 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537cc8158 (/usr/bin/python3.10+0x11d158)
Indirect leak of 6048 byte(s) in 84 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aaabbf1 in BuildScopeProxyDict src/ProxyWrappers.cxx:238
Indirect leak of 3312 byte(s) in 828 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa51ee2 in CPyCppyy::CPPOverload::MethodInfo_t::MethodInfo_t() src/CPPOverload.h:44
#2 0x7f7c8aa51ee2 in mp_new src/CPPOverload.cxx:852
Indirect leak of 1728 byte(s) in 36 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa59382 in pt_new src/CPPScope.cxx:281
Indirect leak of 1537 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537ce5a17 (/usr/bin/python3.10+0x13aa17)
Indirect leak of 1512 byte(s) in 21 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aaabf2f in BuildScopeProxyDict src/ProxyWrappers.cxx:250
Indirect leak of 1489 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537cfdc8a (/usr/bin/python3.10+0x152c8a)
Indirect leak of 1160 byte(s) in 2 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537cc696d (/usr/bin/python3.10+0x11b96d)
Indirect leak of 864 byte(s) in 12 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa5890f in meta_getattro src/CPPScope.cxx:372
Indirect leak of 520 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55b537cc7587 in _PyObject_GC_NewVar (/usr/bin/python3.10+0x11c587)
Indirect leak of 488 byte(s) in 49 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa4fcfa in __gnu_cxx::new_allocator::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aa4fcfa in std::allocator::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aa4fcfa in std::allocator_traits >::allocate(std::allocator&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aa4fcfa in std::_Vector_base >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:346
#5 0x7f7c8aa4fcfa in std::_Vector_base >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:343
#6 0x7f7c8aa4fcfa in std::vector >::_M_default_append(unsigned long) /usr/include/c++/11/bits/vector.tcc:635
Indirect leak of 384 byte(s) in 8 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa5f051 in operator() src/Converters.cxx:3384
#2 0x7f7c8aa5f051 in _FUN src/Converters.cxx:3384
Indirect leak of 336 byte(s) in 6 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa6dbed in operator() src/Converters.cxx:3404
#2 0x7f7c8aa6dbed in _FUN src/Converters.cxx:3404
#3 0x35c3f00f7780c9ff ()
Indirect leak of 336 byte(s) in 14 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa6c129 in selectInstanceCnv src/Converters.cxx:3005
Indirect leak of 288 byte(s) in 4 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aaabe49 in BuildScopeProxyDict src/ProxyWrappers.cxx:322
Indirect leak of 272 byte(s) in 16 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa54cd2 in __gnu_cxx::new_allocator >::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aa54cd2 in std::allocator >::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aa54cd2 in std::allocator_traits > >::allocate(std::allocator >&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aa54cd2 in std::_Vector_base, std::allocator > >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:346
#5 0x7f7c8aa54cd2 in std::_Vector_base, std::allocator > >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:343
#6 0x7f7c8aa54cd2 in void std::vector, std::allocator > >::_M_realloc_insert >(__gnu_cxx::__normal_iterator*
, std::vector, std::allocator > > >, std::pair&&) /usr/include/c++/11/bits/vector.tcc:440
Indirect leak of 240 byte(s) in 10 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa6c194 in selectInstanceCnv src/Converters.cxx:3011
Indirect leak of 216 byte(s) in 9 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aaa05eb in CPyCppyy::CreateExecutor(std::__cxx11::basic_string, std::allocator > const&, CPyCppyy::Dimensions const&) src/Executors.cxx:868
Indirect leak of 216 byte(s) in 9 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa6c0c9 in selectInstanceCnv src/Converters.cxx:3007
Indirect leak of 176 byte(s) in 9 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa51996 in __gnu_cxx::new_allocator::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aa51996 in std::allocator::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aa51996 in std::allocator_traits >::allocate(std::allocator&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aa51996 in std::_Vector_base >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:346
#5 0x7f7c8aa51996 in std::_Vector_base >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:343
#6 0x7f7c8aa51996 in void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, CPyCppyy::PyCallable* const&) /usr/include/c++/11/bits/vector.tcc:440
#7 0x7f7c8aa51996 in std::vector >::push_back(CPyCppyy::PyCallable* const&) /usr/include/c++/11/bits/stl_vector.h:1198
#8 0x7f7c8aa51996 in CPyCppyy::CPPOverload::AdoptMethod(CPyCppyy::PyCallable*) src/CPPOverload.cxx:1077
Indirect leak of 136 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aabd879 in __gnu_cxx::new_allocator, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aabd879 in std::allocator, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aabd879 in std::allocator_traits, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aabd879 in std::__allocated_ptr
, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded, (__gnu_cxx::_Lock_policy)2> > >(std::allocator, (__gnu_cxx::_Lock_policy)2> >&) /usr/include/c++/11/bits/allocated_ptr.h:98
#5 0x7f7c8aabd879 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count>(CPyCppyy::TemplateInfo*&, std::_Sp_alloc_shared_tag >) /usr/include/c++/11/bits/shared_ptr_base.h:648
#6 0x7f7c8aabd879 in std::__shared_ptr::__shared_ptr>(std::_Sp_alloc_shared_tag >) /usr/include/c++/11/bits/shared_ptr_base.h:1342
#7 0x7f7c8aabd879 in std::shared_ptr::shared_ptr>(std::_Sp_alloc_shared_tag >) /usr/include/c++/11/bits/shared_ptr.h:409
#8 0x7f7c8aabd879 in std::shared_ptr std::allocate_shared>(std::allocator const&) /usr/include/c++/11/bits/shared_ptr.h:863
#9 0x7f7c8aabd879 in std::shared_ptr std::make_shared() /usr/include/c++/11/bits/shared_ptr.h:879
#10 0x7f7c8aabd879 in tpp_new src/TemplateProxy.cxx:329
Indirect leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aac00ce in __gnu_cxx::new_allocator, std::allocator > const, std::vector, std::allocator > > > > >::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aac00ce in std::allocator, std::allocator > con
st, std::vector, std::allocator > > > > >::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aac00ce in std::allocator_traits, std:
:allocator > const, std::vector, std::allocator
> > > > > >::allocate(std::allocator, std::allocator > const,
std::vector, std::allocator > > > > >&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aac00ce in std::_Rb_tree, std::allocator >, std::pair, std::allocator > const, std::vector, std::allocator > > >, std::_Select1st, std::allocator >
const, std::vector, std::allocator > > > >, std::less<
std::__cxx11::basic_string, std::allocator > >, std::allocator, std::allocator > const, std::vector, std::allocator > > > > >::_M_get_node() /usr/include/c++/11/bits/stl_tree.h:561
#5 0x7f7c8aac00ce in std::_Rb_tree_node, std::allocator > const, std::vector
, std::allocator > > > >* std::_Rb_tree, std::allocator >, std::pair, std::allocator > const, std::vector, std::allocator > > >, std::_S
elect1st, std::allocator > const, std::vector, std::allocator > > > >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::vecto
r, std::allocator > > > > >::_M_create_node, std::allocator >&&>, std::tuple<> >(std::piecewise_co
nstruct_t const&, std::tuple, std::allocator >&&>&&, std::tuple<>&&) /usr/include/c++/11/bits/stl_tree.h:611
#6 0x7f7c8aac00ce in std::_Rb_tree_iterator, std::allocator > const, std::ve
ctor, std::allocator > > > > std::_Rb_tree, std::allocator >, std::pair, std::allocator<
char> > const, std::vector, std::allocator > > >, std:
:_Select1st, std::allocator > const, std::vector, std::allocator > > > >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::ve
ctor, std::allocator > > > > >::_M_emplace_hint_unique
, std::allocator >&&>, std::tuple<> >(std::_
Rb_tree_const_iterator, std::allocator > const, std::vector, std::allocator > > > >, std::piecewise_construct_t const&, std::tuple, std::allocator >&&>&&, std::tuple<>&&) /usr/include/c++/11/bits/stl_tree.h:2431
Indirect leak of 64 byte(s) in 8 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa59c92 in __gnu_cxx::new_allocator::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aa59c92 in std::allocator::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aa59c92 in std::allocator_traits >::allocate(std::allocator&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aa59c92 in std::_Vector_base >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:346
#5 0x7f7c8aa59c92 in std::_Vector_base >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:343
#6 0x7f7c8aa59c92 in void std::vector >::_M_realloc_insert(__gnu
_cxx::__normal_iterator > >, CPyCppyy::PyCallable*&&) /usr/include/c++/11/bits/vector.tcc:440
Indirect leak of 31 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aabdcfd in std::__cxx11::basic_string, std::allocator >::_M_assign(std::__cxx11::basic_string, std::allocator > const&) /usr/include/c++/11/bits/basic_string.tcc:265
#2 0x7f7c8aabdcfd in std::__cxx11::basic_string, std::allocator >::assign(std::__cxx11::basic_string, std::allocator > const&) /usr/include/c++/11/bits/basic_string.h:1387
#3 0x7f7c8aabdcfd in std::__cxx11::basic_string, std::allocator >::operator=(std::__cxx11::basic_string, std::allocator > const&) /usr/include/c++/11/bits/basic_string.h:681
#4 0x7f7c8aabdcfd in CPyCppyy::TemplateProxy::Set(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, _object*) src/TemplateProxy.cxx:773
Indirect leak of 25 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa7b452 in __gnu_cxx::new_allocator::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aa7b452 in std::allocator::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aa7b452 in std::allocator_traits >::allocate(std::allocator&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aa7b452 in std::__cxx11::basic_string, std::allocator >::_M_create(unsigned long&, unsigned long) /usr/include/c++/11/bits/basic_string.tcc:153
#5 0x7f7c8aa7b452 in void std::__cxx11::basic_string, std::allocator >::_M_construct(char const*, char const*, std::forward_iterator_tag) /usr/include/c++/11/bits/basic_string.tcc:219
#6 0x6310007b420f ()
#7 0x7f7c8aa5064f (/home/gabriel/.local/lib/python3.10/site-packages/libcppyy.cpython-310-x86_64-linux-gnu.so+0x4f64f)
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa6b844 in operator() src/Converters.cxx:3336
#2 0x7f7c8aa6b844 in _FUN src/Converters.cxx:3336
#3 0x7ffeacf2899f ([stack]+0x2b99f)
Indirect leak of 16 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aa59c92 in __gnu_cxx::new_allocator::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aa59c92 in std::allocator::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aa59c92 in std::allocator_traits >::allocate(std::allocator&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aa59c92 in std::_Vector_base >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:346
#5 0x7f7c8aa59c92 in std::_Vector_base >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:343
#6 0x7f7c8aa59c92 in void std::vector >::_M_realloc_insert(__gnu
_cxx::__normal_iterator > >, CPyCppyy::PyCallable*&&) /usr/include/c++/11/bits/vector.tcc:440
#7 0x602000367a77 ()
Indirect leak of 16 byte(s) in 1 object(s) allocated from:
#0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f7c8aac16c2 in __gnu_cxx::new_allocator >::allocate(unsigned long, void const*) /usr/include/c++/11/ext/new_allocator.h:127
#2 0x7f7c8aac16c2 in std::allocator >::allocate(unsigned long) /usr/include/c++/11/bits/allocator.h:185
#3 0x7f7c8aac16c2 in std::allocator_traits > >::allocate(std::allocator >&, unsigned long) /usr/include/c++/11/bits/alloc_traits.h:464
#4 0x7f7c8aac16c2 in std::_Vector_base, std::allocator > >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:346
#5 0x7f7c8aac16c2 in std::_Vector_base, std::allocator > >::_M_allocate(unsigned long) /usr/include/c++/11/bits/stl_vector.h:343
#6 0x7f7c8aac16c2 in void std::vector, std::allocator > >::_M_realloc_insert >(__gnu_cxx::__normal_iterator
While fixing the last issues from #156 for ns-3 to support cppyy>=3, I hit a new issue and it is quite tricky to figure out why it happens.
I am getting
unaligned fast bin chunk detected
, even though sanitizers report no issue whatsoever with our code. Seems to be cppyy handling. And since the simulation runs and generates the proper output, I guess the issue is on teardown. I'd appreciate any tips on how to diagnose and fix this.program + ASAN,LSAN,UBSAN output
``` $ LD_PRELOAD=`gcc --print-file-name=libasan.so` PYTHONPATH=./build/bindings/python python3 ./examples/tutorial/first.py At time +2s client sent 1024 bytes to 10.1.1.2 port 9 At time +2.00369s server received 1024 bytes from 10.1.1.1 port 49153 At time +2.00369s server sent 1024 bytes to 10.1.1.1 port 49153 At time +2.00737s client received 1024 bytes from 10.1.1.2 port 9 ================================================================= ==277772==ERROR: LeakSanitizer: detected memory leaks Direct leak of 263568 byte(s) in 136 object(s) allocated from: #0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55b537cc6892 in PyObject_Malloc (/usr/bin/python3.10+0x11b892) Direct leak of 86528 byte(s) in 832 object(s) allocated from: #0 0x7f7c97d461e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99 #1 0x7f7c8aa51e82 in mp_new src/CPPOverload.cxx:852 Direct leak of 4656 byte(s) in 8 object(s) allocated from: #0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55b537cc7587 in _PyObject_GC_NewVar (/usr/bin/python3.10+0x11c587) Direct leak of 4592 byte(s) in 32 object(s) allocated from: #0 0x7f7c97d44887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x7f7c8ee3cd50 in clang::Parser::AnnotateTemplateIdToken(clang::OpaquePtr