BewareMyPower opened a new pull request, #551:
URL: https://github.com/apache/pulsar-client-cpp/pull/551

   ASIO's async_connect (range_connect_op) holds a raw reference to the socket 
and calls socket.close() internally between endpoint retry attempts. If 
ClientConnection is destroyed before those internal calls complete (i.e. the 
socket_ shared_ptr drops to zero), that raw reference becomes dangling and 
causes a segfault.
   
   Fix by capturing socket_ as a shared_ptr in the async_connect completion 
handler. Since ASIO stores the completion handler as part of the operation 
object (range_connect_op), this keeps the socket alive for the entire lifetime 
of the async_connect operation, including all internal retry logic.
   
   Fixes: https://github.com/apache/pulsar-client-cpp/issues/550


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to