Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateNewUDCClientState is not safe to call more than once in a row #8564

Open
bzbarsky-apple opened this issue Jul 22, 2021 · 5 comments
Open
Assignees
Labels

Comments

@bzbarsky-apple
Copy link
Contributor

bzbarsky-apple commented Jul 22, 2021

Problem

Consider the following order of events:

  1. CreateNewUDCClientState is called.
  2. Some time passes (e.g. thread lost timeslice)
  3. CreateNewUDCClientState is called again and returns the same pointer because the time passed was enough for the state we got to not be considered initialized anymore.
  4. Consumer now tries to do something with the state from step 1.

This never happens in our code right now (as long as all access to the UDC client states is on a single thread) because we never store the pointers CreateNewUDCClientState returns across another call to CreateNewUDCClientState. But this seems pretty fragile.

Proposed Solution

Figure out a safer API.

@chrisdecenzo
Copy link
Contributor

Fixed in 8084, assigning to Boris to close

@stale
Copy link

stale bot commented Aug 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issue or PR label Aug 12, 2022
@bzbarsky-apple bzbarsky-apple removed the stale Stale issue or PR label Aug 26, 2022
@stale
Copy link

stale bot commented Mar 11, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issue or PR label Mar 11, 2023
@bzbarsky-apple
Copy link
Contributor Author

And just to be clear, @chrisdecenzo this was not addressed in #8084

@stale stale bot removed the stale Stale issue or PR label Mar 13, 2023
@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

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

No branches or pull requests

4 participants