8000 Fix a race condition in object_id for shareable objects by casperisfine · Pull Request #13609 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Fix a race condition in object_id for shareable objects #13609

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

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

casperisfine
Copy link
Contributor

If an object is shareable and has no capacity left, it isn't safe to store the object ID in fields as it requires an object resize which can't be done unless all field reads are synchronized.

In this very specific case we create the object_id in advance, before the object is made shareable.

Simpler alternative to: #13305

If an object is shareable and has no capacity left, it isn't
safe to store the object ID in fields as it requires an object
resize which can't be done unless all field reads are synchronized.

In this very specific case we create the object_id in advance,
before the object is made shareable.
Copy link
Member
@tenderlove tenderlove left a comment

Choose a reason for hiding this comment

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

This seems like a good and pragmatic solution to me. Maybe we can do something different in the future, but I like this 👍

@byroot byroot merged commit e22fc73 into ruby:master Jun 13, 2025
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0