Project

General

Profile

Bug #12475

SHARABLE_MIDDLE_SUBSTRING=1のとき、環境変数が正しく設定されない

Added by znz (Kazuhiro NISHIYAMA) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.0dev (2016-06-09 trunk 55344) [x86_64-linux]
[ruby-dev:49655]

Description

-DSHARABLE_MIDDLE_SUBSTRING=1 でビルドすると以下の failures がでます。

[15969/16628] TestTimeTZ#test_gen_right_America_Los_Angeles_91 = 0.00 s
  3) Failure:
TestTimeTZ#test_gen_right_America_Los_Angeles_91 [/home/vagrant/ruby/test/ruby/test_time_tz.rb:257]:
TZ=right/America/Los_Angeles Time.utc(1972, 6, 30, 23, 59, 60).
<"1972-06-30 23:59:60 UTC"> expected but was
<"1972-07-01 00:00:00 UTC">.

[15970/16628] TestTimeTZ#test_gen_right_America_Los_Angeles_92 = 0.00 s
  4) Failure:
TestTimeTZ#test_gen_right_America_Los_Angeles_92 [/home/vagrant/ruby/test/ruby/test_time_tz.rb:257]:
TZ=right/America/Los_Angeles Time.utc(2008, 12, 31, 23, 59, 60).
<"2008-12-31 23:59:60 UTC"> expected but was
<"2009-01-01 00:00:00 UTC">.

[15971/16628] TestTimeTZ#test_gen_right_America_Los_Angeles_95 = 0.00 s
  5) Failure:
TestTimeTZ#test_gen_right_America_Los_Angeles_95 [/home/vagrant/ruby/test/ruby/test_time_tz.rb:277]:
TZ=right/America/Los_Angeles Time.local(1972, 6, 30, 16, 59, 60).
<"1972-06-30 16:59:60 -0700"> expected but was
<"1972-06-30 17:00:00 +0000">.

[15972/16628] TestTimeTZ#test_gen_right_America_Los_Angeles_96 = 0.00 s
  6) Failure:
TestTimeTZ#test_gen_right_America_Los_Angeles_96 [/home/vagrant/ruby/test/ruby/test_time_tz.rb:277]:
TZ=right/America/Los_Angeles Time.local(2008, 12, 31, 15, 59, 60).
<"2008-12-31 15:59:60 -0800"> expected but was
<"2008-12-31 16:00:00 +0000">.

原因を調べてみたところ、ENV.[]= で環境変数が正しく設定されていませんでした。

$ irb -r irb/completion --simple-prompt
>> ENV["TZ"]="right/America/Los_Angeles.".chop
=> "right/America/Los_Angeles"
>> Time.utc(1972, 6, 30, 23, 59, 60)
=> 1972-07-01 00:00:00 UTC
>> ENV["TZ"]
=> "right/America/Los_Angeles."
>>

Associated revisions

Revision 2667d1b3
Added by nobu (Nobuyoshi Nakada) over 3 years ago

hash.c: ensure NUL-terminated for ENV

  • hash.c (get_env_cstr): ensure NUL-terminated. [ruby-dev:49655] [Bug #12475]
  • string.c (rb_str_fill_terminator): return the pointer to the NUL-terminated content.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 55345
Added by nobu (Nobuyoshi Nakada) over 3 years ago

hash.c: ensure NUL-terminated for ENV

  • hash.c (get_env_cstr): ensure NUL-terminated. [ruby-dev:49655] [Bug #12475]
  • string.c (rb_str_fill_terminator): return the pointer to the NUL-terminated content.

Revision 55345
Added by nobu (Nobuyoshi Nakada) over 3 years ago

hash.c: ensure NUL-terminated for ENV

  • hash.c (get_env_cstr): ensure NUL-terminated. [ruby-dev:49655] [Bug #12475]
  • string.c (rb_str_fill_terminator): return the pointer to the NUL-terminated content.

Revision 55345
Added by nobu (Nobuyoshi Nakada) over 3 years ago

hash.c: ensure NUL-terminated for ENV

  • hash.c (get_env_cstr): ensure NUL-terminated. [ruby-dev:49655] [Bug #12475]
  • string.c (rb_str_fill_terminator): return the pointer to the NUL-terminated content.

Revision 55345
Added by nobu (Nobuyoshi Nakada) over 3 years ago

hash.c: ensure NUL-terminated for ENV

  • hash.c (get_env_cstr): ensure NUL-terminated. [ruby-dev:49655] [Bug #12475]
  • string.c (rb_str_fill_terminator): return the pointer to the NUL-terminated content.

History

#1

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Status changed from Open to Closed

Applied in changeset r55345.


hash.c: ensure NUL-terminated for ENV

  • hash.c (get_env_cstr): ensure NUL-terminated. [ruby-dev:49655] [Bug #12475]
  • string.c (rb_str_fill_terminator): return the pointer to the NUL-terminated content.

Updated by usa (Usaku NAKAMURA) over 3 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: DONTNEED, 2.2: WONTFIX, 2.3: UNKNOWN

Updated by nagachika (Tomoyuki Chikanaga) over 3 years ago

  • Backport changed from 2.1: DONTNEED, 2.2: WONTFIX, 2.3: UNKNOWN to 2.1: DONTNEED, 2.2: WONTFIX, 2.3: WONTFIX

Also available in: Atom PDF