Forum: Ruby-core [ruby-trunk - Bug #7766][Open] Marshal.dump corrupts Hash data when serializing

Posted by Tasos Laskos (zapotek)
on 2013-02-01 05:01
(Received via mailing list)
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=...,
                    "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
Posted by charliesome (Charlie Somerville) (Guest)
on 2013-02-01 13:08
(Received via mailing list)
Issue #7766 has been updated by charliesome (Charlie Somerville).


=begin
Does it only corrupt the output, or does it break the actual Hash object 
passed to it?
=end
----------------------------------------
Bug #7766: Marshal.dump corrupts Hash data when serializing
https://bugs.ruby-lang.org/issues/7766#change-35758

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=...,
                    "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
Posted by Tasos Laskos (zapotek)
on 2013-02-01 20:35
(Received via mailing list)
Issue #7766 has been updated by zapotek (Tasos Laskos).


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.
----------------------------------------
Bug #7766: Marshal.dump corrupts Hash data when serializing
https://bugs.ruby-lang.org/issues/7766#change-35766

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=...,
                    "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
Posted by Vít Ondruch (vo_x)
on 2013-02-01 20:49
(Received via mailing list)
Issue #7766 has been updated by vo.x (Vit Ondruch).

Status changed from Open to Closed


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

Author: zapotek (Tasos Laskos)
Status: Closed
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=...,
                    "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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.