Forum: Ruby-core [Bug #1709] Marshal.dump Uses Different Definition of 'Depth' on 1.9?

Posted by Run Paint Run Run (Guest)
on 2009-07-01 00:35
(Received via mailing list)
Bug #1709: Marshal.dump Uses Different Definition of 'Depth' on 1.9?
http://redmine.ruby-lang.org/issues/show/1709

Author: Run Paint Run Run
Status: Open, Priority: Normal
Category: core
ruby -v: ruby 1.9.2dev (2009-06-27 trunk 23871) [i686-linux]

Marshal.dump issues an "exceed depth limit" on 1.9 when the same data 
structure with the same depth dumps correctly on 1.8.

    $ ruby8 -ve "h={'one'=>{'two'=>{'three'=>0}}}; p Marshal.dump(h,4)"
    ruby 1.8.8dev (2009-06-28) [i686-linux]
    "\004\b{\006\"\bone{\006\"\btwo{\006\"\nthreei\000"

    $ ruby -ve "h={'one'=>{'two'=>{'three'=>0}}}; p Marshal.dump(h,4)"
    ruby 1.9.2dev (2009-06-27 trunk 23871) [i686-linux]
    -e:1:in `dump': exceed depth limit (ArgumentError)
  from -e:1:in `<main>'

    $ ruby -ve "h={'one'=>{'two'=>{'three'=>0}}}; p Marshal.dump(h,5)"
    ruby 1.9.2dev (2009-06-27 trunk 23871) [i686-linux]
    "\x04\b{\x06I\"\bone\x06:\x06ET{\x06I\"\btwo\x06;\x00T{\x06I\"\nthree\x06;\x00Ti\x00"

Is this difference intentional? If so, how is 'depth' defined on 1.9?
Posted by Nobuyoshi Nakada (Guest)
on 2009-07-01 01:48
(Received via mailing list)
Issue #1709 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r23918.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1709
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.