Re: [Boost-bugs] [Boost C++ Libraries] #13408: Boost Library Possible memory Leak

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13408: Boost Library Possible memory Leak
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-02-20 17:15:30


#13408: Boost Library Possible memory Leak
-------------------------------+---------------------
  Reporter: anonymous | Owner: viboes
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.63.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+---------------------
Changes (by viboes):

 * owner: Anthony Williams => viboes

Old description:

> Hi,
>
> We have been using Boost library in the project. I've made analysis by
> using Valgrind tool to be able to find possible memory leaks. According
> to the result, there is a memory leak in Boost library.
>
> ==7535== 24 bytes in 1 blocks are still reachable in loss record 2 of 6
> ==7535== at 0x4C2B0E0: operator new(unsigned long)
> (vg_replace_malloc.c:324)
> ==7535== by 0x4E430A3: boost::detail::make_external_thread_data()
> (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.55.0)
> ==7535== by 0x4E433DB: boost::detail::add_new_tss_node(void const*,
> boost::shared_ptr<boost::detail::tss_cleanup_function>, void*)
> (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.55.0)
> ==7535== by 0x4E4408C: boost::detail::set_tss_data(void const*,
> boost::shared_ptr<boost::detail::tss_cleanup_function>, void*, bool)
> (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.55.0)
> ==7535== by 0x54CAC0C:
> boost::log::v2_mt_posix::core::add_thread_attribute(boost::log::v2_mt_posix::attribute_name
> const&, boost::log::v2_mt_posix::attribute const&)
>

> It seems like the allocated memory is not deallocated, so it causes
> memory leak. Here is the definition of relevant event ;
>
> thread_data_base* make_external_thread_data()
> {
> thread_data_base* const
> me(detail::heap_new<externally_launched_thread>());
> me->self.reset(me);
> set_current_thread_data(me);
> return me;
> }
>

> thread_data_base* get_or_make_current_thread_data()
> {
> thread_data_base*
> current_thread_data(get_current_thread_data());
> if(!current_thread_data)
> {
> current_thread_data=make_external_thread_data();
> }
> return current_thread_data;
> }
>
> I've made some research if there is any post which states that this
> event causes memory leak, but could not find any. Is there any fix for
> the problem stated above? If there is any, could you please state the
> relevant patch ?
>
> Thanks in advance,
>
> Kind Regards

New description:

 Hi,

 We have been using Boost library in the project. I've made analysis by
 using Valgrind tool to be able to find possible memory leaks. According
 to the result, there is a memory leak in Boost library.

 {{{
 ==7535== 24 bytes in 1 blocks are still reachable in loss record 2 of 6
 ==7535== at 0x4C2B0E0: operator new(unsigned long)
 (vg_replace_malloc.c:324)
 ==7535== by 0x4E430A3: boost::detail::make_external_thread_data()
 (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.55.0)
 ==7535== by 0x4E433DB: boost::detail::add_new_tss_node(void const*,
 boost::shared_ptr<boost::detail::tss_cleanup_function>, void*)
 (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.55.0)
 ==7535== by 0x4E4408C: boost::detail::set_tss_data(void const*,
 boost::shared_ptr<boost::detail::tss_cleanup_function>, void*, bool)
 (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.55.0)
 ==7535== by 0x54CAC0C:
 boost::log::v2_mt_posix::core::add_thread_attribute(boost::log::v2_mt_posix::attribute_name
 const&, boost::log::v2_mt_posix::attribute const&)
 }}}

 It seems like the allocated memory is not deallocated, so it causes
 memory leak. Here is the definition of relevant event ;

 {{{
        thread_data_base* make_external_thread_data()
         {
             thread_data_base* const
 me(detail::heap_new<externally_launched_thread>());
             me->self.reset(me);
             set_current_thread_data(me);
             return me;
         }

         thread_data_base* get_or_make_current_thread_data()
         {
             thread_data_base*
 current_thread_data(get_current_thread_data());
             if(!current_thread_data)
             {
                 current_thread_data=make_external_thread_data();
             }
             return current_thread_data;
         }

 }}}

 I've made some research if there is any post which states that this
 event causes memory leak, but could not find any. Is there any fix for
 the problem stated above? If there is any, could you please state the
 relevant patch ?

 Thanks in advance,

 Kind Regards

--
-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13408#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2018-02-20 17:22:12 UTC