Skip to content

Ignore encoding when unmarshaling an Encoding#9051

Merged
headius merged 1 commit intojruby:masterfrom
headius:ignore_dumped_encoding_encoding
Oct 31, 2025
Merged

Ignore encoding when unmarshaling an Encoding#9051
headius merged 1 commit intojruby:masterfrom
headius:ignore_dumped_encoding_encoding

Conversation

@headius
Copy link
Member

@headius headius commented Oct 31, 2025

CRuby appears to marshal all Encoding objects with a special encoding instance variable indicating they have an encoding of US-ASCII, even though Encoding does not actually have an encoding. I've filed an issue about this for clarification below, but for now we ignore this peculiar situation.

https://bugs.ruby-lang.org/issues/21658

Fixes #9050

CRuby appears to marshal all Encoding objects with a special
encoding instance variable indicating they have an encoding of
US-ASCII, even though Encoding does not actually have an encoding.
I've filed an issue about this for clarification below, but for now
we ignore this peculiar situation.

https://bugs.ruby-lang.org/issues/21658

Fixes jruby#9050
@headius
Copy link
Member Author

headius commented Oct 31, 2025

Checked into TruffleRuby impl and they basically ignore encoding instance vars for object types that don't have encoding. CRuby rejects such classes outright, but has an exception for T_DATA that is an encoding object, so basically what we have here.

@headius headius merged commit 89d3771 into jruby:master Oct 31, 2025
75 checks passed
@headius headius deleted the ignore_dumped_encoding_encoding branch October 31, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Marshal fails to load an encoding with an encoding ivar

1 participant