Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7611: segfault in epoll_reactor.ipp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-01-30 15:59:42
#7611: segfault in epoll_reactor.ipp
-------------------------------------------------+-------------------------
Reporter: Fredrik Jansson | Owner:
<fredrik.jansson.se@â¦> | chris_kohlhoff
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: asio
Version: Boost 1.52.0 | Severity: Problem
Resolution: invalid | Keywords:
-------------------------------------------------+-------------------------
Comment (by anonymous):
Replying to [comment:4 jyu@â¦]:
> In my case, the crash is due to two threads simultaneously closing the
socket. can you make the socket close or shutdown function thread-safe,
just as Fredrik Jansson suggested?
You have a threading issue that's even worse than that of the original
poster. And it's your all your own fault.
Here's how you can solve it: Use a mutex, such that you do NOT have 2
threads messing with the socket at the same time. (Within the protected
region, you could find out if the socket-descriptor is already closed, by
using something like descriptor.is_open() , see
http://www.boost.org/doc/libs/1_63_0/doc/html/boost_asio/reference.html#boost_asio.reference.posix__basic_descriptor.is_open
)
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7611#comment:5> 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 : 2017-02-16 18:50:20 UTC