Skip to content

Invalid Date exception when marshaling a Date - 9.2.0.0 #5188

@creddy

Description

@creddy

Environment

JRuby verison and uname
  • jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 Java HotSpot(TM) 64-Bit Server VM 25.74-b02 on 1.8.0_74-b02 [darwin-x86_64]
  • Darwin 17.5.0 Darwin Kernel Version 17.5.0: Fri Apr 13 19:32:32 PDT 2018; root:xnu-4570.51.2~1/RELEASE_X86_64 x86_64
Gems

active_support version 5.1.4

Expected Behavior

repro.rb

require "bundler/inline"

gemfile do
  source "https://rubygems.org"
  gem "activesupport", "5.1.4"
end

require "active_support/all"

date = 2.days.from_now.to_date
puts Marshal.load(Marshal.dump(date))

JRuby 9.1.17.0

➜  ~ [jruby-9.1.17.0]  jruby -v
jruby 9.1.17.0 (2.3.3) 2018-04-20 d8b1ff9 Java HotSpot(TM) 64-Bit Server VM 25.74-b02 on 1.8.0_74-b02 [darwin-x86_64]
➜  ~ [jruby-9.1.17.0]  ruby repro.rb
2018-05-26

Ruby 2.5.1

➜  ~ [2.5.1]  ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
➜  ~ [2.5.1]  ruby repro.rb
2018-05-26

Actual Behavior

➜  ~ [jruby-9.2.0.0]  ruby -v
jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 Java HotSpot(TM) 64-Bit Server VM 25.74-b02 on 1.8.0_74-b02 [darwin-x86_64]
➜  ~ [jruby-9.2.0.0]  ruby repro.rb
ArgumentError: invalid date
    initialize at org/jruby/ext/date/RubyDate.java:234
    initialize at org/jruby/ext/date/RubyDate.java:221
  marshal_load at org/jruby/ext/date/RubyDate.java:1377
          load at org/jruby/RubyMarshal.java:139
          load at /SAPDevelop/.rbenv/versions/jruby-9.2.0.0/lib/ruby/gems/shared/gems/activesupport-5.1.4/lib/active_support/core_ext/marshal.rb:4
        <main> at repo.rb:11

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions