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

Incorrect marshal handling of links & floats #3747

Open
segiddins opened this issue Dec 16, 2024 · 1 comment
Open

Incorrect marshal handling of links & floats #3747

segiddins opened this issue Dec 16, 2024 · 1 comment
Assignees
Labels

Comments

@segiddins
Copy link

Running the following:

a = [0.0]
a << a << 0.0 << a

dumped = Marshal.dump a
pp dumped
loaded = Marshal.load dumped
pp loaded

pp Marshal.load "\x04\b[\tf\x060@\x00@\x06@\x00"

Gives different results on truffleruby vs mri & jruby

[mri        ] ~/Development/github.com/segiddins/chrb/chrb 3.3.6 -v './Untitled 6.rb' started at 2024-12-16 14:30:29.955
[mri        ] ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [arm64-darwin24]
[mri        ] "\x04\b[\tf\x060@\x00@\x06@\x00"
[mri        ] [0.0, [...], 0.0, [...]]
[mri        ] [0.0, [...], 0.0, [...]]
[mri        ] ~/Development/github.com/segiddins/chrb/chrb 3.3.6 -v './Untitled 6.rb' stopped at 2024-12-16 14:30:30.043 after 88ms
[mri        ] ~/Development/github.com/segiddins/chrb/chrb 3.3.6 -v './Untitled 6.rb' exited with code 0
[truffleruby] ~/Development/github.com/segiddins/chrb/chrb truffleruby-24 -v './Untitled 6.rb' started at 2024-12-16 14:30:29.956
[truffleruby] truffleruby 24.0.2, like ruby 3.2.2, Oracle GraalVM Native [aarch64-darwin]
[truffleruby] [ruby] WARNING gem paths: /Users/segiddins/.gem/ruby/3.3.6, /Users/segiddins/.rubies/ruby-3.3.6/lib/ruby/gems/3.3.0 are not marked as installed by TruffleRuby. They might belong to another Ruby implementation and break unexpectedly. Configure your Ruby manager to use TruffleRuby, or `unset GEM_HOME GEM_PATH`. See https://github.com/oracle/truffleruby/blob/master/doc/user/ruby-managers.md
[truffleruby] "\x04\b[\tf\x060@\x00f\x060@\x00"
[truffleruby] [0.0, [...], 0.0, [...]]
[truffleruby] <internal:core> core/marshal.rb:690:in `construct': dump format error (unlinked) (ArgumentError)
[truffleruby] 	from <internal:core> core/marshal.rb:783:in `block in construct_array'
[truffleruby] 	from <internal:core> core/integer.rb:149:in `times'
[truffleruby] 	from <internal:core> core/marshal.rb:782:in `construct_array'
[truffleruby] 	from <internal:core> core/marshal.rb:668:in `construct'
[truffleruby] 	from <internal:core> core/marshal.rb:1484:in `load'
[truffleruby] 	from ./Untitled 6.rb:23:in `<main>'
[truffleruby] <internal:core> core/array.rb:418:in `fetch': index 1 out of bounds (IndexError)
[truffleruby] 	from <internal:core> core/marshal.rb:687:in `construct'
[truffleruby] 	from <internal:core> core/marshal.rb:783:in `block in construct_array'
[truffleruby] 	from <internal:core> core/integer.rb:149:in `times'
[truffleruby] 	from <internal:core> core/marshal.rb:782:in `construct_array'
[truffleruby] 	from <internal:core> core/marshal.rb:668:in `construct'
[truffleruby] 	from <internal:core> core/marshal.rb:1484:in `load'
[truffleruby] 	from ./Untitled 6.rb:23:in `<main>'
[truffleruby] ~/Development/github.com/segiddins/chrb/chrb truffleruby-24 -v './Untitled 6.rb' stopped at 2024-12-16 14:30:30.549 after 593ms
[truffleruby] ~/Development/github.com/segiddins/chrb/chrb truffleruby-24 -v './Untitled 6.rb' exited with code 1
[jruby      ] ~/Development/github.com/segiddins/chrb/chrb jruby-9 -v './Untitled 6.rb' started at 2024-12-16 14:30:29.957
[jruby      ] jruby 9.4.3.0 (3.1.4) 2023-06-07 3086960792 OpenJDK 64-Bit Server VM 19.0.1+10-21 on 19.0.1+10-21 +jit [arm64-darwin]
[jruby      ] "\x04\b[\tf\x060@\x00f\x060@\x00"
[jruby      ] [0.0, [...], 0.0, [...]]
[jruby      ] [0.0, [...], 0.0, [...]]
[jruby      ] ~/Development/github.com/segiddins/chrb/chrb jruby-9 -v './Untitled 6.rb' stopped at 2024-12-16 14:30:32.459 after 2,502ms
[jruby      ] ~/Development/github.com/segiddins/chrb/chrb jruby-9 -v './Untitled 6.rb' exited with code 0
@andrykonchin
Copy link
Member

Thank you for the report, we'll look into it.

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

No branches or pull requests

2 participants