Bug #3596
closedCan Marshal nested Hash from 1.9.2 --> 1.8.7
Description
=begin
Hi,
The loaded Hash object has empty values where the inner hashes should be:
expected:
{"HashKeyA"=>{"StringA"=>"a"}, "HashKeyB"=>{"StringA"=>"a"}, "HashKeyC"=>{"StringA"=>"a"}, "HashKeyD"=>{"StringA"=>"a"}, "HashKeyE"=>{"StringA"=>"a"}, "HashKeyF"=>{"StringA"=>"a"}, "HashKeyG"=>{"StringA"=>"a"}, "HashKeyH"=>{"StringA"=>"a"}, "HashKeyI"=>{"StringA"=>"a"}, "HashKeyJ"=>{"StringA"=>"a"}, "HashKeyK"=>{"StringA"=>"a"}, "HashKeyL"=>{"StringA"=>"a"}, "HashKeyM"=>{"StringA"=>"a"}, "HashKeyN"=>{"StringA"=>"a"}, "HashKeyO"=>{"StringA"=>"a"}, "HashKeyP"=>{"StringA"=>"a"}, "HashKeyQ"=>{"StringA"=>"a"}, "HashKeyR"=>{"StringA"=>"a"}, "HashKeyS"=>{"StringA"=>"a"}, "HashKeyT"=>{"StringA"=>"a"}, "HashKeyU"=>{"StringA"=>"a"}, "HashKeyV"=>{"StringA"=>"a"}, "HashKeyW"=>{"StringA"=>"a"}, "HashKeyX"=>{"StringA"=>"a"}, "HashKeyY"=>{"StringA"=>"a"}, "HashKeyZ"=>{"StringA"=>"a"}}
got:
{"HashKeyA"=>{}, "HashKeyB"=>{}, "HashKeyC"=>{}, "HashKeyD"=>{}, "HashKeyE"=>{}, "HashKeyF"=>{}, "HashKeyG"=>{}, "HashKeyH"=>{}, "HashKeyI"=>{}, "HashKeyJ"=>{}, "HashKeyK"=>{}, "HashKeyL"=>{}, "HashKeyM"=>{}, "HashKeyN"=>{}, "HashKeyO"=>{}, "HashKeyP"=>{}, "HashKeyQ"=>{}, "HashKeyR"=>{}, "HashKeyS"=>{}, "HashKeyT"=>{}, "HashKeyU"=>{}, "HashKeyV"=>{}, "HashKeyW"=>{}, "HashKeyX"=>{}, "HashKeyY"=>{}, "HashKeyZ"=>{}}
The 1.8.7 can reads the keys... but only for the 1st level of the hash. Heh, it almost works, just not quite fully there (but nearly!).
I am guessing this aught to be regarded as a bug because the Marshal Version is 4,8 for both Ruby versions:
1.9.2
$ cat /opt/rvm/src/ruby-1.9.2-rc2/marshal.c | grep '#define MARSHAL_M'
#define MARSHAL_MAJOR 4
#define MARSHAL_MINOR 8
1.8.7
$ cat /opt/rvm/src/ruby-1.8.7-p174/marshal.c | grep '#define MARSHAL_M'
#define MARSHAL_MAJOR 4
#define MARSHAL_MINOR 8
=end
Updated by raggi (James Tucker) over 14 years ago
=begin
On 21 Jul 2010, at 17:06, Dreamcat Four wrote:
Bug #3596: Can Marshal nested Hash from 1.9.2 --> 1.8.7
http://redmine.ruby-lang.org/issues/show/3596Author: Dreamcat Four
Status: Open, Priority: Normal
ruby -v: ruby 1.9.2dev (2010-07-11 revision 28618) [i386-darwin10.4.0]Hi,
The loaded Hash object has empty values where the inner hashes should be:expected:
{"HashKeyA"=>{"StringA"=>"a"}, "HashKeyB"=>{"StringA"=>"a"}, "HashKeyC"=>{"StringA"=>"a"}, "HashKeyD"=>{"StringA"=>"a"}, "HashKeyE"=>{"StringA"=>"a"}, "HashKeyF"=>{"StringA"=>"a"}, "HashKeyG"=>{"StringA"=>"a"}, "HashKeyH"=>{"StringA"=>"a"}, "HashKeyI"=>{"StringA"=>"a"}, "HashKeyJ"=>{"StringA"=>"a"}, "HashKeyK"=>{"StringA"=>"a"}, "HashKeyL"=>{"StringA"=>"a"}, "HashKeyM"=>{"StringA"=>"a"}, "HashKeyN"=>{"StringA"=>"a"}, "HashKeyO"=>{"StringA"=>"a"}, "HashKeyP"=>{"StringA"=>"a"}, "HashKeyQ"=>{"StringA"=>"a"}, "HashKeyR"=>{"StringA"=>"a"}, "HashKeyS"=>{"StringA"=>"a"}, "HashKeyT"=>{"StringA"=>"a"}, "HashKeyU"=>{"StringA"=>"a"}, "HashKeyV"=>{"StringA"=>"a"}, "HashKeyW"=>{"StringA"=>"a"}, "HashKeyX"=>{"StringA"=>"a"}, "HashKeyY"=>{"StringA"=>"a"}, "HashKeyZ"=>{"StringA"=>"a"}}got:
{"HashKeyA"=>{}, "HashKeyB"=>{}, "HashKeyC"=>{}, "HashKeyD"=>{}, "HashKeyE"=>{}, "HashKeyF"=>{}, "HashKeyG"=>{}, "HashKeyH"=>{}, "HashKeyI"=>{}, "HashKeyJ"=>{}, "HashKeyK"=>{}, "HashKeyL"=>{}, "HashKeyM"=>{}, "HashKeyN"=>{}, "HashKeyO"=>{}, "HashKeyP"=>{}, "HashKeyQ"=>{}, "HashKeyR"=>{}, "HashKeyS"=>{}, "HashKeyT"=>{}, "HashKeyU"=>{}, "HashKeyV"=>{}, "HashKeyW"=>{}, "HashKeyX"=>{}, "HashKeyY"=>{}, "HashKeyZ"=>{}}The 1.8.7 can reads the keys... but only for the 1st level of the hash. Heh, it almost works, just not quite fully there (but nearly!).
I am guessing this aught to be regarded as a bug because the Marshal Version is 4,8 for both Ruby versions:
1.9.2
$ cat /opt/rvm/src/ruby-1.9.2-rc2/marshal.c | grep '#define MARSHAL_M'
#define MARSHAL_MAJOR 4
#define MARSHAL_MINOR 81.8.7
$ cat /opt/rvm/src/ruby-1.8.7-p174/marshal.c | grep '#define MARSHAL_M'
#define MARSHAL_MAJOR 4
#define MARSHAL_MINOR 8
Yup, certainly bouncing that and updating rubyspec would seem like a good idea. What changed in the format, can you dump on both interpreters and compare?
=end
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
=begin
Hi,
At Thu, 22 Jul 2010 01:06:42 +0900,
Dreamcat Four wrote in [ruby-core:31410]:
The loaded Hash object has empty values where the inner hashes should be:
I can't reproduce it with any combination of [latest 1.9.2 and
1.9.3] x [1.8.6p400, 1.8.7p254, 1.8.7p299].
--
Nobu Nakada
=end
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
- Category set to core
- Status changed from Open to Feedback
=begin
=end
Updated by dreamcat4 (Dreamcat Four) over 14 years ago
=begin
Hi,
Actually this turned out to be a bug in the program receiving the data. I have now re-tested and there is no problem with the marshal.c sources in either direction between these Ruby versions. Sorry for the mistake.
=end
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
- Status changed from Feedback to Rejected
=begin
=end