Modify

Opened 8 years ago

Closed 6 years ago

#3702 closed Bugs (fixed)

asio & ssl - leaking io_handlers after boost::asio::io_service object is stopped and destroyed

Reported by: tianhao.qiu@… Owned by: chris_kohlhoff
Milestone: Boost 1.42.0 Component: asio
Version: Boost 1.41.0 Severity: Problem
Keywords: Cc:

Description

The way boost::asio::ssl::detail::openssl_stream_service is implemented requires that function handler_impl() has to be called before io_handler objects can be deleted. However when the io_service object is stopped and later destroyed, the handlers for those pending SSL operations will never be called, thus causing the leak.

Since I am binding shared_ptr<ssl_session>s into my SSL handlers, this leak will also keep alive my SSL session objects.

Attachments (1)

patch (8.5 KB) - added by tianhao.qiu@… 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by tianhao.qiu@…

comment:1 Changed 8 years ago by tianhao.qiu@…

Patch submitted.

The old design deletes the handler (io_handler/handshake_handler/shutdown_handler) and openssl_operation objects in the handler_impl() function. However pending handler_impl() functions are not invoked when the io_service object is stopped, thus causing the leak.

The patch addresses the problem by wrapping the handler and openssl_operation objects in shared_ptrs.

comment:2 Changed 6 years ago by chris_kohlhoff

  • Resolution set to fixed
  • Status changed from new to closed

As of [72428], the release branch contains the new SSL implementation that addresses this.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain chris_kohlhoff.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.