Project

General

Profile

Actions

Bug #7766

closed

Marshal.dump corrupts Hash data when serializing

Added by zapotek (Tasos Laskos) almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 2.0.0dev (2012-11-01 trunk 37411) [x86_64-linux]
Backport:
[ruby-core:51786]

Description

=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


Files

dump.marshal (567 KB) dump.marshal Marshal dump in question zapotek (Tasos Laskos), 02/01/2013 12:57 PM
dump.yaml (947 KB) dump.yaml YAML dump of the same object zapotek (Tasos Laskos), 02/01/2013 12:57 PM
marshal_bug.rb (679 Bytes) marshal_bug.rb zapotek (Tasos Laskos), 02/01/2013 12:57 PM

Updated by Anonymous almost 12 years ago

=begin
Does it only corrupt the output, or does it break the actual Hash object passed to it?
=end

Updated by zapotek (Tasos Laskos) almost 12 years ago

It only corrupted the output, although a few mins ago I realized I was on the preview and there was an RC1 out.
I just tested RC1 and the problem seems to have been fixed.

Do excuse me and please ignore this issue.

Updated by vo.x (Vit Ondruch) almost 12 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0