Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hwloc memory leak #3006

Closed
msimberg opened this issue Nov 15, 2017 · 3 comments
Closed

hwloc memory leak #3006

msimberg opened this issue Nov 15, 2017 · 3 comments

Comments

@msimberg
Copy link
Contributor

msimberg commented Nov 15, 2017

Address sanitizer reports the following leak related to hwloc:

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f7d4851ff70 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc6f70)
    #1 0x7f7d41f413c3 in hwloc_bitmap_alloc (/home/simbergm/packages/hwloc/1.11.8/lib/libhwloc.so.5+0x193c3)
    #2 0x7f7d458d1493 in hpx::threads::hwloc_topology_info::mask_to_bitmap(unsigned long, hwloc_obj_type_t) const /home/simbergm/src/hpx/src/runtime/threads/policies/hwloc_topology_info.cpp:1208
    #3 0x7f7d458cdf09 in hpx::threads::hwloc_topology_info::cpuset_to_nodeset(unsigned long) const /home/simbergm/src/hpx/src/runtime/threads/policies/hwloc_topology_info.cpp:757
    #4 0x7f7d45934ff2 in hpx::threads::detail::thread_pool_base::init(unsigned long, unsigned long) /home/simbergm/src/hpx/src/runtime/threads/detail/thread_pool_base.cpp:114
    #5 0x7f7d457dd34c in hpx::threads::threadmanager::init() /home/simbergm/src/hpx/src/runtime/threads/threadmanager.cpp:782
    #6 0x7f7d450c9da9 in hpx::runtime_impl::runtime_impl(hpx::util::runtime_configuration&) /home/simbergm/src/hpx/src/runtime_impl.cpp:175
    #7 0x7f7d45143180 in hpx::detail::run_or_start(hpx::util::function<int (boost::program_options::variables_map&), false> const&, boost::program_options::options_description const&, int, char**, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&&, hpx::util::unique_function<void (), false>, hpx::util::unique_function<void (), false>, hpx::runtime_mode, bool) /home/simbergm/src/hpx/src/hpx_init.cpp:647
    #8 0x4d2603 in hpx::init(hpx::util::function<int (boost::program_options::variables_map&), false> const&, boost::program_options::options_description const&, int, char**, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, hpx::util::unique_function<void (), false>, hpx::util::unique_function<void (), false>, hpx::runtime_mode) /home/simbergm/src/hpx/hpx/hpx_init_impl.hpp:76
    #9 0x4d28a1 in hpx::init(boost::program_options::options_description const&, int, char**, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, hpx::util::unique_function<void (), false>, hpx::util::unique_function<void (), false>, hpx::runtime_mode) /home/simbergm/src/hpx/hpx/hpx_init_impl.hpp:128
    #10 0x4d2bda in hpx::init(int, char**, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, hpx::runtime_mode) /home/simbergm/src/hpx/hpx/hpx_init_impl.hpp:149
    #11 0x4d1f06 in main /home/simbergm/src/hpx/hpx/hpx_main_impl.hpp:35
    #12 0x7f7d43db782f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

I intend to fix this once I have the time, but in the meantime: @biddisco do you happen to know right away where the deletes are missing?

@hkaiser
Copy link
Member

hkaiser commented Nov 15, 2017

This is related to recent changes @biddisco has applied to the code base.

@biddisco
Copy link
Contributor

the used_numa_domains_ variable is allocated and placed in a shared_ptr which is destroyed when thread_pool_base is destroyed. Breakpoints confirm for me that the destructor of hpx_hwloc_bitmap_wrapper is being called as expected. Could this be a false positive from asan? (or am I confused)

@hkaiser
Copy link
Member

hkaiser commented Nov 16, 2017

This has been fixed by merging #3011

@hkaiser hkaiser closed this as completed Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants