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

Marshal.load fails with an explicit nil proc #4526

Closed
erikogan opened this Issue Mar 8, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@erikogan

erikogan commented Mar 8, 2017

Environment

Provide at least:

  • JRuby version: jruby 9.1.8.0 (2.3.1) 2017-03-06 90fc7ab Java HotSpot(TM) 64-Bit Server VM 25.60-b23 on 1.8.0_60-b27 +jit [darwin-x86_64]
  • Operating system and platform: OS X El Capitan Darwin Ilarnek 15.6.0 Darwin Kernel Version 15.6.0: Mon Jan 9 23:07:29 PST 2017; root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64
puts Marshal.load(Marshal.dump(without: :proc)).inspect
puts Marshal.load(Marshal.dump(with: :proc), Proc.new {|o| puts o.inspect; o}).inspect
puts Marshal.load(Marshal.dump(with: :nil_proc), nil).inspect

Originally I thought this might be caused by the ActiveSupport 5.0.2 monkey-patch of Marshal.load. That was a red herring.

Expected Behavior

Note: Original test case available in rails/rails#28342

{:without=>:proc}
:with
:proc
{:with=>:proc}
{:with=>:proc}
{:with=>:nil_proc}

Actual Behavior

{:without=>:proc}
:with
:proc
{:with=>:proc}
{:with=>:proc}
NoMethodError: undefined method `call' for nil:NilClass
Did you mean?  caller
    load at org/jruby/RubyMarshal.java:145
  <main> at tmp/marshal_bug.rb:5

@erikogan erikogan changed the title from Marshal.load breaking in Rails 5.0.2 (also master) to Marshal.load fails with an explicit nil proc Mar 9, 2017

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Mar 9, 2017

Member

Ahh so this may be pretty simple. I'll have a look.

Member

headius commented Mar 9, 2017

Ahh so this may be pretty simple. I'll have a look.

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