Skip to content

Memory leak #1017

@ericriff

Description

@ericriff

I ran a build with ASan enabled and got one memory leak.

=================================================================
==91297==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 224 byte(s) in 4 object(s) allocated from:
    #0 0x7b12d5259548 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    #1 0x7b12d49419cb in allocate /usr/include/c++/13/bits/new_allocator.h:151
    #2 0x7b12d49413a3 in allocate /usr/include/c++/13/bits/alloc_traits.h:482
    #3 0x7b12d49413a3 in __allocate_guarded<std::allocator<std::_Sp_counted_deleter<std::nullptr_t, BT::TreeNode::executeTick()::<lambda(...)>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2> > > /usr/include/c++/13/bits/allocated_ptr.h:98
    #4 0x7b12d49410ec in __shared_count<std::nullptr_t, BT::TreeNode::executeTick()::<lambda(...)>, std::allocator<void> > /usr/include/c++/13/bits/shared_ptr_base.h:950
    #5 0x7b12d4940f1e in __shared_count<std::nullptr_t, BT::TreeNode::executeTick()::<lambda(...)> > /usr/include/c++/13/bits/shared_ptr_base.h:939
    #6 0x7b12d4940840 in __shared_ptr<BT::TreeNode::executeTick()::<lambda(...)> > /usr/include/c++/13/bits/shared_ptr_base.h:1497
    #7 0x7b12d4940626 in shared_ptr<BT::TreeNode::executeTick()::<lambda(...)> > /usr/include/c++/13/bits/shared_ptr.h:249
    #8 0x7b12d493bd0d in BT::TreeNode::executeTick() /workspaces/BehaviorTree.CPP/src/tree_node.cpp:119
    #9 0x7b12d4738966 in BT::CoroActionNode::tickImpl() /workspaces/BehaviorTree.CPP/src/action_node.cpp:126
    #10 0x7b12d47382f1 in CoroEntry(mco_coro*) /workspaces/BehaviorTree.CPP/src/action_node.cpp:76
    #11 0x7b12d4735e84 in _mco_main /home/ubuntu/.conan2/p/minic61756b83b6aee/p/include/minicoro/minicoro.h:533
    #12 0xdeaddeaddeaddeac  (<unknown module>)

SUMMARY: AddressSanitizer: 224 byte(s) leaked in 4 allocation(s).

Can be reproduced with

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fsanitize=address")

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions