Skip to content

Fix recursive set marshal dump and load#9418

Merged
headius merged 1 commit into
jruby:masterfrom
headius:recursive_set_marshal
May 6, 2026
Merged

Fix recursive set marshal dump and load#9418
headius merged 1 commit into
jruby:masterfrom
headius:recursive_set_marshal

Conversation

@headius

@headius headius commented May 5, 2026

Copy link
Copy Markdown
Member

The overridden dump and load logic did not properly register the set object for recursive linking, causing it to become corrupted under those circumstances. This pulls the linking logic down from the base marshal implementation and ensures the set is registered before its contents are dumped or loaded.

Fixes #9405

No tests or specs are provided yet because the ruby/spec specs for Marshal dump and load are a mess. We'll get something added but first need some discussion about how to proceed (ruby/spec#1355).

The overridden dump and load logic did not properly register the
set object for recursive linking, causing it to become corrupted
under those circumstances. This pulls the linking logic down from
the base marshal implementation and ensures the set is registered
before its contents are dumped or loaded.

Fixes jruby#9405
@headius headius added this to the JRuby 10.1.1.0 milestone May 5, 2026
@headius
headius merged commit e078763 into jruby:master May 6, 2026
208 of 211 checks passed
@headius
headius deleted the recursive_set_marshal branch May 6, 2026 03:45
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.

Marshal.load corrupts repeated object reference after Set appears earlier in payload

1 participant