Ruby Issue Tracking System: Issues
https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2023-12-12T02:17:12Z
Ruby Issue Tracking System
Redmine
Ruby master - Bug #20061 (Closed): test_free_on_exit_env_var failed with some cppflags
https://bugs.ruby-lang.org/issues/20061
2023-12-12T02:17:12Z
znz (Kazuhiro NISHIYAMA)
<p>I use following <code>cppflags</code>, and <code>TestRubyOptions#test_free_on_exit_env_var</code> failed.</p>
<pre><code>../configure 'cppflags=-DUSE_RVARGC -DRUBY_DEBUG -DVM_CHECK_MODE=1 -DTRANSIENT_HEAP_CHECK_MODE -DRGENGC_CHECK_MODE -DENC_DEBUG -DUSE_RUBY_DEBUG_LOG=1' --prefix=$(rbenv root)/versions/master --with-baseruby=/usr/bin/ruby --disable-install-doc
</code></pre>
<p>It can reproduce using <code>miniruby</code>.</p>
<pre><code>$ env RUBY_FREE_ON_EXIT=1 ./miniruby -e 0
./miniruby: warning: Free on exit is experimental and may be unstable
-e: [BUG] obj_free: RVALUE_MARKED(0x00007efe26a69010 [3LM ] T_CLASS (anon)) != FALSE
ruby 3.3.0dev (2023-12-12T01:31:37Z master 73b43fffa1) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0003 E:0006b0 DUMMY [FINISH]
-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 1
-- C level backtrace information -------------------------------------------
/home/ubuntu/ruby/build/miniruby(rb_print_backtrace+0x14) [0x5563381d66a7] ../vm_dump.c:820
/home/ubuntu/ruby/build/miniruby(rb_vm_bugreport) ../vm_dump.c:1151
/home/ubuntu/ruby/build/miniruby(bug_report_end+0x0) [0x556337fc41ad] ../error.c:1042
/home/ubuntu/ruby/build/miniruby(rb_bug_without_die) ../error.c:1042
/home/ubuntu/ruby/build/miniruby(die+0x0) [0x556337eef35b] ../error.c:1050
/home/ubuntu/ruby/build/miniruby(rb_bug) ../error.c:1052
/home/ubuntu/ruby/build/miniruby(obj_free+0x6db) [0x556337fed3fb] ../gc.c:3551
/home/ubuntu/ruby/build/miniruby(rb_objspace_call_finalizer+0x3bb) [0x556337fed8db] ../gc.c:4692
/home/ubuntu/ruby/build/miniruby(rb_ec_finalize+0x2a) [0x556337fccf80] ../eval.c:168
/home/ubuntu/ruby/build/miniruby(rb_ec_cleanup) ../eval.c:260
/home/ubuntu/ruby/build/miniruby(ruby_run_node+0x6e) [0x556337fcf58e] ../eval.c:328
/home/ubuntu/ruby/build/miniruby(rb_main+0x21) [0x556337f0ff0b] ../main.c:39
/home/ubuntu/ruby/build/miniruby(main) ../main.c:58
/lib/x86_64-linux-gnu/libc.so.6(0x7efe2a5bad90) [0x7efe2a5bad90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7efe2a5bae40]
[0x556337f0ff55]
-- Other runtime information -----------------------------------------------
* Process memory map:
556337ea6000-556337ee9000 r--p 00000000 00:39 4234136 /home/ubuntu/ruby/build/miniruby
556337ee9000-5563382fc000 r-xp 00043000 00:39 4234136 /home/ubuntu/ruby/build/miniruby
5563382fc000-5563384aa000 r--p 00456000 00:39 4234136 /home/ubuntu/ruby/build/miniruby
5563384aa000-5563384c1000 r--p 00603000 00:39 4234136 /home/ubuntu/ruby/build/miniruby
5563384c1000-5563384c2000 rw-p 0061a000 00:39 4234136 /home/ubuntu/ruby/build/miniruby
5563384c2000-5563384d8000 rw-p 00000000 00:00 0
55633a3d2000-55633a6dd000 rw-p 00000000 00:00 0 [heap]
7efe23be1000-7efe26710000 r--s 00000000 00:39 4234136 /home/ubuntu/ruby/build/miniruby
7efe26710000-7efe26720000 rw-p 00000000 00:00 0
7efe26812000-7efe26a30000 r--s 00000000 00:39 4191832 /usr/lib/x86_64-linux-gnu/libc.so.6
7efe26a30000-7efe26ad0000 rw-p 00000000 00:00 0
7efe26ad0000-7efe26ad1000 ---p 00000000 00:00 0
7efe26ad1000-7efe26b72000 rw-p 00000000 00:00 0
7efe26b72000-7efe26b73000 ---p 00000000 00:00 0
7efe26b73000-7efe26c14000 rw-p 00000000 00:00 0
7efe26c14000-7efe26c15000 ---p 00000000 00:00 0
7efe26c15000-7efe26cb6000 rw-p 00000000 00:00 0
7efe26cb6000-7efe26cb7000 ---p 00000000 00:00 0
7efe26cb7000-7efe26d58000 rw-p 00000000 00:00 0
7efe26d58000-7efe26d59000 ---p 00000000 00:00 0
7efe26d59000-7efe26dfa000 rw-p 00000000 00:00 0
7efe26dfa000-7efe26dfb000 ---p 00000000 00:00 0
7efe26dfb000-7efe26e9c000 rw-p 00000000 00:00 0
7efe26e9c000-7efe26e9d000 ---p 00000000 00:00 0
7efe26e9d000-7efe26f3e000 rw-p 00000000 00:00 0
7efe26f3e000-7efe26f3f000 ---p 00000000 00:00 0
7efe26f3f000-7efe26fe0000 rw-p 00000000 00:00 0
7efe26fe0000-7efe26fe1000 ---p 00000000 00:00 0
7efe26fe1000-7efe27082000 rw-p 00000000 00:00 0
7efe27082000-7efe27083000 ---p 00000000 00:00 0
7efe27083000-7efe27124000 rw-p 00000000 00:00 0
7efe27124000-7efe27125000 ---p 00000000 00:00 0
7efe27125000-7efe271c6000 rw-p 00000000 00:00 0
7efe271c6000-7efe271c7000 ---p 00000000 00:00 0
7efe271c7000-7efe27268000 rw-p 00000000 00:00 0
7efe27268000-7efe27269000 ---p 00000000 00:00 0
7efe27269000-7efe2730a000 rw-p 00000000 00:00 0
7efe2730a000-7efe2730b000 ---p 00000000 00:00 0
7efe2730b000-7efe273ac000 rw-p 00000000 00:00 0
7efe273ac000-7efe273ad000 ---p 00000000 00:00 0
7efe273ad000-7efe2744e000 rw-p 00000000 00:00 0
7efe2744e000-7efe2744f000 ---p 00000000 00:00 0
7efe2744f000-7efe274f0000 rw-p 00000000 00:00 0
7efe274f0000-7efe274f1000 ---p 00000000 00:00 0
7efe274f1000-7efe27592000 rw-p 00000000 00:00 0
7efe27592000-7efe27593000 ---p 00000000 00:00 0
7efe27593000-7efe27634000 rw-p 00000000 00:00 0
7efe27634000-7efe27635000 ---p 00000000 00:00 0
7efe27635000-7efe276d6000 rw-p 00000000 00:00 0
7efe276d6000-7efe276d7000 ---p 00000000 00:00 0
7efe276d7000-7efe27778000 rw-p 00000000 00:00 0
7efe27778000-7efe27779000 ---p 00000000 00:00 0
7efe27779000-7efe2781a000 rw-p 00000000 00:00 0
7efe2781a000-7efe2781b000 ---p 00000000 00:00 0
7efe2781b000-7efe278bc000 rw-p 00000000 00:00 0
7efe278bc000-7efe278bd000 ---p 00000000 00:00 0
7efe278bd000-7efe2795e000 rw-p 00000000 00:00 0
7efe2795e000-7efe2795f000 ---p 00000000 00:00 0
7efe2795f000-7efe27a00000 rw-p 00000000 00:00 0
7efe27a00000-7efe27a01000 ---p 00000000 00:00 0
7efe27a01000-7efe27aa2000 rw-p 00000000 00:00 0
7efe27aa2000-7efe27aa3000 ---p 00000000 00:00 0
7efe27aa3000-7efe27b44000 rw-p 00000000 00:00 0
7efe27b44000-7efe27b45000 ---p 00000000 00:00 0
7efe27b45000-7efe27be6000 rw-p 00000000 00:00 0
7efe27be6000-7efe27be7000 ---p 00000000 00:00 0
7efe27be7000-7efe27c88000 rw-p 00000000 00:00 0
7efe27c88000-7efe27c89000 ---p 00000000 00:00 0
7efe27c89000-7efe27d2a000 rw-p 00000000 00:00 0
7efe27d2a000-7efe27d2b000 ---p 00000000 00:00 0
7efe27d2b000-7efe27dcc000 rw-p 00000000 00:00 0
7efe27dcc000-7efe27dcd000 ---p 00000000 00:00 0
7efe27dcd000-7efe27e6e000 rw-p 00000000 00:00 0
7efe27e6e000-7efe27e6f000 ---p 00000000 00:00 0
7efe27e6f000-7efe27f20000 rw-p 00000000 00:00 0
7efe27f2f000-7efe27f30000 ---p 00000000 00:00 0
7efe27f30000-7efe28780000 rw-p 00000000 00:00 0
7efe2878f000-7efe2a140000 rw-p 00000000 00:00 0
7efe2a144000-7efe2a245000 rw-p 00000000 00:00 0
7efe2a245000-7efe2a24c000 r--s 00000000 00:39 4192098 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
7efe2a24c000-7efe2a2a3000 r--p 00000000 00:39 4193355 /usr/lib/locale/C.utf8/LC_CTYPE
7efe2a2a3000-7efe2a58c000 r--p 00000000 00:39 4192959 /usr/lib/locale/locale-archive
7efe2a58c000-7efe2a591000 rw-p 00000000 00:00 0
7efe2a591000-7efe2a5b9000 r--p 00000000 00:39 4191832 /usr/lib/x86_64-linux-gnu/libc.so.6
7efe2a5b9000-7efe2a74e000 r-xp 00028000 00:39 4191832 /usr/lib/x86_64-linux-gnu/libc.so.6
7efe2a74e000-7efe2a7a6000 r--p 001bd000 00:39 4191832 /usr/lib/x86_64-linux-gnu/libc.so.6
7efe2a7a6000-7efe2a7aa000 r--p 00214000 00:39 4191832 /usr/lib/x86_64-linux-gnu/libc.so.6
7efe2a7aa000-7efe2a7ac000 rw-p 00218000 00:39 4191832 /usr/lib/x86_64-linux-gnu/libc.so.6
7efe2a7ac000-7efe2a7b9000 rw-p 00000000 00:00 0
7efe2a7b9000-7efe2a7bc000 r--p 00000000 00:39 3583519 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7efe2a7bc000-7efe2a7d3000 r-xp 00003000 00:39 3583519 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7efe2a7d3000-7efe2a7d7000 r--p 0001a000 00:39 3583519 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7efe2a7d7000-7efe2a7d8000 r--p 0001d000 00:39 3583519 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7efe2a7d8000-7efe2a7d9000 rw-p 0001e000 00:39 3583519 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
7efe2a7d9000-7efe2a7e7000 r--p 00000000 00:39 4191835 /usr/lib/x86_64-linux-gnu/libm.so.6
7efe2a7e7000-7efe2a863000 r-xp 0000e000 00:39 4191835 /usr/lib/x86_64-linux-gnu/libm.so.6
7efe2a863000-7efe2a8be000 r--p 0008a000 00:39 4191835 /usr/lib/x86_64-linux-gnu/libm.so.6
7efe2a8be000-7efe2a8bf000 r--p 000e4000 00:39 4191835 /usr/lib/x86_64-linux-gnu/libm.so.6
7efe2a8bf000-7efe2a8c0000 rw-p 000e5000 00:39 4191835 /usr/lib/x86_64-linux-gnu/libm.so.6
7efe2a8c0000-7efe2a8c2000 r--p 00000000 00:39 12895 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
7efe2a8c2000-7efe2a8d6000 r-xp 00002000 00:39 12895 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
7efe2a8d6000-7efe2a8ef000 r--p 00016000 00:39 12895 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
7efe2a8ef000-7efe2a8f0000 ---p 0002f000 00:39 12895 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
7efe2a8f0000-7efe2a8f1000 r--p 0002f000 00:39 12895 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
7efe2a8f1000-7efe2a8f2000 rw-p 00030000 00:39 12895 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
7efe2a8f2000-7efe2a8fa000 rw-p 00000000 00:00 0
7efe2a8fa000-7efe2a904000 r--p 00000000 00:39 13002 /usr/lib/x86_64-linux-gnu/libgmp.so.10.4.1
7efe2a904000-7efe2a963000 r-xp 0000a000 00:39 13002 /usr/lib/x86_64-linux-gnu/libgmp.so.10.4.1
7efe2a963000-7efe2a97a000 r--p 00069000 00:39 13002 /usr/lib/x86_64-linux-gnu/libgmp.so.10.4.1
7efe2a97a000-7efe2a97b000 r--p 0007f000 00:39 13002 /usr/lib/x86_64-linux-gnu/libgmp.so.10.4.1
7efe2a97b000-7efe2a97c000 rw-p 00080000 00:39 13002 /usr/lib/x86_64-linux-gnu/libgmp.so.10.4.1
7efe2a97c000-7efe2a97e000 r--p 00000000 00:39 13365 /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7efe2a97e000-7efe2a98f000 r-xp 00002000 00:39 13365 /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7efe2a98f000-7efe2a995000 r--p 00013000 00:39 13365 /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7efe2a995000-7efe2a996000 ---p 00019000 00:39 13365 /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7efe2a996000-7efe2a997000 r--p 00019000 00:39 13365 /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7efe2a997000-7efe2a998000 rw-p 0001a000 00:39 13365 /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7efe2a99e000-7efe2a9a0000 rw-p 00000000 00:00 0
7efe2a9a0000-7efe2a9a2000 r--p 00000000 00:39 4191829 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7efe2a9a2000-7efe2a9cc000 r-xp 00002000 00:39 4191829 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7efe2a9cc000-7efe2a9d7000 r--p 0002c000 00:39 4191829 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7efe2a9d8000-7efe2a9da000 r--p 00037000 00:39 4191829 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7efe2a9da000-7efe2a9dc000 rw-p 00039000 00:39 4191829 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7ffdc11f0000-7ffdc19ef000 rw-p 00000000 00:00 0 [stack]
7ffdc19f7000-7ffdc19fb000 r--p 00000000 00:00 0 [vvar]
7ffdc19fb000-7ffdc19fd000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
</code></pre>
Ruby master - Bug #19902 (Closed): strftimeの返り値のascii_only?が間違っていることがある
https://bugs.ruby-lang.org/issues/19902
2023-09-26T00:33:29Z
znz (Kazuhiro NISHIYAMA)
<p>ruby-jp slack で tompng さんの調査によると以下のように <code>Regexp.esacpe</code> が変になる原因は <code>t.ascii_only? #=> true</code> になっていることでした。</p>
<pre><code>irb(main):053> t = Time.now.strftime(u='あ')
=> "あ"
irb(main):054> t==u
=> true
irb(main):055> t.encoding==u.encoding
=> true
irb(main):056> Regexp.escape(t)
=> "\xE3\x81\x82"
irb(main):057> Regexp.escape(u)
=> "あ"
</code></pre>
<p>git bisect で <code>make miniruby && ./miniruby -ve "p Time.now.strftime('%Y年').ascii_only?"</code> をしつつ調べてみると、<a href="https://github.com/ruby/ruby/commit/f34280ec6b684eeb21ef3336c7002e1a83dcfd2c" class="external">https://github.com/ruby/ruby/commit/f34280ec6b684eeb21ef3336c7002e1a83dcfd2c</a> から <code>true</code> になってしまっているようです。</p>
Ruby master - Bug #19605 (Closed): Please backport "Update how to subscribe mailing lists"
https://bugs.ruby-lang.org/issues/19605
2023-04-18T01:48:44Z
znz (Kazuhiro NISHIYAMA)
<p>I think how to subscribe should update.<br>
Because sending mail to <code>ruby-dev-request@ruby-lang.org</code> causes <code>Address not found</code>.</p>
<p><a href="https://github.com/ruby/ruby/commit/8519d94d3d8511080d3724fd328926d443cb95fa" class="external">https://github.com/ruby/ruby/commit/8519d94d3d8511080d3724fd328926d443cb95fa</a></p>
Ruby master - Bug #18906 (Closed): coverage failed on GItHub Actions
https://bugs.ruby-lang.org/issues/18906
2022-07-11T02:37:51Z
znz (Kazuhiro NISHIYAMA)
<p>coverage failed on GItHub Actions since <a href="https://github.com/ruby/actions/actions/runs/2486933939" class="external">https://github.com/ruby/actions/actions/runs/2486933939</a><br>
(previous <a href="https://github.com/ruby/actions/actions/runs/2486176425" class="external">https://github.com/ruby/actions/actions/runs/2486176425</a> is passed)</p>
<p>A reproduce test is attached.</p>
<pre><code> 1) Failure:
TestCoverage#test_coverage_ensure_if_return [/home/user/ruby/test/coverage/test_coverage.rb:193]:
pid 45865 exit 1
| /tmp/d20220710-45855-exgg7s/test.rb:5:in `flush': no implicit conversion of false into Integer (TypeError)
| from /tmp/d20220710-45855-exgg7s/test.rb:8:in `<top (required)>'
| from -:3:in `require'
| from -:3:in `<main>'
</code></pre>
Ruby master - Bug #18892 (Closed): ARGF.lineno starts from 2 when the file has shebang
https://bugs.ruby-lang.org/issues/18892
2022-07-02T06:11:07Z
znz (Kazuhiro NISHIYAMA)
<p>Since ruby 3.0, <code>ARGF.lineno</code> starts from 2 if the file has shebang.</p>
<p>Following example has <code>#!/usr/bin/env ruby</code>, and it can reproduce with the file has <code>#!</code> only.</p>
<pre><code>$ cat f.rb
#!/usr/bin/env ruby
ARGF.each do
p ARGF.lineno
exit
end
$ RBENV_VERSION=3.1.2 ruby -v f.rb f.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [aarch64-linux]
2
$ RBENV_VERSION=3.0.4 ruby -v f.rb f.rb
ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [aarch64-linux]
2
$ RBENV_VERSION=2.7.6 ruby -v f.rb f.rb
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [aarch64-linux]
1
</code></pre>
Ruby master - Bug #18887 (Closed): documentation for protected methods
https://bugs.ruby-lang.org/issues/18887
2022-06-29T08:08:57Z
znz (Kazuhiro NISHIYAMA)
<p>I think it is correct before the change.<br>
Which is correct?</p>
<p><a href="https://github.com/ruby/ruby/commit/962a3247b1b76770930200bcce7470a54dfb25c9" class="external">https://github.com/ruby/ruby/commit/962a3247b1b76770930200bcce7470a54dfb25c9</a></p>
Ruby master - Bug #18759 (Closed): snapshot-ruby_2_7: test failure on macos-12
https://bugs.ruby-lang.org/issues/18759
2022-04-28T00:18:36Z
znz (Kazuhiro NISHIYAMA)
<p>snapshot tarball のテストに macos-12 を追加したところ、 snapshot-ruby_2_7 で failure が発生していました。</p>
<p><a href="https://github.com/ruby/actions/runs/6199339063?check_suite_focus=true#step:17:138" class="external">https://github.com/ruby/actions/runs/6199339063?check_suite_focus=true#step:17:138</a></p>
<pre><code>
1) Failure:
TestRipper::ParserEvents#test_block_variables [/Users/runner/work/actions/actions/snapshot-ruby_2_7/test/ripper/test_parser_events.rb:1506]:
<a href="https://blade.ruby-lang.org/ruby-dev/39423">[ruby-dev:39423]</a>
pid 44233 exit 1
| -:1:in `setrlimit': Invalid argument - setrlimit (Errno::EINVAL)
| from -:1:in `<main>'
.
1. [1/2] Assertion for "stdout"
| <["[fcall(proc,[],&block([],[unary(!,ref(y))]))]"]> expected but was
| <[]>.
2. [2/2] Assertion for "stderr"
| <[]> expected but was
| <["-:1:in `setrlimit': Invalid argument - setrlimit (Errno::EINVAL)",
| "\tfrom -:1:in `<main>'"]>.
</code></pre>
<p>該当するテストは master では <a href="https://github.com/ruby/ruby/commit/1c7f5a57125001447dc6173847dc68aa50bd8e93" class="external">https://github.com/ruby/ruby/commit/1c7f5a57125001447dc6173847dc68aa50bd8e93</a> で setrlimit を使わないようになっていました。</p>
<p>コマンドラインでいくつかの値を試してみたところ、 macos-12 での EINVAL は設定しようとしている値が小さすぎるからのようでした。</p>
<pre><code>% /usr/bin/ruby -ve 'Process.setrlimit(Process::RLIMIT_AS, 1000*1024*1024)'
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
-e:1:in `setrlimit': Invalid argument - setrlimit (Errno::EINVAL)
from -e:1:in `<main>'
% /usr/bin/ruby -ve 'lim=Process.getrlimit(Process::RLIMIT_AS); p lim; Process.setrlimit(Process::RLIMIT_AS, lim[0]/2); p Process.getrlimit(Process::RLIMIT_AS)'
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
[9223372036854775807, 9223372036854775807]
[4611686018427387903, 4611686018427387903]
</code></pre>
Ruby master - Misc #18726 (Closed): CI Error on c99 and c2x
https://bugs.ruby-lang.org/issues/18726
2022-04-14T02:43:20Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://github.com/ruby/ruby/runs/6013849896?check_suite_focus=true" class="external">https://github.com/ruby/ruby/runs/6013849896?check_suite_focus=true</a></p>
<pre><code>checking char bit... 8
checking size of int... 0
checking size of short... 0
checking size of long... 0
configure: error: in `/__w/ruby/ruby/build':
configure: error: cannot compute sizeof (long long)
See `config.log' for more details
checking size of long long...
Error: Process completed with exit code 77.
</code></pre>
<p>I investigate it, the cause is that autoconf is old in <code>ghcr.io/ruby/ruby-ci-image:clang-15</code>. (Autoconf 2.69)<br>
Autoconf 2.71 generates with <code>void</code>.</p>
<p>How to reproduce:</p>
<pre><code> % docker run --rm -it ghcr.io/ruby/ruby-ci-image:clang-15
$ sudo apt update
$ sudo apt install git
$ git clone --depth=1 https://github.com/ruby/ruby $HOME/src
$ mkdir $HOME/build
$ cd $HOME/build
$ ../src/autogen.sh
$ ../src/configure -C --enable-debug-env --disable-install-doc --with-ext=-test-/cxxanyargs,+ --without-valgrind --without-jemalloc --without-gmp --with-gcc="clang-15 -std=c99 -Werror=pedantic -pedantic-errors" --enable-shared optflags=-O1 debugflags=-ggdb3
</code></pre>
<p>Tail of configure output:</p>
<pre><code> checking char bit... 8
checking size of int... 0
checking size of short... 0
checking size of long... 0
checking size of long long... configure: error: in `/home/ci/build':
configure: error: cannot compute sizeof (long long)
See `config.log' for more details
</code></pre>
<p>Quote from config.log:</p>
<pre><code>configure:13939: checking size of int
configure:13944: clang-15 -std=c99 -Werror=pedantic -pedantic-errors -o conftest -O1 -fno-fast-math -ggdb3 -fdeclspec -fstack-protector-strong conftest.c -lm >&5
conftest.c:107:25: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static long int longval () { return (long int) (sizeof (int)); }
^
void
conftest.c:108:35: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static unsigned long int ulongval () { return (long int) (sizeof (int)); }
^
void
2 errors generated.
</code></pre>
Ruby master - Bug #18643 (Closed): test-bundler failed on ruby_3_1 CI
https://bugs.ruby-lang.org/issues/18643
2022-03-18T04:25:49Z
znz (Kazuhiro NISHIYAMA)
<p>I think that this spec has failed since newer bundler released.</p>
<p><a href="https://github.com/ruby/actions/runs/5590419280?check_suite_focus=true#step:18:199" class="external">https://github.com/ruby/actions/runs/5590419280?check_suite_focus=true#step:18:199</a></p>
<pre><code>
expected "Running `bundle update --bundler \"> 0.a\"` with bundler 2.3.7\nHTTP GET https://index.rubygems.org/...ctions/actions/snapshot-ruby_3_1/tmp/4/gems/system/specifications/rack-1.2.gemspec\nBundle updated!" to include "Using bundler 2.3.7\n"
Diff:
@@ -1,19 +1,37 @@
-Using bundler 2.3.7\n
+Running `bundle update --bundler "> 0.a"` with bundler 2.3.7
+HTTP GET https://index.rubygems.org/versions
+HTTP 200 OK https://index.rubygems.org/versions
+Fetching gem metadata from https://rubygems.org/
+Looking up gems ["bundler"]
+HTTP GET https://index.rubygems.org/info/bundler
+HTTP 200 OK https://index.rubygems.org/info/bundler
+Updating bundler to 2.3.9.
+Fetching bundler 2.3.9
+Installing bundler 2.3.9
+Running `bundle update --bundler "> 0.a"` with bundler 2.3.9
+Found no changes, using resolution from the lockfile
+Using bundler 2.3.9
+0: bundler (2.3.9) from /home/runner/work/actions/actions/snapshot-ruby_3_1/tmp/4/gems/system/specifications/bundler-2.3.9.gemspec
+Using prints_loaded_gems 1.0
+0: prints_loaded_gems (1.0) from /home/runner/work/actions/actions/snapshot-ruby_3_1/tmp/4/gems/system/specifications/prints_loaded_gems-1.0.gemspec
+Using rack 1.2
+0: rack (1.2) from /home/runner/work/actions/actions/snapshot-ruby_3_1/tmp/4/gems/system/specifications/rack-1.2.gemspec
+Bundle updated!
# ./spec/bundler/commands/binstubs_spec.rb:229:in `block (5 levels) in <top (required)>'
# ./spec/bundler/spec_helper.rb:101:in `block (4 levels) in <top (required)>'
# ./spec/bundler/spec_helper.rb:101:in `block (3 levels) in <top (required)>'
# ./spec/bundler/support/helpers.rb:350:in `block in with_gem_path_as'
# ./spec/bundler/support/helpers.rb:364:in `without_env_side_effects'
# ./spec/bundler/support/helpers.rb:345:in `with_gem_path_as'
# ./spec/bundler/spec_helper.rb:100:in `block (2 levels) in <top (required)>'
</code></pre>
<p>It can reproduce with a small example.</p>
<p>Spec expects 3.0's behavior:</p>
<pre><code>$ rbenv local 3.0.3
$ bundle init
Writing new Gemfile to /tmp/x/Gemfile
$ bundle i
The Gemfile specifies no dependencies
Resolving dependencies...
Bundle complete! 0 Gemfile dependencies, 1 gem now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
$ bundle update --bundler "> 0.a"
The Gemfile specifies no dependencies
Bundle updated!
$
</code></pre>
<p>Actual 3.1's behavior:</p>
<pre><code>$ rbenv local 3.1.1
$ bundle init
Writing new Gemfile to /tmp/x/Gemfile
$ bundle i
The Gemfile specifies no dependencies
Resolving dependencies...
Bundle complete! 0 Gemfile dependencies, 1 gem now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
$ bundle update --bundler "> 0.a"
Fetching gem metadata from https://rubygems.org/.
The Gemfile specifies no dependencies
Bundle updated!
$
</code></pre>
<p>I'm not sure which is expected behavior: spec's or changed implementation.</p>
Ruby master - Bug #18469 (Closed): Backport c764e368bd9c0487e6cc97f8a62e0e0e99a0d7c5
https://bugs.ruby-lang.org/issues/18469
2022-01-10T11:24:19Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://github.com/ruby/ruby/blob/ruby_3_1/NEWS.md#mjit" class="external">https://github.com/ruby/ruby/blob/ruby_3_1/NEWS.md#mjit</a> says</p>
<pre><code>The default --mjit-max-cache is changed from 100 to 10000.
</code></pre>
<p>But <code>ruby --help</code> says 100 yet.</p>
<p>So I think <a href="https://github.com/ruby/ruby/commit/c764e368bd9c0487e6cc97f8a62e0e0e99a0d7c5" class="external">https://github.com/ruby/ruby/commit/c764e368bd9c0487e6cc97f8a62e0e0e99a0d7c5</a> is required to backport to ruby_3_1 branch.</p>
Ruby master - Bug #18158 (Closed): Pathname#each_entry without block does not return Enumerator
https://bugs.ruby-lang.org/issues/18158
2021-09-09T15:04:26Z
znz (Kazuhiro NISHIYAMA)
<p><code>Pathname#each_child</code> without block returns <code>Enumerator</code>.<br>
But <code>Pathname#each_entry</code> without block does not return <code>Enumerator</code>.</p>
<pre><code>% ruby -r pathname -e 'p Pathname(".").each_child.class'
Enumerator
% ruby -r pathname -e 'p Pathname(".").each_entry.class'
-e:1:in `foreach': no block given (LocalJumpError)
from -e:1:in `each_entry'
from -e:1:in `<main>'
</code></pre>
Ruby master - Feature #17798 (Closed): exception in finalizer
https://bugs.ruby-lang.org/issues/17798
2021-04-13T13:37:13Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://docs.ruby-lang.org/ja/latest/method/ObjectSpace/m/define_finalizer.html" class="external">https://docs.ruby-lang.org/ja/latest/method/ObjectSpace/m/define_finalizer.html</a> に</p>
<blockquote>
<p>proc の呼び出しで発生した大域脱出(exitや例外)は無視されます。これは、スクリプトのメイン処理が GC の発生によって非同期に中断されるのを防ぐためです。不安なうちは -d オプションで事前に例外の発生の有無を確認しておいた方が良いでしょう。</p>
</blockquote>
<p>とありますが、メインスレッド以外のスレッドが例外で終了したときにデフォルトでは「terminated with exception (report_on_exception is true)」と出るように、デフォルトでは無視せずにメッセージを出すようにしても良いのではないでしょうか?</p>
Ruby master - Bug #17590 (Closed): `M.prepend M` has hidden side effect
https://bugs.ruby-lang.org/issues/17590
2021-01-29T05:19:40Z
znz (Kazuhiro NISHIYAMA)
<p><code>M.prepend M</code> raises ArgumentError, but it has hidden side effect.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">module</span> <span class="nn">M</span><span class="p">;</span> <span class="k">end</span>
<span class="k">class</span> <span class="nc">C</span><span class="p">;</span> <span class="k">end</span>
<span class="no">C</span><span class="p">.</span><span class="nf">prepend</span> <span class="no">M</span>
<span class="no">C</span><span class="p">.</span><span class="nf">include</span> <span class="no">M</span>
<span class="no">M</span><span class="p">.</span><span class="nf">prepend</span> <span class="no">M</span> <span class="k">rescue</span> <span class="kp">nil</span>
<span class="k">module</span> <span class="nn">M2</span><span class="p">;</span> <span class="k">end</span>
<span class="no">M2</span><span class="p">.</span><span class="nf">prepend</span> <span class="no">M</span>
<span class="no">C</span><span class="p">.</span><span class="nf">include</span> <span class="no">M2</span>
<span class="nb">p</span> <span class="no">C</span><span class="p">.</span><span class="nf">ancestors</span> <span class="c1"># => [M, C, M2, M, M2, Object, Kernel, BasicObject]</span>
</code></pre>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">module</span> <span class="nn">M</span><span class="p">;</span> <span class="k">end</span>
<span class="k">class</span> <span class="nc">C</span><span class="p">;</span> <span class="k">end</span>
<span class="no">C</span><span class="p">.</span><span class="nf">prepend</span> <span class="no">M</span>
<span class="no">C</span><span class="p">.</span><span class="nf">include</span> <span class="no">M</span>
<span class="k">module</span> <span class="nn">M2</span><span class="p">;</span> <span class="k">end</span>
<span class="no">M2</span><span class="p">.</span><span class="nf">prepend</span> <span class="no">M</span>
<span class="no">C</span><span class="p">.</span><span class="nf">include</span> <span class="no">M2</span>
<span class="nb">p</span> <span class="no">C</span><span class="p">.</span><span class="nf">ancestors</span> <span class="c1"># => [M, C, M2, Object, Kernel, BasicObject]</span>
</code></pre>
Ruby master - Bug #17517 (Closed): File.expand_path returns us-ascii when both arguments are asci...
https://bugs.ruby-lang.org/issues/17517
2021-01-06T11:32:49Z
znz (Kazuhiro NISHIYAMA)
<p>Is this intentional?</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">p</span> <span class="n">__dir__</span><span class="p">.</span><span class="nf">encoding</span> <span class="c1">#=> #<Encoding:UTF-8></span>
<span class="nb">p</span> <span class="s1">'hoge'</span><span class="p">.</span><span class="nf">encoding</span> <span class="c1">#=> #<Encoding:UTF-8></span>
<span class="nb">p</span> <span class="no">File</span><span class="p">.</span><span class="nf">expand_path</span><span class="p">(</span><span class="s1">'hoge'</span><span class="p">,</span> <span class="n">__dir__</span><span class="p">).</span><span class="nf">encoding</span> <span class="c1">#=> #<Encoding:US-ASCII></span>
</code></pre>
<pre><code>% docker run -it --rm ghcr.io/ruby/all-ruby env ALL_RUBY_SINCE=ruby-1.9 ./all-ruby -e 'p File.expand_path("hoge".encode("utf-8"), "/".encode("utf-8")).encoding'
ruby-1.9.0-0 -e:1:in `encode': transcoding not supported (from ASCII-8BIT to UTF-8) (ArgumentError)
from -e:1:in `<main>'
exit 1
ruby-1.9.0-1 #<Encoding:ASCII-8BIT>
ruby-1.9.0-2 #<Encoding:US-ASCII>
...
ruby-1.9.1-p129 #<Encoding:US-ASCII>
ruby-1.9.1-p243 #<Encoding:UTF-8>
...
ruby-1.9.2-preview1 #<Encoding:UTF-8>
ruby-1.9.2-preview3 #<Encoding:US-ASCII>
...
ruby-3.0.0 #<Encoding:US-ASCII>
</code></pre>
Ruby master - Bug #17501 (Closed): TestNetHTTPS#test_get CI failure
https://bugs.ruby-lang.org/issues/17501
2021-01-02T15:29:00Z
znz (Kazuhiro NISHIYAMA)
<p>しばらく前から snapshot tarball の macos-latest で発生している <code>TestNetHTTPS#test_get</code> の failure ですが、手元の macOS Catalina 10.15.7 に homebrew で入れた <code>openssl@1.1: stable 1.1.1i (bottled) [keg-only]</code> の環境では SERVER_CERT, CA_CERT の順番を入れ替えると通るようになりました。</p>
<p>他の環境では試していないので、このままだと他の環境で通らなくなるかもしれません。</p>
<p>master や 3.0 では webrick は外されているので Closed でバックポート管理用のみのチケットとして作成しています。<br>
他のバージョンの snapshot tarball では確認していないので、 Backport 欄は 2.6 だけ REQUIRED にしています。</p>
<pre><code class="diff syntaxhl" data-language="diff"><span class="gd">--- test/net/http/test_https.rb.orig 2021-01-03 00:03:24.000000000 +0900
</span><span class="gi">+++ test/net/http/test_https.rb 2021-01-03 00:03:26.000000000 +0900
</span><span class="p">@@ -45,7 +45,7 @@</span>
assert_equal($test_net_http_data, res.body)
}
# TODO: OpenSSL 1.1.1h seems to yield only SERVER_CERT; need to check the incompatibility
<span class="gd">- certs.zip([SERVER_CERT, CA_CERT]) do |actual, expected|
</span><span class="gi">+ certs.zip([CA_CERT, SERVER_CERT]) do |actual, expected|
</span> assert_equal(expected.to_der, actual.to_der)
end
rescue SystemCallError
</code></pre>
<p>CI でのエラーのログ:<br>
<a href="https://github.com/ruby/actions/runs/1636574804?check_suite_focus=true#step:17:195" class="external">https://github.com/ruby/actions/runs/1636574804?check_suite_focus=true#step:17:195</a></p>
<pre><code>ruby -v: ruby 2.6.7p150 (2020-12-09 revision 67888) [x86_64-darwin19]
Run options: "--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=./test/excludes --name=!/memory_leak/ -q --tty=no --exclude=/testunit/ --exclude=/minitest/
# Running tests:
.SS.....S
Retrying...
1) Failure:
TestNetHTTPS#test_get [/Users/runner/work/actions/actions/snapshot-ruby_2_6/test/net/http/test_https.rb:49]:
<"0\x82\x03\xE30\x82\x02\xCB\xA0\x03\x02\x01\x02\x02\x01\x020\r\x06\t*\x86H\x86\xF7\r\x01\x01\v\x05\x000\x81\x8C1\v0\t\x06\x03U\x04\x06\x13\x02JP1\x100\x0E\x06\x03U\x04\b\f\aShimane1\x140\x12\x06\x03U\x04\a\f\vMatz-e city1\x170\x15\x06\x03U\x04\n" +
"\f\x0ERuby Core Team1\x150\x13\x06\x03U\x04\x03\f\fRuby Test CA1%0#\x06\t*\x86H\x86\xF7\r\x01\t\x01\x16\x16security@ruby-lang.org0\x1E\x17\r190102032713Z\x17\r240101032713Z0`1\v0\t\x06\x03U\x04\x06\x13\x02JP1\x100\x0E\x06\x03U\x04\b\f\aShimane1\x170\x15\x06\x03U\x04\n" +
"\f\x0ERuby Core Team1\x120\x10\x06\x03U\x04\v\f\tRuby Test1\x120\x10\x06\x03U\x04\x03\f\tlocalhost0\x82\x01\"0\r\x06\t*\x86H\x86\xF7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0F\x000\x82\x01\n" +
"\x02\x82\x01\x01\x00\xE8\xDA\x9C\x01.+\x10\xECI\xCD^\a\x13\a\x9Cp\x9E\xC6t\xBC\x13\xC2\xE1o\xC6\x82\xFD\xE3H\xE0,\xA5h\xC7\x9EB\xDE`Te\xE6j\x14Wz0\xD0\xCC\xB5\xB6\xD9\xC3\xD2\xDF\xC9%\x97Tg\xCF\xF6\xBE^\xCB\x8B\xEE\x03\xC5\xE1\xE2\xF9\xE7\xF7\xD1\fG\xF0\xB8\xDA3Z\xADA\xAD\xE7\xB5\xA2{\xB7\xBF0\xDA`\xF8\xE3T\xA2\xBC:\xFD\et\xD9\xDCtB\xE9)\xBE\xDF\xAC\xB4O\xEB2\xF4\x06\xF1\xE1\x8CK\xA8\x8B\xFB)\xE7\xB1\xBF\x1D\x01\xEEs\x0F\xF9@\xDC\xD5\x15y\xD9\xC6s\xD0\xC0\xDD\xCB\xE4\xDA\x19G\x80\xC6\x14\x04r\xFD\x9A|\x8F\x11\x82vI\x04y\xCC\xF2\\1\"\x95\x13>]@\xA6M\xE0\xA3\x02&}R;\xBB\xEDe\xA1\x0F\xEDk\xB0<\xD4\xDEa\x15^\xD3\xDDh\t\x9FJW\xA5\xC2\xA9m\x86\x92\xC5\xF4\xA4\xD4\xB7\x13;Rc$\x05\xE2\xCC\xE3\x8A<\xD454+\x10\xBBXr\xE7\xE1\x8D\x1Dt\x8Ca\x16 =\xD0\x1CN\x8Fn\xFD\xFEd\x10OA\x02\x03\x01\x00\x01\xA3{0y0\t\x06\x03U\x1D\x13\x04\x020\x000,\x06\t`\x86H\x01\x86\xF8B\x01\r\x04\x1F\x16\x1DOpenSSL Generated Certificate0\x1D\x06\x03U\x1D\x0E\x04\x16\x04\x14\xED(\xC2~\xABK\xC8\xE8\xFEUmf\x951\x1C-`\xF9\x0260\x1F\x06\x03U\x1D#\x04\x180\x16\x80\x14\xF6\xD1\")\xD5=#\xD7^\xAD\f\x9C\xE6u\x8F\x9D\xCD\xF8\x9DS0\r\x06\t*\x86H\x86\xF7\r\x01\x01\v\x05\x00\x03\x82\x01\x01\x00\x1D\xB8\xC5\x8BrA e\xAD'o\x15c\x06&\x12\x8D\x9C\xAD\xCA\xF4\xDB\x97\xB4\x90\xCB\xFF5\x94\xBB*\xA7\xA1\xAB\x1E5-\xA5?\xC9$\xB0\x1AX\x89u>\x81\n" +
",O\x98\xF9Q\xFB\xC0\xA3\t\xD0\n" +
"\x9B\xE7\xA2\xB7\xC3`@\xC8\xF4m\xB2jV\x12\x17L\x00$1\xDF\x9C`\xAE\xB1hT\xA9\xE6\xB5J\x04\xE6\x92\x05\x86\xD9Z\xDC\x960\xA5X\xDE\x14\x99\x0F\xE5\x15\x89>\x9B\xEB\x80\xE3\xBD\x83\xC3\xEA35K>/\xD3\rd\x93g\x7F\x8D\xF5?\f'\xBC7Z\xCC\xD6G\x16\xAFZb\xD2\xDAQ\xF8t\x06k$\xAD(h\b\x987}\xED\x0E\xAB\x1E\x82a\x05\xD0\xBAu\xA0\xAB!\xB0\x9A\xFD+T\x86\x1D\r\x1F\xC2\xD4w\x1Fr&^\xAD\x8A\x9F\t6mD\xBEt\xC2Z>\xFF\\\x9Du\xD68{\xC59\xF9Dn\xA1\xD1\x8E\xFFc\xDB\xC4\xBB\xC6\x91\x92\xCA\\`\x9B\x1D\xEB\n" +
"\xDE\b\xEE\xBF\xDAv\x03eb)\x8B\xF8\x7F\xC7\x86s\x1E\xF6\x1F-\x89i\xFD\xBE\xBDn"> expected but was
<"0\x82\x03\xED0\x82\x02\xD5\xA0\x03\x02\x01\x02\x02\t\x00\x89m\xBF\x1A\xC5\x02\xE4\xA70\r\x06\t*\x86H\x86\xF7\r\x01\x01\v\x05\x000\x81\x8C1\v0\t\x06\x03U\x04\x06\x13\x02JP1\x100\x0E\x06\x03U\x04\b\f\aShimane1\x140\x12\x06\x03U\x04\a\f\vMatz-e city1\x170\x15\x06\x03U\x04\n" +
"\f\x0ERuby Core Team1\x150\x13\x06\x03U\x04\x03\f\fRuby Test CA1%0#\x06\t*\x86H\x86\xF7\r\x01\t\x01\x16\x16security@ruby-lang.org0\x1E\x17\r190102025828Z\x17\r240101025828Z0\x81\x8C1\v0\t\x06\x03U\x04\x06\x13\x02JP1\x100\x0E\x06\x03U\x04\b\f\aShimane1\x140\x12\x06\x03U\x04\a\f\vMatz-e city1\x170\x15\x06\x03U\x04\n" +
"\f\x0ERuby Core Team1\x150\x13\x06\x03U\x04\x03\f\fRuby Test CA1%0#\x06\t*\x86H\x86\xF7\r\x01\t\x01\x16\x16security@ruby-lang.org0\x82\x01\"0\r\x06\t*\x86H\x86\xF7\r\x01\x01\x01\x05\x00\x03\x82\x01\x0F\x000\x82\x01\n" +
"\x02\x82\x01\x01\x00\xCEy[\x8D\x15a\xCFSe\xBA\xD1\xD5\xAE\x17\x06\x9C\xAF\x16\xD2\xAB\xA0\xDA\xE8\xCA^\xFDg\x8D \xB8S\xA9\xC9\x17\xAAr\xEC\x8FDy\xE8UI\xA2\x9E?+\xFE#\xDC\xF7+R\xE7}A\xCE\xB5F\xDD\xC1\xD2\x82\xEF\xBC\x8D\xEB\xA0:\xABf\xAA\xCE\xEEj\xD3\xDF\xCDK)\x1Cdc\x88\x17A\xAE\"\xD6\b\xDE{\xD6\xDC\x8A\x81u\xD7\xDF\xD9\xF7\xEC\xC9\x1F\xBD\xA4\x18\xDFo\x90\b<\xFD<Z\x8C\x05\xF6\xAE,\xD5\xE1\x94/\x06\\\xE3\r\x81\xF0\xF1a\xB7\x16\x005\xDE\xDD\x06\xF1\x8B\\Y\\\xB9\xFB\xFD\xB4;s\xC9\x18\xB8\xB7\xB7\xAA\xC4$I\x91\x94\bd\xD6z\fq\xC8&\xB3qz3\x88-\xF1\xCBj\xB25\xDB)<T\xAE\x8B\xD8\xB1\xB8Z\x01\xAA\xC9\xE7\x8F\x89\x1C\x9D\xD6\x8DLn\xE8\x80\x15\x8A\x80\xC2\x95\xCDQ\xB4J\x83\x93Zdl\x01\x1D\x99<Q\x9F\xAE\x14\xABu@\xC0TD\xEEQX\\\xB5s~=\x8D\xB5\xAC\xCD:\x85\xC8\xBE\v\x9D\xB8=\x1E\x10(\xC1\x02\x03\x01\x00\x01\xA3P0N0\x1D\x06\x03U\x1D\x0E\x04\x16\x04\x14\xF6\xD1\")\xD5=#\xD7^\xAD\f\x9C\xE6u\x8F\x9D\xCD\xF8\x9DS0\x1F\x06\x03U\x1D#\x04\x180\x16\x80\x14\xF6\xD1\")\xD5=#\xD7^\xAD\f\x9C\xE6u\x8F\x9D\xCD\xF8\x9DS0\f\x06\x03U\x1D\x13\x04\x050\x03\x01\x01\xFF0\r\x06\t*\x86H\x86\xF7\r\x01\x01\v\x05\x00\x03\x82\x01\x01\x00\xC6>\xC5\xFE\xED\xC2\xDD\xF8*\xDB\x83{\x84d@\xA1\xFE\xC2\x94T1\x1Aj? d\xF4\x00\x84\xB3[q\xE2U\x88\x85j)\n" +
"\x85\xB3\xB57\x00\xFDh\x1AC\xF1\x9C\x1E\xEBk\x02\xA8\xC8|\x8Ce\x7FoO\xAAh\xE3\x91\x9Df\r\xCBdz\xAF\xD1d\x01 \x96gE\xEB\x19\xF7n\x18\x06\x0F\x99l\xE2\x90\xAFpoE\xCAq\xA7\x19\xCD\xB8\x83\xA3+\x8CSk\x05\x85\x12\xDA\"\x19\xB2\r\xFA\x8BB\t\xB3\n" +
"?\x0F.\x87.\x98B\x9A\xCD\x810 \xF7\r\xE5\xAD~7\x8FR$\xE6@rh\xE8{\x10 \xA3\xFF\xBB\x83x\x16\xF7\x9E\xB8\xC0H\x9D\xE8\xB63\x85T\xEF\x87\xCB]\xB9\x8A\x97Q}\x00E\xFB$3\xF7\x04\xA4\x99\e_B\x87\x9AgR\x8E.\\\xCDn51\xAC\x8BN\xCF\xE1\x8D,+\x8E>H\xA0B\xD1\xB6\x04\x15\xB0\xCA\xD1\xE4\x162\xB5\xF7\x90\x88d?\x1C\x88Z\x1C]\xAB\xDF\xCD\xA8\xF6#J\e\x92\x10\b@\xE8$\xA9\x99\x184\xA6\xA7>\x98">.
Finished tests in 172.436403s, 118.3741 tests/s, 13007.3405 assertions/s.
20412 tests, 2242939 assertions, 1 failures, 0 errors, 70 skips
</code></pre>
Ruby master - Feature #17361 (Closed): lambda(&block) does not warn with lazy proc allocation
https://bugs.ruby-lang.org/issues/17361
2020-12-03T02:45:23Z
znz (Kazuhiro NISHIYAMA)
<p>In NEWS,</p>
<pre><code> * Kernel#lambda now warns if called without a literal block.
[[Feature #15973]]
</code></pre>
<p>But the following code from <a href="https://docs.ruby-lang.org/ja/latest/method/Kernel/m/lambda.html" class="external">https://docs.ruby-lang.org/ja/latest/method/Kernel/m/lambda.html</a> (<a href="https://github.com/rurema/doctree/blob/495868c466c97c9bcca28d64d6ce0d68350de3e2/refm/api/src/_builtin/functions#L2436-L2441" class="external">https://github.com/rurema/doctree/blob/495868c466c97c9bcca28d64d6ce0d68350de3e2/refm/api/src/_builtin/functions#L2436-L2441</a>) does not warn.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">def</span> <span class="nf">foo</span> <span class="o">&</span><span class="n">block</span>
<span class="nb">lambda</span><span class="p">(</span><span class="o">&</span><span class="n">block</span><span class="p">)</span>
<span class="k">end</span>
<span class="n">it</span> <span class="o">=</span> <span class="n">foo</span><span class="p">{</span><span class="nb">p</span> <span class="mi">12</span><span class="p">}</span>
<span class="n">it</span><span class="p">.</span><span class="nf">call</span> <span class="c1">#=> 12</span>
</code></pre>
<p>Once block assign to a local variable, it warns.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">def</span> <span class="nf">foo</span> <span class="o">&</span><span class="n">block</span>
<span class="n">b</span> <span class="o">=</span> <span class="n">block</span>
<span class="nb">lambda</span><span class="p">(</span><span class="o">&</span><span class="n">b</span><span class="p">)</span>
<span class="k">end</span>
<span class="n">it</span> <span class="o">=</span> <span class="n">foo</span><span class="p">{</span><span class="nb">p</span> <span class="mi">12</span><span class="p">}</span>
<span class="n">it</span><span class="p">.</span><span class="nf">call</span> <span class="c1">#=> 12</span>
</code></pre>
Ruby master - Bug #17358 (Closed): Backport 1ca9facab6c85264168b4c0a18c24f489cabcc9f
https://bugs.ruby-lang.org/issues/17358
2020-12-01T07:13:52Z
znz (Kazuhiro NISHIYAMA)
<p>monitor が C 実装になったときから rdoc が生成されなくなっていたようで、 <code>ext/.document</code> に追加する必要があったようです。</p>
<p>C 実装になったのが 2.7 からで、2.6 以前には影響しないようなので、2.7 へのバックポートをお願いします。</p>
Ruby master - Bug #17254 (Closed): ENV.replace may set nil instead of the proper value
https://bugs.ruby-lang.org/issues/17254
2020-10-08T10:20:52Z
znz (Kazuhiro NISHIYAMA)
<p>On docs.ruby-lang.org, it uses <a href="https://snapcraft.io/ruby" class="external">snap ruby</a>, and it failed to run <code>rdoc</code>.</p>
<pre><code>Oct 07 13:20:08 docs-2020.ruby-lang.org env[6183]: rdoc --title Documentation for Ruby master --main README.md --output /var/www/docs.ruby-lang.org/releases/20200916140300/master -U --all --encoding=UTF-8 .
Oct 07 13:20:08 docs-2020.ruby-lang.org env[6183]: <internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
Oct 07 13:20:08 docs-2020.ruby-lang.org env[6183]: from <internal:gem_prelude>:1:in `<internal:gem_prelude>'
Oct 07 13:20:08 docs-2020.ruby-lang.org env[6183]: rake aborted!
</code></pre>
<p>I investigate it, it caused by setting nil instead of the proper value in <code>ENV.replace</code>.</p>
<pre><code>vagrant@buster:/tmp/t$ cat Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
# gem "rails"
vagrant@buster:/tmp/t$ env PATH=/var/www/docs.ruby-lang.org/shared/bundle/ruby/2.7.0/bin:/snap/bin:$PATH DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=1 bundle exec env -u RUBYOPT ruby -r/snap/ruby/189/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/setup -e 'p ENV["RUBYLIB"]'
"/snap/ruby/189/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib"
</code></pre>
<p>Calling <code>ENV.clear</code> before <code>ENV.replace</code> resolves this issue.</p>
<pre><code>vagrant@buster:/tmp/t$ cat /tmp/clear-before-replace.rb
class << ENV
alias orig_replace replace
def replace(h)
clear
orig_replace(h)
end
end
vagrant@buster:/tmp/t$ env PATH=/var/www/docs.ruby-lang.org/shared/bundle/ruby/2.7.0/bin:/snap/bin:$PATH DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=1 bundle exec env -u RUBYOPT ruby -r/tmp/clear-before-replace -r/snap/ruby/189/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/setup -e 'p ENV["RUBYLIB"]'
"/snap/ruby/189/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib:/snap/ruby/189/lib/ruby/2.7.0:/snap/ruby/189/lib/ruby/2.7.0/amd64"
</code></pre>
<p>Where should call <code>ENV.clear</code>?<br>
In <code>ENV.replace</code> or caller of <code>ENV.replace</code>?</p>
Ruby master - Bug #17217 (Closed): Backport request: GitHub Actions set-env → $GITHUB_ENV
https://bugs.ruby-lang.org/issues/17217
2020-10-06T02:48:08Z
znz (Kazuhiro NISHIYAMA)
<p>Please backport <a href="https://github.com/ruby/ruby/pull/3630" class="external">https://github.com/ruby/ruby/pull/3630</a></p>
<p><code>set-env</code> is deprecated, and it will be disabled in the future.</p>
<p><a href="https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/" class="external">https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/</a></p>
<blockquote>
<p>We are monitoring telemetry for the usage of these commands and plan to fully disable them in the future.</p>
</blockquote>
Ruby master - Feature #17173 (Open): open-uri で ciphers を設定したい
https://bugs.ruby-lang.org/issues/17173
2020-09-16T04:55:19Z
znz (Kazuhiro NISHIYAMA)
<p>Debian GNU/Linux 10 (buster) の OpenSSL 1.1.1d の環境だと <a href="https://www.famitsu.com" class="external">https://www.famitsu.com</a> で <code>dh key too small</code> になってつながらないのですが、 <code>ciphers</code> に <code>DEFAULT:!DH</code> を設定するとつながるので、 <code>open-uri</code> 経由でも <code>ciphers</code> を設定したいです。</p>
<p>curl での確認:</p>
<pre><code>% curl --head https://www.famitsu.com/
curl: (35) error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small
zsh: exit 35 curl --head https://www.famitsu.com/
% curl --ciphers 'DEFAULT:!DH' --head https://www.famitsu.com/
HTTP/1.1 200 OK
Server: nginx/1.12.2
Date: Wed, 16 Sep 2020 04:48:25 GMT
Content-Type: text/html
Connection: keep-alive
Vary: Accept-Encoding
Accept-Ranges: bytes
Vary: Accept-Encoding
Strict-Transport-Security: max-age=60
</code></pre>
<p>ruby での確認:</p>
<pre><code>% ruby -r open-uri -e 'open("https://www.famitsu.com/")'
Traceback (most recent call last):
13: from -e:1:in `<main>'
12: from /usr/lib/ruby/2.5.0/open-uri.rb:35:in `open'
11: from /usr/lib/ruby/2.5.0/open-uri.rb:735:in `open'
10: from /usr/lib/ruby/2.5.0/open-uri.rb:165:in `open_uri'
9: from /usr/lib/ruby/2.5.0/open-uri.rb:224:in `open_loop'
8: from /usr/lib/ruby/2.5.0/open-uri.rb:224:in `catch'
7: from /usr/lib/ruby/2.5.0/open-uri.rb:226:in `block in open_loop'
6: from /usr/lib/ruby/2.5.0/open-uri.rb:755:in `buffer_open'
5: from /usr/lib/ruby/2.5.0/open-uri.rb:337:in `open_http'
4: from /usr/lib/ruby/2.5.0/net/http.rb:909:in `start'
3: from /usr/lib/ruby/2.5.0/net/http.rb:920:in `do_start'
2: from /usr/lib/ruby/2.5.0/net/http.rb:985:in `connect'
1: from /usr/lib/ruby/2.5.0/net/protocol.rb:44:in `ssl_socket_connect'
/usr/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: dh key too small (OpenSSL::SSL::SSLError)
zsh: exit 1 ruby -r open-uri -e 'open("https://www.famitsu.com/")'
% ruby -r net/http -e 'http=Net::HTTP.new("www.famitsu.com", 443); http.use_ssl=true; http.ciphers="DEFAULT:!DH"; p http.get("/")'
#<Net::HTTPOK 200 OK readbody=true>
</code></pre>
<p><a href="https://www.ssllabs.com/ssltest/analyze.html?d=www.famitsu.com" class="external">https://www.ssllabs.com/ssltest/analyze.html?d=www.famitsu.com</a> によると Cipher Suites は</p>
<pre><code># TLS 1.2 (suites in server-preferred order)
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x9f) DH 1024 bits FS WEAK 256
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x9e) DH 1024 bits FS WEAK 128
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x6b) DH 1024 bits FS WEAK 256
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x67) DH 1024 bits FS WEAK 128
TLS_RSA_WITH_AES_256_GCM_SHA384 (0x9d) WEAK 256
TLS_RSA_WITH_AES_128_GCM_SHA256 (0x9c) WEAK 128
TLS_RSA_WITH_AES_256_CBC_SHA256 (0x3d) WEAK 256
TLS_RSA_WITH_AES_128_CBC_SHA256 (0x3c) WEAK 128
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) ECDH secp384r1 (eq. 7680 bits RSA) FS 256
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) ECDH secp384r1 (eq. 7680 bits RSA) FS 128
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028) ECDH secp384r1 (eq. 7680 bits RSA) FS WEAK 256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027) ECDH secp384r1 (eq. 7680 bits RSA) FS WEAK 128
</code></pre>
<p>となっていて、 Handshake Simulation では</p>
<pre><code>Chrome 80 / Win 10 R RSA 2048 (SHA256) TLS 1.2 TLS_RSA_WITH_AES_256_GCM_SHA384 No FS
Firefox 73 / Win 10 R RSA 2048 (SHA256) TLS 1.2 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ECDH secp256r1 FS
OpenSSL 1.1.1c R RSA 2048 (SHA256) TLS 1.2 TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 DH 1024 FS
</code></pre>
<p>のようになっていて、 <code>TLS_DHE_RSA_WITH_AES_256_GCM_SHA384</code> が選ばれて DH 1024 bit を拒否するクライアントからは繋らない設定になっているサーバーがあるようです。(<code>dh key too small</code> で web 検索すると同様の設定のサーバーは他にもあるようです。)</p>
Ruby master - Feature #17157 (Closed): Remove `ruby -T`
https://bugs.ruby-lang.org/issues/17157
2020-09-06T10:12:11Z
znz (Kazuhiro NISHIYAMA)
<p>Warning says that it will be removed in Ruby 3.0.</p>
<pre><code>% ruby -T1 -e ''
ruby: warning: ruby -T will be removed in Ruby 3.0
</code></pre>
Ruby master - Feature #17136 (Closed): Remove special behavior from $KCODE
https://bugs.ruby-lang.org/issues/17136
2020-08-31T06:36:43Z
znz (Kazuhiro NISHIYAMA)
<p><code>$SAFE</code> is now a normal global variable with no special behavior.<br>
I think <code>$KCODE</code>'s special behavior is also no longer needed.<br>
Warnings since 1.9.</p>
<pre><code>% docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-1.4 ./all-ruby -e '$KCODE="e"; p $KCODE'
ruby-1.4.0 "EUC"
...
ruby-1.8.7-p374 "EUC"
ruby-1.9.0-0 -e:1: warning: variable $KCODE is no longer effective; ignored
-e:1: warning: variable $KCODE is no longer effective
nil
...
ruby-2.7.1 -e:1: warning: variable $KCODE is no longer effective; ignored
-e:1: warning: variable $KCODE is no longer effective
nil
</code></pre>
Ruby master - Feature #17125 (Closed): Remove Thread.exclusive
https://bugs.ruby-lang.org/issues/17125
2020-08-19T05:13:44Z
znz (Kazuhiro NISHIYAMA)
<p><code>Thread.exclusive</code> is deprecated since 2.3.</p>
<pre><code>% docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-1.8 ./all-ruby -r thread -e 'Thread.exclusive{}'
ruby-1.8.0
...
ruby-2.3.0-preview1
ruby-2.3.0-preview2 Thread.exclusive is deprecated, use Mutex
-e:1:in `<main>'
...
ruby-2.4.0-preview1 Thread.exclusive is deprecated, use Mutex
-e:1:in `<main>'
ruby-2.4.0-preview2 Thread.exclusive is deprecated, use Thread::Mutex
-e:1:in `<main>'
...
ruby-2.7.0-preview1 Thread.exclusive is deprecated, use Thread::Mutex
-e:1:in `<main>'
ruby-2.7.0-preview2 -e:1: warning: Thread.exclusive is deprecated, use Thread::Mutex
...
ruby-2.7.1 -e:1: warning: Thread.exclusive is deprecated, use Thread::Mutex
</code></pre>
Ruby master - Feature #17039 (Closed): Remove Time#succ
https://bugs.ruby-lang.org/issues/17039
2020-07-21T11:43:14Z
znz (Kazuhiro NISHIYAMA)
<p><code>Time#succ</code> is obsolete since 1.9.2.</p>
<pre><code>% docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-1.8 ./all-ruby -e 'Time.at(0).succ'
ruby-1.8.0 -e:1: undefined method `succ' for Thu Jan 01 00:00:00 UTC 1970:Time (NoMethodError)
exit 1
ruby-1.8.1
...
ruby-1.9.2-preview1
ruby-1.9.2-preview3 -e:1: warning: Time#succ is obsolete; use time + 1
...
ruby-2.7.1 -e:1: warning: Time#succ is obsolete; use time + 1
</code></pre>
Ruby master - Bug #16949 (Closed): Psych tests failed with libyaml 0.2.5
https://bugs.ruby-lang.org/issues/16949
2020-06-10T15:04:03Z
znz (Kazuhiro NISHIYAMA)
<p>GitHub Actions CI failed on macOS, because Homebrew's <a href="https://github.com/Homebrew/homebrew-core/blob/90fecdb1745b65abb9883c2ad76b4e22e297b8ff/Formula/libyaml.rb" class="external">libyaml</a> is 0.2.5 now.<br>
So please backport <a class="changeset" title="[ruby/psych] Fixing compatibility with libyaml 0.2.5 The main issue is that commas aren't allowe..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/7e289cdf3fed588b2d5a6973e29f9ff95cb8d76c">7e289cdf3fed588b2d5a6973e29f9ff95cb8d76c</a>.</p>
<p><a href="https://github.com/ruby/actions/runs/757794503?check_suite_focus=true#step:17:194" class="external">https://github.com/ruby/actions/runs/757794503?check_suite_focus=true#step:17:194</a><br>
<a href="https://github.com/ruby/actions/runs/757791921?check_suite_focus=true#step:17:195" class="external">https://github.com/ruby/actions/runs/757791921?check_suite_focus=true#step:17:195</a><br>
<a href="https://github.com/ruby/actions/runs/757793556?check_suite_focus=true#step:16:147" class="external">https://github.com/ruby/actions/runs/757793556?check_suite_focus=true#step:16:147</a></p>
Ruby master - Bug #16901 (Closed): `-W:no-deprecated` does not stop some deprecated warnings
https://bugs.ruby-lang.org/issues/16901
2020-05-20T03:00:02Z
znz (Kazuhiro NISHIYAMA)
<pre><code>$ ruby -v -W:no-deprecated -e 'IO.read(IO::NULL,{dummy:0})'
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
-e:1: warning: Using the last argument as keyword parameters is deprecated
</code></pre>
<p>I attach a draft patch for ruby_2_7 branch.<br>
I don't know where declaration of <code>rb_warn_deprecated</code> should be.</p>
Ruby master - Bug #16639 (Closed): ARGF.each_line(chomp: true) cannot call without warning
https://bugs.ruby-lang.org/issues/16639
2020-02-18T02:30:46Z
znz (Kazuhiro NISHIYAMA)
<p><code>ARGF.each_line</code> with keyword arguments shows warnings on 2.7.0, and does not work on current master.</p>
<pre><code>$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin18]
$ ruby -e 'p ARGF.each_line(chomp: true).first' < /etc/hosts
-e:1: warning: Using the last argument as keyword parameters is deprecated
"##"
$ ruby -e 'p ARGF.each_line({chomp: true}).first' < /etc/hosts
-e:1: warning: Using the last argument as keyword parameters is deprecated
"##"
$ ruby -e 'p ARGF.each_line(**{chomp: true}).first' < /etc/hosts
-e:1: warning: Using the last argument as keyword parameters is deprecated
"##"
</code></pre>
<p><code>IO#each_line(chomp: true)</code> does not show warnings, and works on current master.</p>
<pre><code>ruby -e 'p ARGF.to_io.each_line(chomp: true).first' < /etc/hosts
"##"
</code></pre>
Ruby master - Misc #16630 (Assigned): Deprecate pub/ruby/*snapshot* and use pub/ruby/snapshot/* i...
https://bugs.ruby-lang.org/issues/16630
2020-02-13T08:51:43Z
znz (Kazuhiro NISHIYAMA)
<p>In <a href="https://www.ruby-lang.org/en/downloads/" class="external">https://www.ruby-lang.org/en/downloads/</a>, snapshots links to <code>pub/ruby/snapshot.*</code> and <code>pub/ruby/stable-snapshot.*</code> as official snapshot tarballs now.</p>
<p>I want to change links to snapshot tarballs in <a href="https://cache.ruby-lang.org/pub/ruby/snapshot/" class="external">https://cache.ruby-lang.org/pub/ruby/snapshot/</a>.</p>
<p>They created by <a href="https://github.com/ruby/actions/" class="external">https://github.com/ruby/actions/</a> now.</p>
<p>Tarballs under <code>pub/ruby/snapshot/</code> have branch name (e.g. <code>ruby_2_7</code>) in filenames.<br>
And they are tested. (but they remain even if tests failed.)</p>
<p><code>pub/ruby/*snapshot.*</code> are not tested.<br>
And there are fewer files under <code>pub/ruby/</code> without sub-directory recently. (e.g. <code>ruby- 2.7.*</code> are in <code>pub/ruby/2.7/</code> only.)<br>
So I want to remove them.</p>
<p>Because of the plan, <code>stable-snapshot.*</code> are still snapshot of <code>ruby_2_6</code> instead of <code>ruby_2_7</code>.</p>
Ruby master - Feature #16513 (Closed): TracePoint#inspect to return "... file:line" instead of "....
https://bugs.ruby-lang.org/issues/16513
2020-01-16T08:46:10Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://bugs.ruby-lang.org/issues/16101" class="external"><code>Proc#to_s</code></a> and <a href="https://bugs.ruby-lang.org/issues/16412" class="external"><code>Thread#to_s</code></a> have changed, but <code>TracePoint#inspect</code> includes <code>@</code>.</p>
<p>I think changing <code>TracePoint#inspect</code> too is better for consistency.</p>
<pre><code>% ruby -ve 'TracePoint.new{p _1}.enable;p'
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin18]
#<TracePoint:c_call `p'@-e:1>
#<TracePoint:c_return `p'@-e:1>
</code></pre>
Ruby master - Misc #16483 (Closed): How about stopping new *.tar.bz2 releases?
https://bugs.ruby-lang.org/issues/16483
2020-01-06T07:02:19Z
znz (Kazuhiro NISHIYAMA)
<p>Current ruby releases generate <code>*.tar.gz</code>, <code>*.tar.bz2</code>, <code>*.tar.xz</code>, and <code>*.zip</code>.<br>
But I think we can stop generating <code>*.tar.bz2</code>.</p>
<p>I think <code>*.tar.bz2</code> are less merit.<br>
For better size, <code>*.tar.xz</code> exist.<br>
For better compatibility, <code>*.tar.gz</code> and <code>*.zip</code> exist.</p>
<p>I check some programming languages source package archives.</p>
<ul>
<li>
<a href="https://jdk.java.net/13/" class="external">https://jdk.java.net/13/</a> tar.gz zip</li>
<li>
<a href="https://gcc.gnu.org/mirrors.html" class="external">https://gcc.gnu.org/mirrors.html</a> tar.gz tar.xz</li>
<li>
<a href="https://www.python.org/downloads/source/" class="external">https://www.python.org/downloads/source/</a> tgz tar.xz</li>
<li>
<a href="https://nodejs.org/dist/v12.14.0/" class="external">https://nodejs.org/dist/v12.14.0/</a> tar.gz tar.xz (and 7z zip for win)</li>
<li>
<a href="https://www.perl.org/get.html" class="external">https://www.perl.org/get.html</a> tar.gz</li>
<li>
<a href="https://www.php.net/downloads.php" class="external">https://www.php.net/downloads.php</a> tar.bz2 tar.gz tar.xz</li>
</ul>
<p><code>tar.bz2</code> are rare.</p>
<p>How about stopping <code>*.tar.bz2</code> since next release?</p>
<p>(I know <a href="https://github.com/rbenv/ruby-build" class="external">ruby-build</a> use <code>*.tar.bz2</code>. And it can use <code>*.tar.gz</code>)</p>
Ruby master - Bug #16445 (Closed): Time#inspect shows a fractional number
https://bugs.ruby-lang.org/issues/16445
2019-12-23T02:18:40Z
znz (Kazuhiro NISHIYAMA)
<p><code>Time#inspect</code> shows a fractional number.</p>
<pre><code>irb(main):001:0> Time.at(0.5)
=> 1970-01-01 09:00:00.5 +0900
irb(main):002:0> Time.at(0.1)
=> 1970-01-01 09:00:00 3602879701896397/36028797018963968 +0900
</code></pre>
<p>Is this intentional?</p>
Ruby master - Bug #16424 (Closed): abort without arguments does not print error info
https://bugs.ruby-lang.org/issues/16424
2019-12-15T06:17:06Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://docs.ruby-lang.org/ja/2.0.0/method/Kernel/m/abort.html" class="external">https://docs.ruby-lang.org/ja/2.0.0/method/Kernel/m/abort.html</a><br>
には「引数を省略した呼び出し時に $! が nil でなければその例外の メッセージを標準エラー出力 $stderr に出力」されるとありますが、 1.9 から出力されなくなっているようです。</p>
<pre><code>% docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-1.6 ./all-ruby -e 'begin;raise "foo";rescue;abort;end'
ruby-1.6.0 -e:1: foo (RuntimeError)
exit 1
...
ruby-1.8.7-p374 -e:1: foo (RuntimeError)
exit 1
ruby-1.9.0-0 exit 1
...
ruby-2.7.0-preview3 exit 1
</code></pre>
<p>笹田さんに直接確認してみたところ、バグということだったので、チケットとして登録しておきます。</p>
Ruby master - Feature #16420 (Closed): Warning[:experimental]=false
https://bugs.ruby-lang.org/issues/16420
2019-12-14T14:42:57Z
znz (Kazuhiro NISHIYAMA)
<p>Current master always warn pattern matching syntax.<br>
It discourage users try them.</p>
<p>Another noisy warnings can stop by <code>Warning[:deprecated]=false</code>.</p>
<p>So I think the future may be more useful if <code>Warning[:experimental]=false</code> or <code>Warning[:pattern_matching]=false</code> can stop warnings.</p>
Ruby master - Feature #16419 (Closed): FrozenError.new ignores receiver:
https://bugs.ruby-lang.org/issues/16419
2019-12-14T07:29:44Z
znz (Kazuhiro NISHIYAMA)
<p>Other exception classes with receiver accept recevier as keyword argument of new.<br>
But FrozenError.new accept as positional argument.<br>
I think keyword argument is better consistency.</p>
<pre><code>% git grep 'receiver[:=]' ../error.c
../error.c: * FrozenError.new(msg=nil, receiver=nil) -> name_error
../error.c: * NameError.new(msg=nil, name=nil, receiver: nil) -> name_error
../error.c: * [1, 2, 3].method(:rject) # NameError with name "rject" and receiver: Array
../error.c: * [1, 2, 3].singleton_method(:rject) # NameError with name "rject" and receiver: [1, 2, 3]
../error.c: * NoMethodError.new(msg=nil, name=nil, args=nil, private=false, receiver: nil) -> no_method_error
../error.c: * KeyError.new(message=nil, receiver: nil, key: nil) -> key_error
</code></pre>
Ruby master - Feature #16412 (Closed): Thread#to_s to return "... file:line" instead of "...@file...
https://bugs.ruby-lang.org/issues/16412
2019-12-10T00:58:56Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://bugs.ruby-lang.org/issues/16101" class="external">Proc#to_s returns "... file:line" instead of "...@file:line"</a>, but <code>Thread#to_s</code> includes <code>@</code>.</p>
<p>I think changing <code>Thread#to_s</code> too is better for consistency.</p>
Ruby master - Feature #16356 (Open): Method#inspect of argument forwarding
https://bugs.ruby-lang.org/issues/16356
2019-11-20T10:58:11Z
znz (Kazuhiro NISHIYAMA)
<p>Current behavior includes <code>(**, &&)</code>.<br>
Is this intentional?</p>
<pre><code>% ruby -e 'def mf(...);end;p method(:mf)'
#<Method: main.mf(**, &&) -e:1>
</code></pre>
<p>I added tests of current behavior at <a href="https://github.com/ruby/ruby/commit/777973084e599cf9efa490173709b187fb507f90" class="external">https://github.com/ruby/ruby/commit/777973084e599cf9efa490173709b187fb507f90</a></p>
Ruby master - Bug #16353 (Closed): Backport 2a477e0e444de6344048101466fb9189b9defddc
https://bugs.ruby-lang.org/issues/16353
2019-11-19T06:37:25Z
znz (Kazuhiro NISHIYAMA)
<p>Please backport 2a477e0e444de6344048101466fb9189b9defddc to ruby_2_5.<br>
It may avoid occasional errors on macos.</p>
<p><a href="https://github.com/ruby/actions/runs/309307228#step:17:201" class="external">https://github.com/ruby/actions/runs/309307228#step:17:201</a></p>
<pre><code> 1) Error:
FTPTest#test_retrbinary_read_timeout_not_exceeded:
Net::ReadTimeout: Net::ReadTimeout
</code></pre>
<p><a href="https://github.com/ruby/actions/runs/309307228#step:17:216" class="external">https://github.com/ruby/actions/runs/309307228#step:17:216</a></p>
<pre><code> 2) Error:
FTPTest#test_retrbinary_read_timeout_not_exceeded:
Errno::EPIPE: Broken pipe
</code></pre>
<p><a href="https://github.com/ruby/actions/runs/322975425#step:17:202" class="external">https://github.com/ruby/actions/runs/322975425#step:17:202</a></p>
<pre><code> 1) Error:
FTPTest#test_retrbinary_read_timeout_not_exceeded:
Net::ReadTimeout: Net::ReadTimeout
</code></pre>
<p><a href="https://github.com/ruby/actions/runs/322975425#step:17:217" class="external">https://github.com/ruby/actions/runs/322975425#step:17:217</a></p>
<pre><code> 2) Error:
FTPTest#test_retrbinary_read_timeout_not_exceeded:
Errno::EPIPE: Broken pipe
</code></pre>
<p><a href="https://github.com/ruby/actions/runs/326044909#step:17:198" class="external">https://github.com/ruby/actions/runs/326044909#step:17:198</a></p>
<pre><code> 1) Error:
FTPTest#test_read_timeout_not_exceeded:
Net::ReadTimeout: Net::ReadTimeout
</code></pre>
Ruby master - Bug #16189 (Closed): Some rubygems tests failed when run across 0:00 UTC
https://bugs.ruby-lang.org/issues/16189
2019-09-30T01:44:51Z
znz (Kazuhiro NISHIYAMA)
<p>Some tests failed because <a href="https://github.com/ruby/ruby/blob/649a64ae29318501472f74798a12eb60871ab990/lib/rubygems/specification.rb#L106-L107" class="external">https://github.com/ruby/ruby/blob/649a64ae29318501472f74798a12eb60871ab990/lib/rubygems/specification.rb#L106-L107</a> set TODAY as 2019-09-29, and tests run on 2019-09-30.</p>
<p><a href="https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20190929T232504Z.fail.html.gz" class="external">https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20190929T232504Z.fail.html.gz</a></p>
<pre><code> 1) Failure:
TestGemSpecification#test_to_ruby_for_cache [/export/home/rubyci/chkbuild-sunc/tmp/build/20190929T232504Z/ruby/test/rubygems/test_gem_specification.rb:2518]:
--- expected
+++ actual
@@ -18,7 +18,7 @@
" +
" s.authors = [\"A User\".freeze]
" +
-" s.date = \"2019-09-29\"
+" s.date = \"2019-09-30\"
" +
" s.description = \"This is a test description\".freeze
" +
2) Failure:
TestGemSpecification#test_metadata_specs [/export/home/rubyci/chkbuild-sunc/tmp/build/20190929T232504Z/ruby/test/rubygems/test_gem_specification.rb:3651]:
--- expected
+++ actual
@@ -20,7 +20,7 @@
" +
" s.authors = [\"A User\".freeze]
" +
-" s.date = \"2019-09-30\"
+" s.date = \"2019-09-29\"
" +
" s.description = \"This is a test description\".freeze
" +
3) Failure:
TestGemSpecification#test_to_ruby [/export/home/rubyci/chkbuild-sunc/tmp/build/20190929T232504Z/ruby/test/rubygems/test_gem_specification.rb:2441]:
--- expected
+++ actual
@@ -18,7 +18,7 @@
" +
" s.authors = [\"A User\".freeze]
" +
-" s.date = \"2019-09-29\"
+" s.date = \"2019-09-30\"
" +
" s.description = \"This is a test description\".freeze
" +
4) Failure:
TestGemSpecification#test_to_ruby_fancy [/export/home/rubyci/chkbuild-sunc/tmp/build/20190929T232504Z/ruby/test/rubygems/test_gem_specification.rb:2581]:
--- expected
+++ actual
@@ -22,7 +22,7 @@
" +
" s.authors = [\"A User\".freeze]
" +
-" s.date = \"2019-09-29\"
+" s.date = \"2019-09-30\"
" +
" s.description = \"This is a test description\".freeze
" +
5) Failure:
TestGemSpecification#test_self_load_legacy_ruby [/export/home/rubyci/chkbuild-sunc/tmp/build/20190929T232504Z/ruby/test/rubygems/test_gem_specification.rb:1038]:
Expected: 2019-09-29 00:00:00 UTC
Actual: 2019-09-30 00:00:00 UTC
6) Failure:
TestGemSpecification#test_to_ruby_with_rsa_key [/export/home/rubyci/chkbuild-sunc/tmp/build/20190929T232504Z/ruby/test/rubygems/test_gem_specification.rb:2474]:
--- expected
+++ actual
@@ -18,7 +18,7 @@
" +
" s.authors = [\"A User\".freeze]
" +
-" s.date = \"2019-09-29\"
+" s.date = \"2019-09-30\"
" +
" s.description = \"This is a test description\".freeze
" +
7) Failure:
TestGemSpecification#test_date [/export/home/rubyci/chkbuild-sunc/tmp/build/20190929T232504Z/ruby/test/rubygems/test_gem_specification.rb:1697]:
Expected: 2019-09-29 00:00:00 UTC
Actual: 2019-09-30 00:00:00 UTC
</code></pre>
Ruby master - Bug #16177 (Closed): Some `*.rb` files on builddir cause Segmentation fault
https://bugs.ruby-lang.org/issues/16177
2019-09-24T10:05:16Z
znz (Kazuhiro NISHIYAMA)
<p>How to reproduce:</p>
<ol>
<li>Create dummy files by <code>./miniruby -e '%w[a b foo bar test zzz].each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}'</code>
</li>
<li>Run <code>ruby/test_autoload.rb</code> like <code>make test-all TESTS='ruby/test_autoload.rb'</code>
</li>
</ol>
<p>Error log from raw logs:</p>
<pre><code>2019-09-24T09:48:24.3773590Z 2) Failure:
2019-09-24T09:48:24.3773760Z TestAutoload#test_autoload_same_file [/Users/runner/runners/2.158.0/work/ruby/ruby/test/ruby/test_autoload.rb:332]:
2019-09-24T09:48:24.3773930Z pid 39572 killed by SIGABRT (signal 6)
2019-09-24T09:48:24.3774450Z | #<Thread:0x00007f8851176ac0@-:9 run> terminated with exception (report_on_exception is true):
2019-09-24T09:48:24.3775010Z | /Users/runner/runners/2.158.0/work/ruby/ruby/b.rb:1:in `<top (required)>': do not load b.rb (RuntimeError)
2019-09-24T09:48:24.3775480Z | from -:9:in `require'
2019-09-24T09:48:24.3775910Z | from -:9:in `block in <main>'
2019-09-24T09:48:24.3776390Z | -:10: [BUG] Segmentation fault at 0x0000000000000019
</code></pre>
<p>attached full raw logs of <a href="https://github.com/ruby/ruby/pull/2482/checks?check_run_id=233890903#step:11:1" class="external">https://github.com/ruby/ruby/pull/2482/checks?check_run_id=233890903#step:11:1</a></p>
Ruby master - Feature #16003 (Closed): Remove doc/etc.rd.ja?
https://bugs.ruby-lang.org/issues/16003
2019-07-15T01:59:35Z
znz (Kazuhiro NISHIYAMA)
<p>doc/etc.rd.ja は</p>
<ul>
<li>情報が古く、後から追加されたメソッドは載っていない</li>
<li>
<a href="https://docs.ruby-lang.org/ja/latest/library/etc.html" class="external">https://docs.ruby-lang.org/ja/latest/library/etc.html</a> に新しいドキュメントが存在する</li>
</ul>
<p>という理由から、削除しても良いと思ったのですが、どうでしょうか?</p>
<p>しばらく待ってみて反対がなければ削除しようと思っています。</p>
Ruby master - Feature #15999 (Open): KeyError#inspect does not contain receiver and key
https://bugs.ruby-lang.org/issues/15999
2019-07-14T07:31:12Z
znz (Kazuhiro NISHIYAMA)
<p>Some exception classes accept <code>receiver:</code>, but <code>#inspect</code> does not show such information.<br>
How about adding receiver (and key) to <code>#inspect</code>?</p>
<pre><code>KeyError.new("message", receiver: :receiver, key: :key).inspect #=> "#<KeyError: message>"
NameError.new("message", receiver: :receiver).inspect #=> "#<NameError: message>"
NoMethodError.new("message", receiver: :receiver).inspect #=> "#<NoMethodError: message>"
</code></pre>
Ruby master - Feature #15915 (Closed): `@1` cannot be achieved in meta-programming
https://bugs.ruby-lang.org/issues/15915
2019-06-12T08:55:19Z
znz (Kazuhiro NISHIYAMA)
<p>I cannot think of any way to get <code>@1</code> in meta-programming, so it is hard to inspect it in a debugger.</p>
<pre><code>% ruby -e 'proc{@1;binding.local_variable_get("@1")}.call(1)'
Traceback (most recent call last):
2: from -e:1:in `<main>'
1: from -e:1:in `block in <main>'
-e:1:in `local_variable_get': wrong local variable name `@1' for #<Binding:0x00007f952401e490> (NameError)
</code></pre>
Ruby master - Feature #15609 (Open): Kernel#sleep returns Float instead of Integer
https://bugs.ruby-lang.org/issues/15609
2019-02-18T07:02:42Z
znz (Kazuhiro NISHIYAMA)
<p><code>rb_f_sleep</code> uses <code>time()</code> internally, so it always returns Integer even if it called with Float.</p>
<p><a href="https://github.com/ruby/ruby/blob/124957566f041e5c6e8f678dfaf62cae381826dc/process.c#L4840-L4857" class="external">https://github.com/ruby/ruby/blob/124957566f041e5c6e8f678dfaf62cae381826dc/process.c#L4840-L4857</a></p>
<p>I think returning Float is more useful than Integer.<br>
(But I have no real use cases now.)</p>
Ruby master - Bug #15369 (Closed): pp does not support endless range
https://bugs.ruby-lang.org/issues/15369
2018-12-03T01:33:28Z
znz (Kazuhiro NISHIYAMA)
<p>I think <code>nil</code> in output is not expetced.</p>
<pre><code>% rbenv exec irb --simple-prompt -r irb/completion
>> pp(1..)
1..nil
=> 1..
</code></pre>
Ruby master - Bug #15311 (Closed): `make check` causes `warning: No mjit_build_directory`
https://bugs.ruby-lang.org/issues/15311
2018-11-16T07:37:31Z
znz (Kazuhiro NISHIYAMA)
<p><code>make help</code> says:</p>
<pre><code> check: equals make test test-all test-spec
</code></pre>
<p>But <code>make check</code> does not depend <code>test-all</code> acctually, it does not create <code>mjit_build_dir.so</code>.</p>
<p>So <code>make check</code> outputs many <code>warning: No mjit_build_directory</code>, and fails at <code>TestJIT#test_unload_units</code>.</p>
Ruby master - Bug #15268 (Closed): Solarisでtest/drb/test_drbssl.rbが落ちる
https://bugs.ruby-lang.org/issues/15268
2018-10-29T15:38:55Z
znz (Kazuhiro NISHIYAMA)
<p>他のテストの結果が隠れてしまうので今は skip しているのですが、Solaris で test/drb/test_drbssl.rb が落ちます。</p>
<p>ほぼ同じような TCPSocket 直接と UNIXSocket では落ちていないので、Ruby/OpenSSL 側の問題ではないかと思っているので、担当者を openssl にしておきます。</p>
<p>症状としては</p>
<ul>
<li><a href="https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20181020T131807Z.fail.html.gz" class="external">https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20181020T131807Z.fail.html.gz</a></li>
<li><a href="https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20181020T132408Z.fail.html.gz" class="external">https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20181020T132408Z.fail.html.gz</a></li>
</ul>
<p>は BUG で落ちていて、</p>
<ul>
<li><a href="https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20181020T132506Z.fail.html.gz" class="external">https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20181020T132506Z.fail.html.gz</a></li>
</ul>
<p>は spawn した子プロセスからの通信の read で止まってしまって、タイムアウトして Error になってしまっています。</p>
<p>もうちょっと詳しい説明は<a href="https://blog.n-z.jp/ruby/2018-10-26-drbtest.html" class="external">blogに書いている</a>ので参考にして見てください。</p>
Ruby master - Bug #15177 (Closed): 起動した後にTZを変更するとTime#utcがずれることがある
https://bugs.ruby-lang.org/issues/15177
2018-09-29T11:12:56Z
znz (Kazuhiro NISHIYAMA)
<p>起動時に <code>TZ</code> を <code>right/Asia/Tokyo</code> にしていると <code>Time#utc</code> でローカルタイムと同じ時分秒になりますが、 <code>TZ=Asia/Tokyo</code> で起動してから <code>ENV['TZ']='right/Asia/Tokyo'</code> で変更すると <code>Time#utc</code> の結果がうるう秒のぶんだけずれます。</p>
<pre><code>$ TZ=Asia/Tokyo ruby -ve "ENV['TZ']='right/Asia/Tokyo';t=Time.at(2<<30);p t;p t.utc"
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
2038-01-19 12:13:41 +0900
2038-01-19 03:14:08 UTC
$ TZ=right/Asia/Tokyo ruby -ve "t=Time.at(2<<30);p t;p t.utc"
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
2038-01-19 12:13:41 +0900
2038-01-19 03:13:41 UTC
% TZ=Asia/Tokyo ruby -ve "t=Time.at(2<<30);p t;p t.utc"
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
2038-01-19 12:14:08 +0900
2038-01-19 03:14:08 UTC
</code></pre>
Ruby master - Bug #14958 (Closed): rand(endless_range) raises TypeError (no implicit conversion o...
https://bugs.ruby-lang.org/issues/14958
2018-08-01T15:21:46Z
znz (Kazuhiro NISHIYAMA)
<p>I think TypeError message is a bit strange.</p>
<pre><code class="console syntaxhl" data-language="console"><span class="gp">$</span><span class="w"> </span>ruby <span class="nt">-v</span>
<span class="go">ruby 2.6.0dev (2018-08-01 trunk 64154) [x86_64-linux]
</span><span class="gp">$</span><span class="w"> </span>ruby <span class="nt">-e</span> <span class="s1">'p rand(1..1)'</span>
<span class="go">1
</span><span class="gp">$</span><span class="w"> </span>ruby <span class="nt">-e</span> <span class="s1">'rand(1..)'</span>
<span class="go">Traceback (most recent call last):
</span><span class="gp"> 1: from -e:1:in `<main></span><span class="s1">'
</span><span class="go">-e:1:in `rand': no implicit conversion of Range into Integer (TypeError)
</span><span class="gp">$</span><span class="w"> </span>ruby <span class="nt">-e</span> <span class="s1">'rand(nil..nil)'</span>
<span class="go">Traceback (most recent call last):
</span><span class="gp"> 1: from -e:1:in `<main></span><span class="s1">'
</span><span class="go">-e:1:in `rand': no implicit conversion of Range into Integer (TypeError)
</span></code></pre>
Ruby master - Feature #14931 (Open): [DOC] exception keyword argument is not documented in some m...
https://bugs.ruby-lang.org/issues/14931
2018-07-22T08:53:57Z
znz (Kazuhiro NISHIYAMA)
<p>Some methods accept exception keyword argument since 2.6.0, but it is not documented in rdoc yet.</p>
<p>In NEWS,</p>
<ul>
<li>
<p>Kernel.#Complex takes :exception option to specify the way of error handling [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: An option to pass to `Integer`, `Float`, to return `nil` instead of raise an exception (Closed)" href="https://bugs.ruby-lang.org/issues/12732">#12732</a>]</p>
</li>
<li>
<p>Kernel.#Float takes :exception option to specify the way of error handling [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: An option to pass to `Integer`, `Float`, to return `nil` instead of raise an exception (Closed)" href="https://bugs.ruby-lang.org/issues/12732">#12732</a>]</p>
</li>
<li>
<p>Kernel.#Integer takes :exception option to specify the way of error handling [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: An option to pass to `Integer`, `Float`, to return `nil` instead of raise an exception (Closed)" href="https://bugs.ruby-lang.org/issues/12732">#12732</a>]</p>
</li>
<li>
<p>Kernel.#Rational takes :exception option to specify the way of error handling [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: An option to pass to `Integer`, `Float`, to return `nil` instead of raise an exception (Closed)" href="https://bugs.ruby-lang.org/issues/12732">#12732</a>]</p>
</li>
<li>
<p>Kernel.#system takes :exception option to raise an exception on<br>
failure. [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Add option to let Kernel.#system raise error instead of returning false (Closed)" href="https://bugs.ruby-lang.org/issues/14386">#14386</a>]</p>
</li>
</ul>
Ruby master - Feature #14930 (Closed): sample/trick2018
https://bugs.ruby-lang.org/issues/14930
2018-07-21T12:54:04Z
znz (Kazuhiro NISHIYAMA)
<p>まだ TRICK FINAL の上位作品が sample に追加されていないようです。<br>
<a href="https://github.com/tric/trick2018" class="external">https://github.com/tric/trick2018</a></p>
<p>過去の回も含めて情報を探してみると以下のように、何作品を追加するのかは、以下の情報しかみつけられなかったので、以前の回の上位作品を追加した <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/18">@mame (Yusuke Endoh)</a> さんに assign しておきます。</p>
<p><a href="https://magazine.rubyist.net/articles/0043/0043-TRICK2013.html" class="external">https://magazine.rubyist.net/articles/0043/0043-TRICK2013.html</a></p>
<blockquote>
<p>上位 3 (or 4) 作品: Ruby 公式リポジトリにサンプルコードとしてコミットされる (次期 Ruby リリースパッケージにも含まれる予定)</p>
</blockquote>
<p><a href="https://magazine.rubyist.net/articles/0053/0053-TRICK2015.html" class="external">https://magazine.rubyist.net/articles/0053/0053-TRICK2015.html</a></p>
<blockquote>
<p>上位 5 作品: Ruby 公式リポジトリにサンプルコードとしてコミットされる (Ruby 2.3 としてリリース済み)</p>
</blockquote>
Ruby master - Bug #14886 (Closed): ChangeLog section is obsolete
https://bugs.ruby-lang.org/issues/14886
2018-06-30T08:41:22Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://github.com/ruby/ruby/blob/trunk/doc/contributing.rdoc#changelog" class="external">ChangeLog section in doc/contributing.rdoc</a> is not useful now.<br>
But I think some parts are useful for commit log.<br>
For example: issue relationship.</p>
Ruby master - Bug #14885 (Closed): Is documenting-ruby a dead project?
https://bugs.ruby-lang.org/issues/14885
2018-06-30T08:27:16Z
znz (Kazuhiro NISHIYAMA)
<p>In <a href="https://github.com/ruby/ruby/blob/trunk/doc/contributing.rdoc#contributing-documentation" class="external">Contributing Documentation section in doc/contributing.rdoc</a> links to documenting-ruby.org , but <a href="https://github.com/documenting-ruby/ruby" class="external">https://github.com/documenting-ruby/ruby</a> is about 3 years old.<br>
I think it is a dead project.</p>
<p>If so, I want to remove the link.<br>
And I think contributing documents to <a href="https://github.com/ruby/ruby" class="external">https://github.com/ruby/ruby</a> is better alternative.</p>
Ruby master - Bug #14840 (Closed): `warning: constant Net::ProtoServerError is deprecated` only v...
https://bugs.ruby-lang.org/issues/14840
2018-06-10T04:51:13Z
znz (Kazuhiro NISHIYAMA)
<p>When ruby loads <code>net/protocol</code> via <code>net/http</code>, <code>Net::ProtoServerError</code> is deprecated.<br>
But via <code>net/smtp</code>, etc, it does not warn.<br>
Is this intentional?</p>
<pre><code>% ruby -r net/http -e 'Net::ProtoServerError'
-e:1: warning: constant Net::ProtoServerError is deprecated
% ruby -r net/smtp -e 'Net::ProtoServerError'
</code></pre>
Ruby master - Bug #14743 (Closed): Some links broken in README
https://bugs.ruby-lang.org/issues/14743
2018-05-08T14:19:42Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://github.com/ruby/docs.ruby-lang.org/issues/56" class="external">Some links broken in README</a> is original issue.<br>
And I tried to fix links, but some problems occur.</p>
<ol>
<li>Current README.md's link is <code>[win32/README.win32](win32/README.win32)</code> and it works on github, but rdoc generates broken link.</li>
<li>Using rdoc-ref suggested in <a href="https://github.com/ruby/rdoc/issues/618" class="external">Convert links to local files in markdown</a>, it works rdoc generated html, but it does not work on github.</li>
<li>Plain filename becomes link on rdoc generated html, but it does not become link on github.</li>
</ol>
<ul>
<li>Sample site: <a href="https://md-link-test-2018.netlify.com/" class="external">https://md-link-test-2018.netlify.com/</a>
</li>
<li>Source: <a href="https://github.com/znz/md-link-test-2018" class="external">https://github.com/znz/md-link-test-2018</a>
</li>
</ul>
<p>Which is better?<br>
Is there other better solution?</p>
Ruby master - Bug #14738 (Closed): Failed to load_from_binary on 2.5.1
https://bugs.ruby-lang.org/issues/14738
2018-05-04T16:21:46Z
znz (Kazuhiro NISHIYAMA)
<pre><code>% cat /tmp/1226.rb
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
p RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
% ruby -v /tmp/1226.rb
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
<compiled>:1: warning: assigned but unused variable - num
Traceback (most recent call last):
1: from /tmp/1226.rb:3:in `<main>'
/tmp/1226.rb:3:in `load_from_binary': wrong argument type nil (expected String) (TypeError)
</code></pre>
<p>rubyfarm-bisect says first bad commit is <a href="https://github.com/ruby/ruby/commit/478003f6df40dc79d33c6ec86919f2dde07284be" class="external">r58979</a>.<br>
It seems trunk is aleady fixed.</p>
Ruby master - Bug #14427 (Closed): Backport r61469
https://bugs.ruby-lang.org/issues/14427
2018-01-31T14:56:04Z
znz (Kazuhiro NISHIYAMA)
<p>Please backport r61469 to ruby_2_5 branch.</p>
<p>2.5.0:</p>
<pre><code>% rbenv exec irb -r irb/completion --simple-prompt
>> {foo: 1}.fetch(:fooo)
Traceback (most recent call last):
3: from .../bin/irb:11:in `<main>'
2: from (irb):1
1: from (irb):1:in `fetch'
KeyError (key not found: :fooo
Did you mean? :foo)
</code></pre>
<p>trunk:</p>
<pre><code>>> {foo: 1}.fetch(:fooo)
Traceback (most recent call last):
3: from .../bin/irb:11:in `<main>'
2: from (irb):1
1: from (irb):1:in `fetch'
KeyError (key not found: :fooo)
Did you mean? :foo
</code></pre>
Ruby master - Bug #14325 (Closed): Set#reset raise RuntimeError instead of FrozenError
https://bugs.ruby-lang.org/issues/14325
2018-01-06T15:32:05Z
znz (Kazuhiro NISHIYAMA)
<p>I think it should use <code>FrozenError</code> instead of <code>RuntimeError</code>.<br>
I can't reproduce without modifying instance variable directly.</p>
<pre><code>% ruby -v -r set -e 'Set[].tap{|s|s.instance_variable_set(:@hash, :dummy)}.freeze.reset'
ruby 2.6.0dev (2018-01-06 trunk 61640) [x86_64-darwin16]
Traceback (most recent call last):
1: from -e:1:in `<main>'
.../lib/ruby/2.6.0/set.rb:527:in `reset': can't modify frozen Set (RuntimeError)
% ruby -v -I ./lib -r set -e 'Set[].tap{|s|s.instance_variable_set(:@hash, :dummy)}.freeze.reset'
ruby 2.6.0dev (2018-01-06 trunk 61640) [x86_64-darwin16]
Traceback (most recent call last):
1: from -e:1:in `<main>'
.../lib/set.rb:527:in `reset': can't modify frozen Set (FrozenError)
</code></pre>
<pre><code class="patch syntaxhl" data-language="patch"><span class="gh">diff --git a/lib/set.rb b/lib/set.rb
index 9642e74af4..d777b81b8f 100644
</span><span class="gd">--- a/lib/set.rb
</span><span class="gi">+++ b/lib/set.rb
</span><span class="p">@@ -524,7 +524,7 @@</span> def reset
if @hash.respond_to?(:rehash)
@hash.rehash # This should perform frozenness check.
else
<span class="gd">- raise "can't modify frozen #{self.class.name}" if frozen?
</span><span class="gi">+ raise FrozenError, "can't modify frozen #{self.class.name}" if frozen?
</span> end
self
end
</code></pre>
Ruby master - Feature #14316 (Closed): Update Status Code classes
https://bugs.ruby-lang.org/issues/14316
2018-01-05T13:54:55Z
znz (Kazuhiro NISHIYAMA)
<p>In lib/net/http/responses.rb, some class names are old names.<br>
So I would like to update and add <code>103 Early Hints</code> if no objection.</p>
<p>see <a href="https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml" class="external">https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml</a></p>
Ruby master - Bug #14266 (Closed): Set#clone(freeze: false) makes frozen internal hash
https://bugs.ruby-lang.org/issues/14266
2018-01-02T01:24:26Z
znz (Kazuhiro NISHIYAMA)
<pre><code>% irb -r irb/completion --simple-prompt
>> require 'set'
=> true
>> set=Set[].freeze.clone(freeze: false)
=> #<Set: {}>
>> set.frozen?
=> false
>> set.instance_variable_get(:@hash).frozen?
=> true
</code></pre>
<p>In <code>Set#initialize_clone</code>, clone hash without freeze keyword argument.<br>
But I think there is no easy way how to know freeze keyword argument value in <code>initialize_clone</code>.</p>
<pre><code> # Clone internal hash.
def initialize_clone(orig)
super
@hash = orig.instance_variable_get(:@hash).clone
end
</code></pre>
Ruby master - Bug #14264 (Closed): RDoc comment of warn does not mention uplevel:
https://bugs.ruby-lang.org/issues/14264
2018-01-01T15:23:38Z
znz (Kazuhiro NISHIYAMA)
<p><code>Kernel#warn</code> support uplevel keyword argument since 2.5.0, but rdoc does not mention it.</p>
<p><a href="https://github.com/ruby/ruby/blob/691b05e83c41d089c4f6c7a8bbac9dd63f36a144/error.c#L309-L325" class="external">https://github.com/ruby/ruby/blob/691b05e83c41d089c4f6c7a8bbac9dd63f36a144/error.c#L309-L325</a></p>
Ruby master - Bug #14262 (Closed): ArgumentError (negative level (-1)) when `warn "test message",...
https://bugs.ruby-lang.org/issues/14262
2017-12-31T10:33:16Z
znz (Kazuhiro NISHIYAMA)
<p>When <code>uplevel: -2</code>, error message says <code>negative level (-1)</code>.<br>
When <code>uplevel: -1</code>, no exception occur.<br>
What is expected behavior?</p>
<pre><code>% irb -r irb/completion --simple-prompt
>> warn("test", uplevel: -1)
(irb):1: warning: test
=> nil
>> warn("test", uplevel: -2)
Traceback (most recent call last):
3: from bin/irb:11:in `<main>'
2: from (irb):2
1: from (irb):2:in `warn'
ArgumentError (negative level (-1))
>> warn("test", uplevel: 0)
(irb):3: warning: test
=> nil
>> warn("test", uplevel: 1)
</code></pre>
Ruby master - Bug #14247 (Closed): Thread#fetch raise KeyError without key and receiver
https://bugs.ruby-lang.org/issues/14247
2017-12-27T12:06:24Z
znz (Kazuhiro NISHIYAMA)
<p>I found this by message without <code>Did you mean?</code>.</p>
<p>expected:</p>
<pre><code>% ruby -e 'th=Thread.current;th[:foo]=1;th.fetch(:fooo)'
Traceback (most recent call last):
1: from -e:1:in `<main>'
-e:1:in `fetch': key not found: "fooo" (KeyError)
Did you mean? :foo
</code></pre>
<p>actual:</p>
<pre><code>% ruby -e 'th=Thread.current;th[:foo]=1;th.fetch(:fooo)'
Traceback (most recent call last):
1: from -e:1:in `<main>'
-e:1:in `fetch': key not found: fooo (KeyError)
</code></pre>
Ruby master - Feature #14197 (Open): `Enumerable#{select,reject}` accept a pattern argument
https://bugs.ruby-lang.org/issues/14197
2017-12-18T12:42:52Z
znz (Kazuhiro NISHIYAMA)
<p><code>#all?</code>, <code>#any?</code>, <code>#none?</code>, and <code>#one?</code> accept pattern arguments since 2.5.0.</p>
<p><code>#grep</code>, and <code>#grep_v</code> have such feature, but it is hard for me to remember them since I would be thinking of using <code>#select</code>, or <code>#reject</code>, and <code>#select</code> and <code>#reject</code> don't have such feature.</p>
<p>I want to write</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">collection</span><span class="p">.</span><span class="nf">reject</span><span class="p">(</span><span class="sr">/re/</span><span class="p">)</span>
</code></pre>
<p>instead of</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">collection</span><span class="p">.</span><span class="nf">reject</span> <span class="p">{</span><span class="o">|</span><span class="n">item</span><span class="o">|</span> <span class="sr">/re/</span> <span class="o">=~</span> <span class="n">item</span> <span class="p">}</span>
</code></pre>
<p>or</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">collection</span><span class="p">.</span><span class="nf">grep_v</span><span class="p">(</span><span class="sr">/re/</span><span class="p">)</span>
</code></pre>
Ruby master - Bug #14163 (Closed): Pages of rdoc include files which are not documents
https://bugs.ruby-lang.org/issues/14163
2017-12-09T13:34:33Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://docs.ruby-lang.org/en/trunk/" class="external">https://docs.ruby-lang.org/en/trunk/</a> includes <code>*.tt</code>, <code>*.gemspec</code>, Executable, Executable.bundler, Executable.standalone.<br>
But it seems there are not documents nor sources including documents.</p>
Ruby master - Bug #14075 (Closed): File.dirname("path without dir".taint) returns untainted string
https://bugs.ruby-lang.org/issues/14075
2017-11-02T13:00:58Z
znz (Kazuhiro NISHIYAMA)
<p>Is this intentional?</p>
<pre><code>% ruby -e 'p [File.dirname("foo/bar".taint).tainted?, File.dirname("hoge".taint).tainted?]'
[true, false]
</code></pre>
Ruby master - Feature #14040 (Open): deprecate HTTP.version_1_2
https://bugs.ruby-lang.org/issues/14040
2017-10-22T09:32:41Z
znz (Kazuhiro NISHIYAMA)
<p>r60311 をみて、<code>Net::HTTP#min_version/max_version</code> って長い間 1.2 になってから変わっていない net/http 自体のバージョンと紛らわしいと思ったので、 <code>Net::HTTP.version_1_2</code> などは deprecated にして、将来のバージョン (ruby 3.0?) では削除してしまうのはどうでしょうか?</p>
<p>(ついでに書いてしまうと HTTP 自体のバージョンとも紛らわしいので <code>Net::HTTP#min_ssl_version/max_ssl_version</code> のような名前の方が良いかもしれないと思いました。)</p>
Ruby master - Feature #13969 (Closed): Dir#each_child
https://bugs.ruby-lang.org/issues/13969
2017-10-04T11:11:35Z
znz (Kazuhiro NISHIYAMA)
<p>Dir has class method pairs: <code>Dir.entries</code> / <code>Dir.children</code>, <code>Dir.foreach</code> / <code>Dir.each_child</code>.<br>
But instance method is <code>Dir#each</code> only.<br>
How about adding <code>Dir#each_child</code>?</p>
Ruby master - Feature #13943 (Closed): Use unpack1 instead of unpack(template)[0] in erb.rb
https://bugs.ruby-lang.org/issues/13943
2017-09-27T12:56:35Z
znz (Kazuhiro NISHIYAMA)
<p>I think <code>unpack1(template)</code> is faster than <code>unpack(template)[0]</code>.</p>
<p>Attached patch for <code>lib/erb.rb</code>.</p>
Ruby master - Bug #13906 (Closed): homepage in gemspec
https://bugs.ruby-lang.org/issues/13906
2017-09-15T16:00:21Z
znz (Kazuhiro NISHIYAMA)
<p>Some gemspec files set ruby-lang site instead of github site to homepage.<br>
Is it intentional?</p>
<pre><code>% git ls-files '*.gemspec' | xargs grep homepage | grep ruby-lang
ext/io/console/io-console.gemspec: s.homepage = "https://www.ruby-lang.org"
ext/openssl/openssl.gemspec: s.homepage = "https://www.ruby-lang.org/".freeze
ext/sdbm/sdbm.gemspec: s.homepage = "https://www.ruby-lang.org"
ext/stringio/stringio.gemspec: s.homepage = "https://www.ruby-lang.org".freeze
ext/strscan/strscan.gemspec: s.homepage = "https://www.ruby-lang.org"
lib/webrick/webrick.gemspec: s.homepage = "https://www.ruby-lang.org"
</code></pre>
Ruby master - Feature #13904 (Closed): getter for original information of Enumerator
https://bugs.ruby-lang.org/issues/13904
2017-09-15T15:27:58Z
znz (Kazuhiro NISHIYAMA)
<p>At <a href="https://gitter.im/red-data-tools/ja?at=59b0aaa097cedeb04828e268" class="external">https://gitter.im/red-data-tools/ja?at=59b0aaa097cedeb04828e268</a> ,<br>
mrkn says narray and pycall use internal information of ruby to check <code>Range#step(n)</code>.</p>
<p>People of red-data-tools/ja suggest subclass of Enumerator.<br>
But I think it does not match Ruby's '大クラス主義' (I don't know this word in English), so I suggest to add some methods to Enumerator class.</p>
<p>proof of concept attached.</p>
<p>Usage:</p>
<pre><code>% irb -r irb/completion --simple-prompt
>> e=(1..2).step(3)
=> #<Enumerator: 1..2:step(3)>
>> e.receiver
=> 1..2
>> e.method_name
=> :step
>> e.arguments
=> [3]
</code></pre>
<p><code>#method</code> is conflict with <code>Kernel#method</code>, so use <code>#method_name</code> instead.</p>
Ruby master - Bug #13854 (Closed): `make golf` broken
https://bugs.ruby-lang.org/issues/13854
2017-08-31T11:16:49Z
znz (Kazuhiro NISHIYAMA)
<p>make golf が失敗します。</p>
<pre><code>% make golf
...
compiling .../ruby/goruby.c golf_prelude.c
gcc: fatal error: cannot specify -o with -c, -S or -E with multiple files
compilation terminated.
uncommon.mk:951: ターゲット 'goruby.o' のレシピで失敗しました
</code></pre>
<p>たぶん r58724 の変更の</p>
<pre><code>$(MAINOBJ): $(srcdir)/$(MAINSRC)
$(ECHO) compiling $(srcdir)/$(MAINSRC)
$(Q) $(CC) $(MAINCPPFLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$(srcdir)/$(MAINSRC)
</code></pre>
<p>が</p>
<pre><code>golf: $(LIBRUBY) $(GOLFOBJS) PHONY
$(Q) $(MAKE) $(mflags) MAINOBJ="$(GOLFOBJS)" PROGRAM=$(GORUBY)$(EXEEXT) program
</code></pre>
<p>のように MAINOBJ が複数になることを想定していなくて、<code>$(CSRCFLAG)$(srcdir)/$(MAINSRC)</code> の最後の MAINSRC が <code>goruby.c golf_prelude.c</code> に展開されてしまって失敗しているようです。</p>
Ruby master - Bug #13808 (Closed): lib/ipaddr.gemspec includes `git ls-files -z`
https://bugs.ruby-lang.org/issues/13808
2017-08-12T05:42:00Z
znz (Kazuhiro NISHIYAMA)
<p><code>git ls-files -z</code> in gemspec may occur error.</p>
<p>see <a href="https://bugs.ruby-lang.org/issues/13423" class="external">https://bugs.ruby-lang.org/issues/13423</a> and/or <a href="https://bugs.ruby-lang.org/issues/12736" class="external">https://bugs.ruby-lang.org/issues/12736</a></p>
Ruby master - Bug #13538 (Closed): head: illegal option -- c
https://bugs.ruby-lang.org/issues/13538
2017-05-03T02:01:04Z
znz (Kazuhiro NISHIYAMA)
<p><a href="http://blog.n-z.jp/blog/2017-05-02-ruby-sample.html" class="external">Solaris 11.3でビルドを試した</a>ところ、configure の最後で以下のようなエラーが出ました。</p>
<pre><code>---
Configuration summary for ruby version 2.5.0
head: illegal option -- c
usage: head [-n #] [-#] [filename...]
/export/home/vagrant/opt/ruby
head: illegal option -- c
usage: head [-n #] [-#] [filename...]
${prefix}
head: illegal option -- c
(略)
head: illegal option -- c
usage: head [-n #] [-#] [filename...]
yes
head: illegal option -- c
usage: head [-n #] [-#] [filename...]
man
---
</code></pre>
<p>head -c は <a href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/head.html" class="external">POSIX</a> になくて、代わりの手段を探してみたところ、<a href="http://qiita.com/richmikan@github/items/bd4b21cf1fe503ab2e5c#head%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89" class="external">どの環境でも使えるシェルスクリプトを書くためのメモ ver4.51 - Qiita の headコマンド</a> にあったので <code>head -c26</code> を <code>dd bs=1 count=26 2>/dev/null</code> に書き換えます。</p>
Ruby master - Bug #13423 (Closed): error in etc.gemspec
https://bugs.ruby-lang.org/issues/13423
2017-04-11T14:11:11Z
znz (Kazuhiro NISHIYAMA)
<p><code>git</code> コマンドがないと <code>make install</code> が <code>etc.gemspec</code> でエラーになります。</p>
<pre><code>Invalid gemspec in [/path/to/ruby/ext/etc/etc.gemspec]: No such file or directory - git
from ../tool/rbinstall.rb:889:in `<main>'
from ../tool/rbinstall.rb:889:in `each'
from ../tool/rbinstall.rb:892:in `block in <main>'
from ../tool/rbinstall.rb:763:in `block in <main>'
from ../tool/rbinstall.rb:775:in `install_default_gem'
from ../tool/rbinstall.rb:775:in `map'
../tool/rbinstall.rb:776:in `block in install_default_gem': invalid spec in /path/to/ruby/ext/etc/etc.gemspec (RuntimeError)
</code></pre>
Ruby master - Bug #13348 (Closed): win32/README.win32 のアイコンがリンク切れ
https://bugs.ruby-lang.org/issues/13348
2017-03-21T13:46:31Z
znz (Kazuhiro NISHIYAMA)
<p>@nifty の @homepage サービスが終了した影響で、win32/README.win32 に書いてある</p>
<pre><code>* ((<URL:http://homepage1.nifty.com/a_nakata/ruby/>)) or
((<icon itself|URL:http://homepage1.nifty.com/a_nakata/ruby/RubyIcon.ico>))
</code></pre>
<p>がリンク切れになってしまっているようです。</p>
Ruby master - Bug #13191 (Closed): sample/pty/shl.rb がうまく動かない
https://bugs.ruby-lang.org/issues/13191
2017-02-04T07:12:26Z
znz (Kazuhiro NISHIYAMA)
<p>sample/pty/shl.rb で c で起動したシェルを exit で終了した時に終了がうまく検知できないようです。</p>
<p>r57530 の修正がないと 1.8.6 でも動かなかったので、その修正をしたもので試したのですが、1.8.6 や 1.8.7 で試すとメインスレッドに <code>PTY::ChildExited</code> が発生して、<code>writer</code> メソッドの <code>STDIN.getc</code> が中断して rescue 節で <code>'Exit'</code> が返り、うまく終了が検知できました。</p>
<p>たぶんネイティブスレッドを使うようになった 1.9 以降(?)だと思うのですが、<code>PTY::ChildExited</code> が発生せず、<code>ps</code> コマンドで確認するとシェルが defunct になっています。</p>
<p>ここまでは調べられたのですが、ちょっと調べた限りでは、これが <code>sample/pty/shl.rb</code> のバグなのか <code>ext/pty</code> のバグなのかわかりませんでした。</p>
Ruby master - Bug #13114 (Closed): test failures since r57284
https://bugs.ruby-lang.org/issues/13114
2017-01-08T05:49:41Z
znz (Kazuhiro NISHIYAMA)
<p>r57284 の変更でいくつかのテストが失敗します。</p>
<p>最小の再現条件を絞り込もうとしたのですが、webrick/httpauth/basicauth だと再現するのに、個別の webrick/httpstatus と webrick/httpauth/authenticator だと再現しないなど、条件がよくわかりませんでした。</p>
<pre><code>% ruby -r webrick/httpauth/basicauth -e 'p WEBrick::HTTPStatus::ProxyAuthenticationRequired'
WEBrick::HTTPAuth::ProxyAuthenticator::AuthException
% ruby -r webrick/httpstatus -r webrick/httpauth/authenticator -e 'p WEBrick::HTTPStatus::ProxyAuthenticationRequired'
WEBrick::HTTPStatus::ProxyAuthenticationRequired
</code></pre>
Ruby master - Bug #13021 (Closed): `Zlib.gunzip` modifies argument String
https://bugs.ruby-lang.org/issues/13021
2016-12-10T02:00:33Z
znz (Kazuhiro NISHIYAMA)
<pre><code>% irb -r irb/completion --simple-prompt
>> RUBY_DESCRIPTION
=> "ruby 2.4.0dev (2016-12-10 trunk 57036) [x86_64-linux]"
>> require 'zlib'
=> true
>> gz=Zlib.gzip('test')
=> "\x1F\x8B\b\x00\xBF`KX\x00\x03+I-.\x01\x00\f~\x7F\xD8\x04\x00\x00\x00"
>> Zlib.gunzip(gz)
=> "test"
>> gz
=> "+I-.\x01\x00\f~\x7F\xD8\x04\x00\x00\x00"
</code></pre>
Ruby master - Bug #12850 (Closed): SEGV in C level backtrace information
https://bugs.ruby-lang.org/issues/12850
2016-10-18T13:41:27Z
znz (Kazuhiro NISHIYAMA)
<p>Ubuntu 16.04.1 LTS の環境で、r56445 の変更の影響で SEGV のテストの <code>C level backtrace information</code> の表示で SEGV します。</p>
<pre><code>% gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.2' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2)
% gdb -q --args ruby --disable-gems -v -e 'Process.kill :SEGV, $$'
Reading symbols from ruby...done.
(gdb) run
Starting program: /home/vagrant/build/ruby-git/ruby --disable-gems -v -e Process.kill\ :SEGV,\ \$\$
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff7ff5700 (LWP 5839)]
ruby 2.4.0dev (2016-10-18 trunk 56445) [x86_64-linux]
Thread 1 "ruby" received signal SIGSEGV, Segmentation fault.
0x00007ffff7537757 in kill () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: そのようなファイルやディレクトリはありません.
(gdb) c
Continuing.
-e:1: [BUG] Segmentation fault at 0x000384000016b9
ruby 2.4.0dev (2016-10-18 trunk 56445) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0003 p:---- s:0012 e:000011 CFUNC :kill
c:0002 p:0016 s:0006 e:000005 EVAL -e:1 [FINISH]
c:0001 p:0000 s:0003 E:001e60 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
-e:1:in `<main>'
-e:1:in `kill'
-- Machine register context ------------------------------------------------
RIP: 0x00007ffff7537757 RBP: 0x0000000000602f70 RSP: 0x00007fffffffd328
RAX: 0x0000000000000000 RBX: 0x0000000000603728 RCX: 0x00007ffff7537757
RDX: 0x0000000000000000 RDI: 0x00000000000016b9 RSI: 0x000000000000000b
R8: 0x0000000000603728 R9: 0x0000000000000005 R10: 0x000000000000022d
R11: 0x0000000000000206 R12: 0x0000000000000002 R13: 0x00000000000016b9
R14: 0x0000000000000001 R15: 0x0000000000000001 EFL: 0x0000000000000206
-- C level backtrace information -------------------------------------------
Thread 1 "ruby" received signal SIGSEGV, Segmentation fault.
parse_debug_line_cu (offset=0, lines=0x7657c0, obj=0x765cb0, debug_line=<synthetic pointer>,
traces=0x7ffff7dd31c0 <trace>, num_traces=18) at /home/vagrant/s/github.com/ruby/ruby/addr2line.c:291
291 while (*p) {
(gdb) p p
$1 = 0x8000f5f977f7 <error: Cannot access memory at address 0x8000f5f977f7>
(gdb)
</code></pre>
Ruby master - Bug #12815 (Closed): Integer#digits's error message different when base is Fixnum o...
https://bugs.ruby-lang.org/issues/12815
2016-10-06T12:33:05Z
znz (Kazuhiro NISHIYAMA)
<p>Is this intended?</p>
<pre><code>% ruby -ve '60.upto(65){|n| 1.digits(-(1<<n)) rescue p $! }'
ruby 2.4.0dev (2016-10-06 trunk 56364) [x86_64-linux]
#<ArgumentError: invalid radix -1152921504606846976>
#<ArgumentError: invalid radix -2305843009213693952>
#<ArgumentError: invalid radix -4611686018427387904>
#<ArgumentError: negative radix>
#<ArgumentError: negative radix>
#<ArgumentError: negative radix>
</code></pre>
Ruby master - Bug #12800 (Closed): YAMLStoreTest#test_thread_safe hang
https://bugs.ruby-lang.org/issues/12800
2016-09-29T13:39:32Z
znz (Kazuhiro NISHIYAMA)
<p><code>lib/yaml/store.rb</code> のテストがなかったので、<code>test/test_pstore.rb</code> を元に <code>test/yaml/test_store.rb</code> を作ってみたところ、<code>YAMLStoreTest#test_thread_safe</code> で止まってしまいました。</p>
<p>原因を調べてみたところ、</p>
<ul>
<li>
<code>PStore</code> は <code>def initialize(file, thread_safe = false)</code>
</li>
<li>
<code>YAML::Store</code> は <code>def initialize file_name, yaml_opts = {}</code>
</li>
</ul>
<p>という違いがあるのに <code>YAML::Store</code> で (引数なしもかっこもない) <code>super</code> を呼び出していて、意図せず <code>thread_safe</code> が真になっているからだとわかりました。</p>
<p>r33376 での変更からのようで、<code>yaml_opts</code> も使われなくなっていたので、そのあたりも含めて直しておきます。</p>
Ruby master - Bug #12793 (Closed): Warning.warn with non-string object
https://bugs.ruby-lang.org/issues/12793
2016-09-27T14:58:35Z
znz (Kazuhiro NISHIYAMA)
<p><code>Warning.warn</code> with non-string argument causes SEGV.<br>
For example, <code>Warning.warn nil</code>.</p>
Ruby master - Bug #12792 (Closed): cannot open https://bugs.jruby.org/4176
https://bugs.ruby-lang.org/issues/12792
2016-09-27T12:53:02Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://bugs.jruby.org/4176" class="external">https://bugs.jruby.org/4176</a> in r56260.<br>
But I cannot open it because connection refused.</p>
Ruby master - Bug #12785 (Closed): misc/test_ruby_mode.rb failed with emacs 25.1.1
https://bugs.ruby-lang.org/issues/12785
2016-09-22T14:22:11Z
znz (Kazuhiro NISHIYAMA)
<p>When emacs is 25.1.1, test/misc/test_ruby_mode.rb causes 8 failures.</p>
<pre><code>vagrant@archlinux:~/ruby/build$ make test-all TESTS=misc/test_ruby_mode.rb
CC = ccache gcc
LD = ld
LDSHARED = ccache gcc -shared
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Werror=implicit-int -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=deprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -std=gnu99 -fPIC
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT
CPPFLAGS = -DRUBY_DEBUG_ENV -DARRAY_DEBUG -I. -I.ext/include/x86_64-linux -I../include -I.. -I../enc/unicode/9.0.0
DLDFLAGS = -Wl,-soname,libruby.so.2.4 -fstack-protector
SOLIBS = -lpthread -lgmp -ldl -lcrypt -lm
組み込み spec を使用しています。
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/lto-wrapper
ターゲット: x86_64-pc-linux-gnu
configure 設定: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release
スレッドモデル: posix
gcc バージョン 6.2.1 20160830 (GCC)
Run options: "--ruby=./miniruby -I../lib -I. -I.ext/common ../tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=../test/excludes --name=!/memory_leak/
# Running tests:
[1/9] TestRubyMode::TestIndent#test_array_after_paren_and_space = 0.08 s
1) Failure:
TestRubyMode::TestIndent#test_array_after_paren_and_space [/home/vagrant/ruby/test/misc/test_ruby_mode.rb:156]:
Expected /^Wrote / to match "Indenting region...\nIndenting region...done\n".
[2/9] TestRubyMode::TestIndent#test_array_literal = 0.08 s
2) Failure:
TestRubyMode::TestIndent#test_array_literal [/home/vagrant/ruby/test/misc/test_ruby_mode.rb:123]:
Expected /^Wrote / to match "Indenting region...\nIndenting region...done\n".
[3/9] TestRubyMode::TestIndent#test_begin_end = 0.08 s
3) Failure:
TestRubyMode::TestIndent#test_begin_end [/home/vagrant/ruby/test/misc/test_ruby_mode.rb:144]:
Expected /^Wrote / to match "Indenting region...\nIndenting region...done\n".
[4/9] TestRubyMode::TestIndent#test_expr_in_regexp = 0.08 s
4) Failure:
TestRubyMode::TestIndent#test_expr_in_regexp [/home/vagrant/ruby/test/misc/test_ruby_mode.rb:98]:
Expected /^Wrote / to match "Indenting region...\nIndenting region...done\n".
[5/9] TestRubyMode::TestIndent#test_keyword_label = 0.08 s
5) Failure:
TestRubyMode::TestIndent#test_keyword_label [/home/vagrant/ruby/test/misc/test_ruby_mode.rb:72]:
Expected /^Wrote / to match "Indenting region...\nIndenting region...done\n".
[6/9] TestRubyMode::TestIndent#test_method_with_question_mark = 0.08 s
6) Failure:
TestRubyMode::TestIndent#test_method_with_question_mark [/home/vagrant/ruby/test/misc/test_ruby_mode.rb:86]:
Expected /^Wrote / to match "Indenting region...\nIndenting region...done\n".
[7/9] TestRubyMode::TestIndent#test_simple = 0.08 s
7) Failure:
TestRubyMode::TestIndent#test_simple [/home/vagrant/ruby/test/misc/test_ruby_mode.rb:58]:
Expected /^Wrote / to match "Indenting region...\nIndenting region...done\n".
[9/9] TestRubyMode::TestIndent#test_spread_arguments = 0.08 s
8) Failure:
TestRubyMode::TestIndent#test_spread_arguments [/home/vagrant/ruby/test/misc/test_ruby_mode.rb:172]:
Expected /^Wrote / to match "Indenting region...\nIndenting region...done\n".
Finished tests in 0.670478s, 13.4233 tests/s, 64.1334 assertions/s.
9 tests, 43 assertions, 8 failures, 0 errors, 1 skips
ruby -v: ruby 2.4.0dev (2016-09-22 trunk 56204) [x86_64-linux]
make: *** [uncommon.mk:623: yes-test-all] エラー 8
vagrant@archlinux:~/ruby/build$ emacs --version
GNU Emacs 25.1.1
Copyright (C) 2016 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
</code></pre>
Ruby master - Bug #12777 (Closed): NoMethodError: undefined method `garbage_collect' for GC:Module
https://bugs.ruby-lang.org/issues/12777
2016-09-20T12:28:24Z
znz (Kazuhiro NISHIYAMA)
<p>RDoc says <code>GC.garbage_collect</code> is equal to <code>GC.start</code>. But <code>GC.garbage_collect</code> is a normal method. It is not a singleton method.<br>
So <code>GC.garbage_collect</code> raises <code>NoMethodError: undefined method `garbage_collect' for GC:Module</code>.<br>
Which is expected behavior?</p>
Ruby master - Bug #12773 (Closed): useless lines in lib/rss/rss.rb
https://bugs.ruby-lang.org/issues/12773
2016-09-18T10:31:12Z
znz (Kazuhiro NISHIYAMA)
<p><code>lib/rss/rss.rb</code> に</p>
<pre><code> attr = attr.id2name if attr.kind_of?(Integer)
</code></pre>
<p>という行が複数ありますが、<code>Fixnum#id2name</code> はもうないので、不要なのではないでしょうか。</p>
Ruby master - Bug #12764 (Closed): rubygems with multi default gem problem
https://bugs.ruby-lang.org/issues/12764
2016-09-15T13:31:24Z
znz (Kazuhiro NISHIYAMA)
<p>This issue may affect Ruby committers only.<br>
This does not probably affect released ruby.</p>
<p>With development ruby, <code>make install</code> many times.<br>
After them, default gems are duplicated when exists updated.<br>
And gem with old version in Gemfile does not work well.</p>
<p>Example:</p>
<pre><code>% gem list rdoc
*** LOCAL GEMS ***
rdoc (default: 5.0.0.beta2, default: 4.2.1)
% cat Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
# gem "rails"
gem 'rdoc', '4.2.1'
% cat Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
rdoc (4.2.1)
PLATFORMS
ruby
DEPENDENCIES
rdoc (= 4.2.1)
BUNDLED WITH
1.13.0
% bundle exec ruby -r rdoc -e 'p RDoc::VERSION'
"5.0.0.beta2"
</code></pre>
<p>FYI: <a href="http://blog.n-z.jp/blog/2016-09-10-bundled-gem-and-default-gem.html" class="external">Difference of bundled gem and default gem (in Japanese)</a></p>
Ruby master - Bug #12762 (Closed): missing links in LEGAL
https://bugs.ruby-lang.org/issues/12762
2016-09-14T12:50:32Z
znz (Kazuhiro NISHIYAMA)
<ul>
<li>LEGAL の Oniguruma の節にある URL が以下の3つ全てリンク切れのようです。</li>
<li>random.c の <a href="http://www.math.keio.ac.jp/matumoto/emt.html" class="external">http://www.math.keio.ac.jp/matumoto/emt.html</a> もないようです。</li>
<li>ext/win32ole/win32ole.c の <a href="http://www.ActiveWare.com" class="external">http://www.ActiveWare.com</a> もないようです。</li>
</ul>
Ruby master - Feature #12739 (Closed): deprecate_constant :Fixnum, :Bignum
https://bugs.ruby-lang.org/issues/12739
2016-09-08T14:42:50Z
znz (Kazuhiro NISHIYAMA)
<p>How about <code>class Object; deprecate_constant :Fixnum, :Bignum; end</code>?</p>
<ul>
<li>naruse supports: <a href="https://twitter.com/nalsh/status/773800491671101441" class="external">https://twitter.com/nalsh/status/773800491671101441</a>
</li>
<li>akr objects: <a href="https://twitter.com/tanaka_akr/status/773817391218249729" class="external">https://twitter.com/tanaka_akr/status/773817391218249729</a>
</li>
</ul>
<p>I don't mind either way.<br>
Do you have any comment about it?</p>
Ruby master - Bug #12736 (Closed): `make install` says `fatal: Not a git repository (or any of th...
https://bugs.ruby-lang.org/issues/12736
2016-09-07T12:29:48Z
znz (Kazuhiro NISHIYAMA)
<p><code>make install</code> の時に <code>fatal: Not a git repository (or any of the parent directories): .git</code> というメッセージが2回出ます。</p>
<p>ext/psych/psych.gemspec と lib/rdoc/rdoc.gemspec の</p>
<pre><code>s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
</code></pre>
<p>が原因のようです。</p>
Ruby master - Bug #12714 (Closed): make で $(topdir)/.ext/gems が作成される
https://bugs.ruby-lang.org/issues/12714
2016-08-30T12:40:03Z
znz (Kazuhiro NISHIYAMA)
<p>現在の trunk は make したとき、ビルドディレクトリに <code>$(topdir)/.ext/gems</code> というディレクトリが作成されるようです。</p>
<p>git bisect で調べてみたところ、r55950 から発生しているようです。</p>
Ruby master - Bug #12541 (Closed): test failure with `umask 027`
https://bugs.ruby-lang.org/issues/12541
2016-07-02T06:27:28Z
znz (Kazuhiro NISHIYAMA)
<p><code>ruby -e 'system("make", "test-all", "TESTS=fileutils/test_fileutils.rb", umask: 027)'</code> などのように <code>umask 027</code> の環境で実行すると TestFileUtils#test_cp_preserve_permissions が failure になります。</p>
<pre><code>[31/91] TestFileUtils#test_cp_preserve_permissions = 0.00 s
1) Failure:
TestFileUtils#test_cp_preserve_permissions [/home/vagrant/ruby/test/fileutils/test_fileutils.rb:286]:
File modes expected to be equal:
<0755>: "tmp/cptmp"
<0750>: "tmp/cptmp2"
</code></pre>
Ruby master - Bug #12540 (Closed): test failures when SHARABLE_MIDDLE_SUBSTRING=1
https://bugs.ruby-lang.org/issues/12540
2016-07-02T06:23:27Z
znz (Kazuhiro NISHIYAMA)
<p>SHARABLE_MIDDLE_SUBSTRING=1 でビルドすると Test_StringCStr#test_wchar_lstrip!,Test_StringCStr#test_wchar_rstrip! が失敗します。</p>
<pre><code>[16604/16757] Test_StringCStr#test_wchar_lstrip! = 0.00 s
3) Failure:
Test_StringCStr#test_wchar_lstrip! [/home/vagrant/ruby/test/-ext-/string/test_cstr.rb:81]:
Expected {#<Encoding:UTF-16BE>=>"a",
#<Encoding:UTF-16LE>=>"a",
#<Encoding:UTF-32BE>=>"a",
#<Encoding:UTF-32LE>=>"a"} to be empty.
[16606/16757] Test_StringCStr#test_wchar_rstrip! = 0.00 s
4) Failure:
Test_StringCStr#test_wchar_rstrip! [/home/vagrant/ruby/test/-ext-/string/test_cstr.rb:85]:
Expected {#<Encoding:UTF-16BE>=>" ",
#<Encoding:UTF-16LE>=>" ",
#<Encoding:UTF-32BE>=>" ",
#<Encoding:UTF-32LE>=>" "} to be empty.
</code></pre>
<p>原因を調べてみたところ、lstrip!,rstrip! だけ !SHARABLE_MIDDLE_SUBSTRING で TERM_FILL をくくっているからのようでした。</p>
<p>調べていて思ったのですが、個別に TERM_FILL を呼ぶかどうかを分岐するよりも、 SHARABLE_MIDDLE_SUBSTRING の値によって TERM_FILL 自体の定義を変更するようにした方が良いのではないでしょうか?</p>
Ruby master - Bug #12487 (Closed): -12345.digits(7) behavior
https://bugs.ruby-lang.org/issues/12487
2016-06-14T15:19:50Z
znz (Kazuhiro NISHIYAMA)
<p>rdoc of Integer#digits says <code>-12345.digits(7) #=> [4, 6, 6, 0, 5]</code>, but it raises <code>Math::DomainError: out of domain</code>.<br>
Which is expected behavior?</p>
Ruby master - Bug #12475 (Closed): SHARABLE_MIDDLE_SUBSTRING=1のとき、環境変数が正しく設定されない
https://bugs.ruby-lang.org/issues/12475
2016-06-09T14:11:28Z
znz (Kazuhiro NISHIYAMA)
<p><code>-DSHARABLE_MIDDLE_SUBSTRING=1</code> でビルドすると以下の failures がでます。</p>
<pre><code>[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">.
</code></pre>
<p>原因を調べてみたところ、<code>ENV.[]=</code> で環境変数が正しく設定されていませんでした。</p>
<pre><code>$ 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."
>>
</code></pre>
Ruby master - Bug #12339 (Closed): result of 123456789 ** -2 in doc
https://bugs.ruby-lang.org/issues/12339
2016-05-02T10:47:53Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://github.com/ruby/ruby/blob/c353ec0c9e8e941f49910a51f7dc10cf3d3cdd17/numeric.c#L3647" class="external">https://github.com/ruby/ruby/blob/c353ec0c9e8e941f49910a51f7dc10cf3d3cdd17/numeric.c#L3647</a><br>
の <code>Integer#**</code> の rdoc で</p>
<pre><code> * 123456789 ** -2 #=> 6.5610001194102e-17
</code></pre>
<p>となっていますが、実際に試してみると <code>(1/15241578750190521)</code> になります。<br>
どちらが正しいのでしょうか?</p>
<pre><code>% ruby -ve 'p 123456789 ** -2'
ruby 2.4.0dev (2016-05-02 trunk 54882) [x86_64-darwin14]
(1/15241578750190521)
</code></pre>
Ruby master - Bug #9833 (Closed): OpenSSL::X509::Certificate#inspect がわかりにくくなっている
https://bugs.ruby-lang.org/issues/9833
2014-05-13T09:01:43Z
znz (Kazuhiro NISHIYAMA)
<p>SSL/TLS の証明書の簡易的なチェックに OpenSSL::X509::Certificate#inspect を便利に使っていたのですが、最近の ruby だと subject などに内容が出なくなってわかりにくくなっているのですが、以前のように内容が出た方が良いと思うのですが、どうでしょうか。</p>
<pre><code>% cat inspect_cert.rb
#!/usr/bin/env ruby
require 'openssl'
require 'socket'
host = ARGV.shift
port = ARGV.shift.to_i
sock = TCPSocket.open(host, port)
ssl = OpenSSL::SSL::SSLSocket.new(sock)
ssl.connect
p ssl.peer_cert
% ruby1.9.1 -v inspect_cert.rb www.ruby-lang.org 443
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
#<OpenSSL::X509::Certificate subject=/OU=Domain Control Validated/CN=*.ruby-lang.org, issuer=/C=BE/O=GlobalSign nv-sa/CN=GlobalSign Domain Validation CA - SHA256 - G2, serial=1492412345881966875081918063955459968936780, not_before=2014-04-12 01:22:02 UTC, not_after=2014-08-25 05:22:02 UTC>
% ruby -v inspect_cert.rb www.ruby-lang.org 443
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
#<OpenSSL::X509::Certificate subject=#<OpenSSL::X509::Name:0x007f9b7960b230>, issuer=#<OpenSSL::X509::Name:0x007f9b7960b1b8>, serial=#<OpenSSL::BN:0x007f9b7960b140>, not_before=2014-04-12 01:22:02 UTC, not_after=2014-08-25 05:22:02 UTC>
</code></pre>
Ruby master - Bug #9266 (Closed): dead links to rubyforge
https://bugs.ruby-lang.org/issues/9266
2013-12-20T23:41:42Z
znz (Kazuhiro NISHIYAMA)
<p>For example,<br>
<a href="http://rake.rubyforge.org/doc/release_notes/rake-10_1_0_rdoc.html" class="external">http://rake.rubyforge.org/doc/release_notes/rake-10_1_0_rdoc.html</a><br>
<a href="http://rake.rubyforge.org/doc/release_notes/rake-10_0_3_rdoc.html" class="external">http://rake.rubyforge.org/doc/release_notes/rake-10_0_3_rdoc.html</a><br>
are in NEWS, but they can not open.</p>
Ruby master - Feature #8786 (Open): Process.clock_gettime(:realtime)
https://bugs.ruby-lang.org/issues/8786
2013-08-15T22:33:13Z
znz (Kazuhiro NISHIYAMA)
<p>Socket や IO#seek のように Process.clock_gettime の第一引数も Symbol で :realtime などを受け付けると良いのではないでしょうか。</p>
Backport191 - Backport #2598 (Closed): test-all で [BUG] Segmentation fault
https://bugs.ruby-lang.org/issues/2598
2010-01-12T19:49:37Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
ruby_1_9_1 の make test-all で落ちるので r25747 の変更のバックポートをお願いします。</p>
<p>IMAPTest#test_imaps_with_ca_file: /home/kazu/build/ruby/ruby_1_9_1/ruby/.ext/common/openssl/buffering.rb:35: [BUG] Segmentation fault<br>
ruby 1.9.1p378 (2010-01-10 revision 26272) [i686-linux]</p>
<h2>-- control frame ----------<br>
c:0006 p:---- s:0022 b:0022 l:000021 d:000021 CFUNC :sysread<br>
c:0005 p:0022 s:0018 b:0017 l:000016 d:000016 METHOD /home/kazu/build/ruby/ruby_1_9_1/ruby/.ext/common/openssl/buffering.rb:35<br>
c:0004 p:0051 s:0014 b:0014 l:000013 d:000013 METHOD /home/kazu/build/ruby/ruby_1_9_1/ruby/.ext/common/openssl/buffering.rb:106<br>
c:0003 p:0043 s:0007 b:0007 l:000518 d:000006 BLOCK /home/kazu/wc/ruby/branches/ruby_1_9_1/test/net/imap/test_imap.rb:134<br>
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH<br>
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP</h2>
<p>-- Ruby level backtrace information-----------------------------------------<br>
/home/kazu/build/ruby/ruby_1_9_1/ruby/.ext/common/openssl/buffering.rb:35:in <code>sysread' /home/kazu/build/ruby/ruby_1_9_1/ruby/.ext/common/openssl/buffering.rb:35:in </code>fill_rbuff'<br>
/home/kazu/build/ruby/ruby_1_9_1/ruby/.ext/common/openssl/buffering.rb:106:in <code>gets' /home/kazu/wc/ruby/branches/ruby_1_9_1/test/net/imap/test_imap.rb:134:in </code>block in imaps_test'</p>
<p>-- C level backtrace information -------------------------------------------<br>
0x4014a029 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1(rb_vm_bugreport+0x69) [0x4014a029]<br>
0x4006635f /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x4006635f]<br>
0x400663fa /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1(rb_bug+0x3a) [0x400663fa]<br>
0x400f1564 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x400f1564]<br>
0x4001d410 [0x4001d410]<br>
0x40f5553d /lib/libc.so.6(cfree+0x6d) [0x40f5553d]<br>
0x40de666b /home/kazu/build/ruby/ruby_1_9_1/ruby/.ext/i686-linux/dl.so [0x40de666b]<br>
0x4007683a /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x4007683a]<br>
0x400769b4 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x400769b4]<br>
0x40076a0b /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x40076a0b]<br>
0x4014db08 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x4014db08]<br>
0x4014dd6d /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x4014dd6d]<br>
0x4014f44e /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x4014f44e]<br>
0x4014f652 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x4014f652]<br>
0x4061c295 /home/kazu/build/ruby/ruby_1_9_1/ruby/.ext/i686-linux/openssl.so [0x4061c295]<br>
0x40137d88 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x40137d88]<br>
0x401380c4 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x401380c4]<br>
0x40143566 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x40143566]<br>
0x4013dcba /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x4013dcba]<br>
0x40141079 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x40141079]<br>
0x401430b0 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1(rb_vm_invoke_proc+0x270) [0x401430b0]<br>
0x4014eddc /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x4014eddc]<br>
0x4014eef1 /home/kazu/build/ruby/ruby_1_9_1/ruby/libruby-1.9.1.so.1.9.1 [0x4014eef1]<br>
0x401c480e /lib/tls/i686/cmov/libpthread.so.0 [0x401c480e]<br>
0x4030a8de /lib/tls/i686/cmov/libc.so.6(clone+0x5e) [0x4030a8de]</p>
<p>[NOTE]<br>
You may encounter a bug of Ruby interpreter. Bug reports are welcome.<br>
For details: <a href="http://www.ruby-lang.org/bugreport.html" class="external">http://www.ruby-lang.org/bugreport.html</a></p>
<p>Aborted<br>
make: *** [test-all] エラー 134<br>
=end</p>