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

kill OBJ_TAINT etc. #4100

Merged
merged 9 commits into from Jan 27, 2021
Merged

kill OBJ_TAINT etc. #4100

merged 9 commits into from Jan 27, 2021

Conversation

shyouhei
Copy link
Member

@shyouhei shyouhei commented Jan 20, 2021

Now that RUBY_FL_TAINT is recycled to become new RUBY_FL_SHAREABLE.
Setting/clearing this flag from extension libraries break Ractor. Especially problematic one is OBJ_INFECT, which would make non-shareable objects travel across Ractor boundaries.

Such operations should just be prohibited.

See also https://bugs.ruby-lang.org/issues/16131

It seems I broke them in commit 9e6e39c
Sorry!
Now that RUBY_FL_TAINT is recycled to become new RUBY_FL_SHAREABLE.
Setting/clearing this flag from extension libraries break Ractor.
Especially problematic one is OBJ_INFECT, which would make non-shareable
objects travel across Ractor boundaries.

Such operations should just be prohibited.
matz said in [ruby-core:94979]:
> 3.0:
>  * taint/trust/untaint/untrust non-verbose warning when called

This is it, for C extensions.
See also https://gcc.gnu.org/gcc-6/changes.html

Clang has this feature when __has_extension(enumerator_attributes) is
set.

MSVC has #pragma deprecated instead.
Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

This looks good to me. It does sound like the shareable flag should not be copied on dup, because duping a frozen object (sharable) should result in an unfrozen object (not sharable). However, maybe this is handled another way? Hopefully @ko1 knows.

They are no longer how Object#clone/Object#dup are defined.  In fact
DUPSETUP is not used from anywhere.  CLONESETUP has only one usage.
Let's not expose them to extension libraries.

cf ruby#4100 (comment)
ruby#4100 (review)

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
@shyouhei shyouhei merged commit a67afaa into ruby:master Jan 27, 2021
shyouhei added a commit that referenced this pull request Jan 27, 2021
They are no longer how Object#clone/Object#dup are defined.  In fact
DUPSETUP is not used from anywhere.  CLONESETUP has only one usage.
Let's not expose them to extension libraries.

cf #4100 (comment)
@shyouhei shyouhei deleted the OBJ_TAINT branch July 4, 2023 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants