Skip to content

Conversation

kotlarmilos
Copy link
Member

Description

OSX SafeDeleteSslContext takes lock on different object in managed callbacks and other methods. In the callbacks, the lock is SafeDeleteSslContext, while in Dispose and other methods the lock is SafeSslHandle.

This PR adds a _lock to ensure synchronization across all methods that access shared buffers. The issue was identified while working on #117950.

@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 14:27
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a synchronization issue in the OSX SafeDeleteSslContext class where different methods were using different lock objects, potentially causing race conditions when accessing shared buffer resources. The change introduces a dedicated _lock object to ensure consistent synchronization across all methods that access the _inputBuffer and _outputBuffer fields.

Key changes:

  • Introduces a dedicated _lock object for thread synchronization
  • Replaces inconsistent lock targets (_sslContext vs SafeDeleteSslContext instance) with the new _lock object
  • Ensures all buffer access operations are properly synchronized

Copy link
Contributor

Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@ManickaP ManickaP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants