Boost C++ Libraries: Ticket #4739: A thread safe bug about epoll_reactor https://svn.boost.org/trac10/ticket/4739 <p> There is a bug epoll_reacor the version Release 1.45.0 In the file epoll_reactor.hpp, function epoll_reacor::run, line 369. </p> <blockquote> <p> void* ptr = events[i].data.ptr; ... descriptor_state* descriptor_data = static_cast&lt;descriptor_state*&gt;(ptr); mutex::scoped_lock descriptor_lock(descriptor_data-&gt;mutex_); </p> </blockquote> <p> And the file epoll_reactor.hpp, function epoll_reacor::close_descriptor, line 256. </p> <blockquote> <p> registered_descriptors_.erase(descriptor); </p> </blockquote> <blockquote> <p> The ptr ( void* ptr = events[i].data.ptr) may been free in the epoll_reacor::close_descriptor. </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4739 Trac 1.4.3 jinwei <jinwei.jpp@…> Fri, 15 Oct 2010 02:27:20 GMT <link>https://svn.boost.org/trac10/ticket/4739#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4739#comment:1</guid> <description> <p> There is a bug epoll_reacor the version Release 1.45.0 In the file epoll_reactor.hpp, function epoll_reacor::run, line 369. </p> <blockquote> <p> void* ptr = events[i].data.ptr; ... descriptor_state* descriptor_data = static_cast&lt;descriptor_state*&gt;(ptr); mutex::scoped_lock descriptor_lock(descriptor_data-&gt;mutex_); </p> </blockquote> <p> And the file epoll_reactor.hpp, function epoll_reacor::close_descriptor, line 256. </p> <blockquote> <p> registered_descriptors_.erase(descriptor); </p> </blockquote> <p> The ptr ( void* ptr = events[i].data.ptr) may been free in the epoll_reacor::close_descriptor. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Sat, 16 Oct 2010 07:47:41 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4739#comment:2 https://svn.boost.org/trac10/ticket/4739#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> I assume you mean asio 1.4.5 / boost 1.43. The line: </p> <pre class="wiki"> registered_descriptors_.erase(descriptor); </pre><p> does not free the memory. The node is placed on a free-list and is not deleted until the io_service is destroyed. </p> Ticket