[1.9] Random instance marshal data incompatible with CRuby 1.9
--------------------------------------------------------------

                 Key: JRUBY-5335
                 URL: http://jira.codehaus.org/browse/JRUBY-5335
             Project: JRuby
          Issue Type: Task
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.6RC1
         Environment: jruby 1.6.0.RC1 (ruby 1.8.7 patchlevel 330) (2011-01-12 
71f8afd) (OpenJDK 64-Bit Server VM 1.6.0_20) [linux-amd64-java]
            Reporter: Hiroshi Nakamura


CRuby's Random (uses Mersenne Twister) serializes it's state, left bytes and 
seed for restoring PRNG's state. We don't support PRNG state dump/load at 
present.

So Random's marshal format is incompatible. It would affect to dRuby, etc if 
one want to Marshal PRNG, I think it's a rare case though.
{noformat}
0% jruby --1.9 -e 'print Marshal.dump(Random.new)' | ruby -e 'p 
Marshal.load(STDIN)'
-e:1:in `marshal_load': wrong argument type Random (expected Bignum) (TypeError)
        from -e:1:in `load'
        from -e:1:in `<main>'

0% jruby -v
jruby 1.6.0.RC1 (ruby 1.8.7 patchlevel 330) (2011-01-12 71f8afd) (OpenJDK 
64-Bit Server VM 1.6.0_20) [linux-amd64-java]

0% ruby -v
ruby 1.9.3dev (2011-01-11 trunk 30513) [x86_64-linux]
{noformat}

By definition, we cannot let it be compatible without implementing exactly the 
same Mersenne Twister logic as CRuby. Take care, it could cause security issues.

Shall we do this?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to