From: normalperson@... Date: 2014-03-19T07:28:40+00:00 Subject: [ruby-core:61586] [ruby-trunk - Bug #9652] Marshal doesn't dump/load Time#zone correctly with too many time object Issue #9652 has been updated by Eric Wong. I cannot reproduce the problem here, however it could be the lack of reference for GC. Can you add this rb_ivar_set call? --- a/time.c +++ b/time.c @@ -4828,6 +4828,7 @@ end_submicro: ; } if (!NIL_P(zone)) { tobj->vtm.zone = RSTRING_PTR(zone); + rb_ivar_set(str, id_zone, zone); } return time; Also at: git://80x24.org/ruby.git time-load-zone http://bogomips.org/ruby.git/patch?id=9418df96145 ---------------------------------------- Bug #9652: Marshal doesn't dump/load Time#zone correctly with too many time object https://bugs.ruby-lang.org/issues/9652#change-45866 * Author: Cantin Xu * Status: Open * Priority: Normal * Assignee: * Category: core * Target version: current: 2.2.0 * ruby -v: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- Hi, there I wrote a script to test Marshal dump/load with many time object ( see attachment ). basic idea is: 1) A is container of time, it contains 100,000 time instance (all Time.now). 2) dump/load A by using Marshal, expected behavior is all the time zone must same as Time.now.zone but I get different things or unreadable code in some Time instance by calling time.zone. mostly it's "UTF-8'. env: Mac 10.9.2, ruby: ruby 2.1.1-p76 PS: it's fine while A contain 10,000 time instance ---Files-------------------------------- timezone_test.rb (409 Bytes) -- https://bugs.ruby-lang.org/