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

Invalid Date exception when marshaling a Date - 9.2.0.0 #5188

Closed
creddy opened this issue May 24, 2018 · 2 comments
Closed

Invalid Date exception when marshaling a Date - 9.2.0.0 #5188

creddy opened this issue May 24, 2018 · 2 comments

Comments

@creddy
Copy link

creddy commented May 24, 2018

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
@creddy creddy changed the title Invalid Date exception when marshaling a Date Invalid Date exception when marshaling a Date - 9.2.0.0 May 24, 2018
@enebo enebo added this to the JRuby 9.2.1.0 milestone May 24, 2018
@headius
Copy link
Member

headius commented May 24, 2018

Oops.

@headius
Copy link
Member

headius commented May 24, 2018

The simple case of dumping and loading a Date appears to work ok so there's something in ActiveSupport's date logic mucking it up for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants