-
-
Notifications
You must be signed in to change notification settings - Fork 939
Closed
Milestone
Description
Summary
We have a Ruby application that uses Marshal dump / load to serialize multi-dimension style array structures. Working on a JRuby 10 upgrade I believe I found a bug where Marshal.dump output is corrupted once data gets over a certain size (a few MBs). This case passes on older versions including 9.4.14.0, 9.2.x etc.
Environment
JRuby 10.0.2.0 verified issue on Mac OSX M1 / Windows 11 64bit / Ubuntu 20.04 arm64
MacOS
openjdk version "21.0.7" 2025-04-15 LTS
OpenJDK Runtime Environment Temurin-21.0.7+6 (build 21.0.7+6-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.7+6 (build 21.0.7+6-LTS, mixed mode, sharing)
Windows
21.0.9 LTS - 64 bit server VM (Oracle)
Test Case
json test file attached.
jruby-10.0.2.0 :002 > require 'json'
jruby-10.0.2.0 :003 > require 'zlib'
jruby-10.0.2.0 :004 > json_str = Zlib.gunzip(File.binread('/tmp/jruby_bug_data.json.gz')); nil;
jruby-10.0.2.0 :005 > data = JSON.parse(json_str); nil;
jruby-10.0.2.0 :006 > dumped = Marshal.dump(data); nil;
jruby-10.0.2.0 :007 > reloaded = Marshal.load(dumped); nil;
org/jruby/RubyMarshal.java:165:in 'load': dump format error (unlinked, index: -1) (ArgumentError)
from (irb):7:in 'evaluate'
from org/jruby/RubyKernel.java:1258:in 'eval'
from org/jruby/RubyKernel.java:1657:in 'loop'
from org/jruby/RubyKernel.java:1397:in 'catch'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels