Issue #7766 has been reported by zapotek (Tasos Laskos).

----------------------------------------
Bug #7766: Marshal.dump corrupts Hash data when serializing
https://bugs.ruby-lang.org/issues/7766

Author: zapotek (Tasos Laskos)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-01 trunk 37411) [x86_64-linux]


=begin
Marshal.dump seems to corrupt a Hash object during serialization.
The problem is that this does not happen when the affected Hash is serialized by itself but only (as far as I could see) when it's part of a larger object.

Worked on: ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-linux]

Unfortunately, it can't be reproduced using the attached serialized objects, it only happens when I run one of my system's tests.

I thought that I might be doing something wrong but it works fine on 1.9.3 and also works on 2.0 when I change the serializer to YAML.

    Proper object -- YAML
    {
                "requests" => 2830,
            "responses" => 2830,
        "time_out_count" => 0,
                    "time" => "00:00:17",
                    "avg" => 158,
            "sitemap_size" => 776,
        "auditmap_size" => 651,
                "progress" => 100.0,
        "curr_res_time" => 0,
            "curr_res_cnt" => 0,
                "curr_avg" => 0,
        "average_res_time" => 0,
        "max_concurrency" => 20,
            "current_page" => "http://localhost:15407/vulnerable?0_vulnerable_26=stuff26",
                    "eta" => "--:--:--",
                    "url" => "localhost:57977",
                "status" => "cleanup"
    }

    Corrupted object - Marshal
    {
            "requests" => 2830,
                6154.0 => "time_out_count",
            "responses" => 0,
                    0.0 => "average_res_time",
                "time" => 776,
            "00:00:17" => 651,
                "avg" => 100.0,
                350.0 => 0,
        "sitemap_size" => 0,
        "auditmap_size" => 0,
                1301.0 => 0,
            "progress" => 20,
                100.0 => "curr_res_time"
    }

I didn't go through the entire repro setup of my system because it's a bit of a hassle but if the info I included here isn't enough I'd be glad to provide any further information you may need.
=end


-- 
http://bugs.ruby-lang.org/