Opened 7 years ago
Last modified 6 years ago
#11823 new Bugs
Exception safety problems in the epoll based implementation of async_accept
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | To Be Determined | Component: | asio |
Version: | Boost 1.59.0 | Severity: | Problem |
Keywords: | exception safety | Cc: |
Description
The implementation of boost::asio::ip::tcp::acceptor::async_accept fails to handle memory allocation failures in certain conditions when using the epoll based reactor.
The attached program (test_program.zip) reproduces the failures. They reproduce with Boost 1.59 as well as 1.57 when run on a Linux machine (and using the epoll based implementation).
Examples of runs of the test program compiled with GCC 6.0 and Boost 1.59 can be found on the Wandbox online compiler (links in the attached wandbox.txt file).
Attached is also a patch with a tentative fix that highlights the two places that cause the test program to fail. Even though it was created against the code from Boost 1.57, it applies to the code from 1.59.
Attachments (4)
Change History (7)
by , 7 years ago
Attachment: | test_program.zip added |
---|
by , 7 years ago
Attachment: | boost_asio_epoll_accept_exception_safety.patch added |
---|
comment:1 by , 7 years ago
Component: | None → asio |
---|---|
Owner: | set to |
comment:2 by , 7 years ago
by , 7 years ago
Attachment: | wandbox.txt added |
---|
comment:3 by , 6 years ago
The test program shows an exception problem in detail/hash_map.hpp too, if run on Windows with BOOST_ASIO_DISABLE_IOCP defined. Patch showing a possible fix of the problem on top of Boost 1.60 attached.
by , 6 years ago
Attachment: | boost_asio_hash_map_exception_safety.patch added |
---|
Links to the runs on Wandbox. The runs have different starting counters to the first memory allocation failure.
melpon.org/wandbox/permlink/OOUN9sKpEsLW0dUj
melpon.org/wandbox/permlink/ZBvpHRLx5pjdEb5N
melpon.org/wandbox/permlink/uZtkMz3Nl0rG8mb1