Project

General

Profile

This project is closed and read-only.

Actions

Backport #2548

closed

Marshal dump/load fails when given an array containing certain (rather silly) symbols

Backport #2548: Marshal dump/load fails when given an array containing certain (rather silly) symbols

Added by coatl (caleb clausen) over 16 years ago. Updated about 7 years ago.

Status:
Closed
[ruby-core:27375]

Description

=begin
Either Marshal.dump or Marshal.load is failing to do the right thing with certain symbols which name backreference variables of unusual size. Here's the simplest example I could find:

$ ruby19 -e 'p Marshal.load Marshal.dump [:$98349576875974523789734582394578,nil]'
-e:1:in load': dump format error(0x0) (ArgumentError) from -e:1:in

'

This case works without a problem in ruby 1.8. The problem goes away if the second element of the array is left off, or if the symbol is used by itself without an array enclosing it. Marshal.load is raising the error, but I'm not sure if the problem is there or if Marshal.dump is emitting something incorrect.

Tested on ruby 1.9.1, but I'm guessing 1.9.2 has the same issue.
=end


Related issues 1 (0 open — 1 closed)

Has duplicate Backport191 - Backport #3729: Fwd: 1.9.1 has marshal bugs in everything but p129Closedyugui (Yuki Sonoda)Actions

Updated by coatl (caleb clausen) over 16 years ago Actions #1

=begin
I've since discovered that you don't have to use a backreference of unusual size; any backreference will do. A variety of other more normal symbols are also affected. Here's a list of some other failing cases:

$ ruby19 -e 'p Marshal.load Marshal.dump [:$1,nil]
-e:1:in load': dump format error(0x0) (ArgumentError) from -e:1:in

'

$ ruby19 -e 'p Marshal.load Marshal.dump [:$0,nil]
-e:1:in load': dump format error(0x0) (ArgumentError) from -e:1:in

'

$ ruby19 -e 'p Marshal.load Marshal.dump [:$&,nil]
-e:1:in load': dump format error(0x0) (ArgumentError) from -e:1:in

'

$ ruby19 -e 'p Marshal.load Marshal.dump [:$,nil] -e:1:in load': dump format error(0x0) (ArgumentError)
from -e:1:in `

'

$ ruby19 -e 'p Marshal.load Marshal.dump [:$$,nil]
-e:1:in load': dump format error(0x0) (ArgumentError) from -e:1:in

'

$ ruby19 -e 'p Marshal.load Marshal.dump [:$-a,nil]
-e:1:in load': dump format error(0x0) (ArgumentError) from -e:1:in

'

So, the inputs to make this happen aren't so silly after all.
=end

Updated by nobu (Nobuyoshi Nakada) about 16 years ago Actions #2

  • Status changed from Open to Assigned
  • Assignee set to yugui (Yuki Sonoda)

=begin

=end

Updated by jeremyevans0 (Jeremy Evans) about 7 years ago Actions #3

  • Description updated (diff)
  • Status changed from Assigned to Closed
Actions

Also available in: PDF Atom