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 #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 - 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 #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 #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 #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 - 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 - 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 - 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 #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 - 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 - 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 - 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 #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 #14576 (Third Party's Issue): rdoc of Random::Formatter
https://bugs.ruby-lang.org/issues/14576
2018-03-05T12:21:25Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://docs.ruby-lang.org/en/trunk/Random/Formatter.html" class="external">https://docs.ruby-lang.org/en/trunk/Random/Formatter.html</a> has following methods:</p>
<pre><code>#alphanumeric
#base64
#choose
#gen_random
#hex
#rand
#random_bytes
#random_number
#urlsafe_base64
#uuid
</code></pre>
<p>But <code>Random::Formatter.instance_methods</code> are only two methods.</p>
<pre><code>>> Random::Formatter.instance_methods
=> [:random_number, :rand]
</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 #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 #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 - Feature #13713 (Rejected): socketの便利メソッドのdatagramのUNIXSocket用対応
https://bugs.ruby-lang.org/issues/13713
2017-07-04T14:06:05Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://docs.ruby-lang.org/ja/latest/class/Socket.html" class="external">https://docs.ruby-lang.org/ja/latest/class/Socket.html</a> に</p>
<blockquote>
<p>ソケットオブジェクトを生成する汎用的な方法として Socket.new がありますが、以下のようなより便利な メソッドがあります。</p>
</blockquote>
<p>として</p>
<ul>
<li>TCP のクライアントソケット Socket.tcp TCPSocket.open</li>
<li>TCP のサーバソケット Socket.tcp_server_loop, Socket.tcp_server_sockets, TCPServer.open</li>
<li>UNIX socket のクライアントソケット Socket.unix UNIXSocket.open</li>
<li>UNIX socket のサーバソケット Socket.unix_server_loop, Socket.unix_server_socket, UNIXServer.open</li>
</ul>
<p>があげられていて、要約には書かれていませんが、UDP 用に udp_server_loop や udp_server_sockets もありますが、datagram の UNIXSocket は Socket.unix も UNIXSocket.open も対応していなくて、</p>
<p><a href="https://gist.github.com/zimbatm/9f1bc26446af0ee3e5c5#gistcomment-1902920" class="external">https://gist.github.com/zimbatm/9f1bc26446af0ee3e5c5#gistcomment-1902920</a> にあるように</p>
<pre><code>def notify_socket
@notify_socket ||= Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM, 0).tap do |socket|
socket.connect(Socket.pack_sockaddr_un(ENV["NOTIFY_SOCKET"]))
socket.close_on_exec = true
end
end
</code></pre>
<p>のように <a href="https://docs.ruby-lang.org/en/2.4.0/Socket.html#method-c-new" class="external">Socket.new(:UNIX, :DGRAM)</a> して pack_sockaddr_un して connect する必要があるようです。</p>
<p>datagram の UNIXSocket も Socket.unix(path, :DGRAM) や UNIXSocket.open(path, :DGRAM) という感じで簡単に書けるようにならないでししょうか?<br>
それとも見つけられなかっただけで、すでに簡単な方法があるのでしょうか?</p>
<p>ユースケースとしては例としてあげたように systemd の Type=notify で使われているソケットへの送信があります。</p>
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 #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 #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 #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 #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 #11730 (Closed): read_nonblock's call-seq missing options
https://bugs.ruby-lang.org/issues/11730
2015-11-22T08:32:49Z
znz (Kazuhiro NISHIYAMA)
<p><code>IO#write_nonblock</code> call-seq has <code>[, options]</code>, but <code>IO#read_nonblock</code> does not.</p>
<p>In prelude.rb:</p>
<pre><code> # call-seq:
# ios.read_nonblock(maxlen) -> string
# ios.read_nonblock(maxlen, outbuf) -> outbuf
</code></pre>
<pre><code> # call-seq:
# ios.write_nonblock(string) -> integer
# ios.write_nonblock(string [, options]) -> integer
</code></pre>
Ruby master - Bug #11608 (Closed): test -t without fd
https://bugs.ruby-lang.org/issues/11608
2015-10-20T13:30:52Z
znz (Kazuhiro NISHIYAMA)
<p>r52202 で fd 指定なしの test -t を使っていますが、<br>
<a href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html" class="external">http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html</a><br>
の RATIONALE で</p>
<blockquote>
<p>The -t file_descriptor primary is shown with a mandatory argument because the grammar is ambiguous if it can be omitted. Historical implementations have allowed it to be omitted, providing a default of 1.</p>
</blockquote>
<p>と書かれているように省略せずに指定すべきではないでしょうか。</p>
Ruby master - Bug #10890 (Closed): revision.h が空になる
https://bugs.ruby-lang.org/issues/10890
2015-02-23T12:26:17Z
znz (Kazuhiro NISHIYAMA)
<p>Ubuntu 12.04 LTS のように git が古い環境だと revision.h が空になってしまいます。<br>
原因を調べてみたところ -C オプションに対応していないからのようです。</p>
<pre><code>% git --version
git version 1.7.9.5
% ruby -vd --disable=gems tool/file2lastrev.rb --revision.h .
ruby 2.3.0dev (2015-02-23) [x86_64-linux]
[["git", "-C", ".", "log", "-n1", "--date=iso", "--grep=^ *git-svn-id: .*@[0-9][0-9]*"]]
Unknown option: -C
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
[-c name=value] [--help]
<command> [<args>]
(略)
Exception `VCS::NotFoundError' at /home/kazu/z/wc/CI/ruby/tool/vcs.rb:96 - last revision not found
file2lastrev.rb: last revision not found
</code></pre>
<p>そのままだと ruby -d でも何も出なかったので以下の変更をして試しました。</p>
<pre><code>% git diff
diff --git a/tool/vcs.rb b/tool/vcs.rb
index 9d11b3b..29bcc95 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -81,7 +81,7 @@ class VCS
end
last, changed, modified, *rest = (
begin
- if NullDevice
+ if !$DEBUG && NullDevice
save_stderr = STDERR.dup
STDERR.reopen NullDevice, 'w'
end
</code></pre>
Ruby master - Bug #9693 (Rejected): \x{} in regexp
https://bugs.ruby-lang.org/issues/9693
2014-04-02T00:49:08Z
znz (Kazuhiro NISHIYAMA)
<p><a href="https://github.com/rurema/doctree/issues/80" class="external">https://github.com/rurema/doctree/issues/80</a> の話です。</p>
<p><code>regparse.c</code> の <code>OnigSyntaxRuby</code> では <code>ONIG_SYN_OP_ESC_X_BRACE_HEX8</code> が有効になっていて、使えることを意図しているように見えるのですが、正規表現リテラルだと parser が通してくれなくて <code>syntax error, unexpected '{', expecting end-of-input</code> になるようです。</p>
<p><code>Regexp.new</code> に直接渡しても <code>re.c</code> の中で <code>invalid hex escape</code> になるので使えないようです。</p>
Ruby master - Feature #8394 (Closed): use String#b instead of dup.force_encoding("ASCII-8BIT")
https://bugs.ruby-lang.org/issues/8394
2013-05-12T12:47:46Z
znz (Kazuhiro NISHIYAMA)
<p>dup.force_encoding("ASCII-8BIT") を使っているところは b を使えば良いのではないかと思ったのですが、どうでしょうか?</p>
<p>diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb<br>
index 7de6fc7..bb5df37 100644<br>
--- a/lib/cgi/util.rb<br>
+++ b/lib/cgi/util.rb<br>
@@ -6,7 +6,7 @@ module CGI::Util</p>
<a name="-gt-27Stop2127saidFred"></a>
<h1 ># => "%27Stop%21%27+said+Fred"<a href="#-gt-27Stop2127saidFred" class="wiki-anchor">¶</a></h1>
<p>def escape(string)<br>
encoding = string.encoding</p>
<ul>
<li>string.dup.force_encoding('ASCII-8BIT').gsub(/([^ a-zA-Z0-9_.-]+)/) do</li>
</ul>
<ul>
<li>string.b.gsub(/([^ a-zA-Z0-9_.-]+)/) do<br>
'%' + $1.unpack('H2' * $1.bytesize).join('%').upcase<br>
end.tr(' ', '+').force_encoding(encoding)<br>
end<br>
diff --git a/lib/erb.rb b/lib/erb.rb<br>
index 51b128e..9cb3999 100644<br>
--- a/lib/erb.rb<br>
+++ b/lib/erb.rb<br>
@@ -596,7 +596,7 @@ class ERB<br>
def compile(s)<br>
enc = s.encoding<br>
raise ArgumentError, "#{enc} is not ASCII compatible" if enc.dummy?</li>
</ul>
<ul>
<li>
<pre><code> s = s.dup.force_encoding("ASCII-8BIT") # don't use constant Enoding::ASCII_8BIT for miniruby
</code></pre>
</li>
</ul>
<ul>
<li>
<pre><code> s = s.b
enc = detect_magic_comment(s) || enc
out = Buffer.new(self, enc)
</code></pre>
</li>
</ul>
<p>@@ -948,7 +948,7 @@ class ERB<br>
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide<br>
#<br>
def url_encode(s)</p>
<ul>
<li>
<pre><code> s.to_s.dup.force_encoding("ASCII-8BIT").gsub(/[^a-zA-Z0-9_\-.]/n) {
</code></pre>
</li>
</ul>
<ul>
<li>
<pre><code> s.to_s.b.gsub(/[^a-zA-Z0-9_\-.]/n) {
sprintf("%%%02X", $&.unpack("C")[0])
}
</code></pre>
end</li>
</ul>
Ruby master - Bug #7770 (Closed): rand(range) is not document
https://bugs.ruby-lang.org/issues/7770
2013-02-01T23:52:23Z
znz (Kazuhiro NISHIYAMA)
<p>Random#rand(range) is written in RDoc of random_rand, but rand(range) is not written in RDoc of rb_f_rand.</p>
Ruby master - Bug #7579 (Closed): TestGemExtCmakeBuilder#test_self_build failed in ja_JP.UTF-8 lo...
https://bugs.ruby-lang.org/issues/7579
2012-12-17T07:25:00Z
znz (Kazuhiro NISHIYAMA)
<p>TestGemExtCmakeBuilder#test_self_build failed in ja_JP.UTF-8 locale.<br>
It should set locale C before invoking make.<br>
Attached patch will revolve this issue.</p>
<ol>
<li>Failure:<br>
test_self_build(TestGemExtCmakeBuilder) [.../ruby/test/rubygems/test_gem_ext_cmake_builder.rb:46]:<br>
--- expected<br>
+++ actual<br>
@@ -1 +1,3 @@<br>
-""<br>
+"make[1]: ディレクトリ <code>.../tmp/test/test_rubygems_16184/ext' に入ります +make[1]: ディレクトリ </code>.../tmp/test/test_rubygems_16184/ext' から出ます<br>
+"</li>
</ol>
Ruby master - Bug #6774 (Closed): test failures when *_proxy already set
https://bugs.ruby-lang.org/issues/6774
2012-07-23T01:39:53Z
znz (Kazuhiro NISHIYAMA)
<p>他の組み合わせでもおきますが、 proxy 関連の環境変数が設定されていると test_find_proxy が失敗します。</p>
<p>% env -u http_proxy -u https_proxy ftp_proxy= ruby -v test/uri/test_generic.rb<br>
ruby 2.0.0dev (2012-07-23 trunk 36494) [x86_64-linux]<br>
Run options:</p>
<a name="Running-tests"></a>
<h1 >Running tests:<a href="#Running-tests" class="wiki-anchor">¶</a></h1>
<p>[ 3/12] URI::TestGeneric#test_find_proxy = 0.00 s</p>
<ol>
<li>Failure:<br>
test_find_proxy(URI::TestGeneric) [test/uri/test_generic.rb:740]:<br>
Expected #<URI::Generic:0x007fbdb6c16e40 URL:> to be nil.</li>
</ol>
<p>Finished tests in 0.015542s, 772.1030 tests/s, 19624.2844 assertions/s.<br>
12 tests, 305 assertions, 1 failures, 0 errors, 0 skips</p>
Ruby master - Bug #6598 (Closed): tool/runruby.rb の File.realpath
https://bugs.ruby-lang.org/issues/6598
2012-06-16T00:54:11Z
znz (Kazuhiro NISHIYAMA)
<p>File.realpath が定義されていないときに定義している File.realpath がホームディレクトリを返すだけで File.realpath の代わりになっていません。</p>
Ruby master - Bug #6597 (Closed): README.EXT と README.EXT.ja の内容が違う
https://bugs.ruby-lang.org/issues/6597
2012-06-16T00:51:36Z
znz (Kazuhiro NISHIYAMA)
<p>r35977 で README.EXT だけ変更されているので README.EXT.ja も更新が必要だと思います。</p>
Ruby master - Bug #5637 (Closed): warnings of shellescape
https://bugs.ruby-lang.org/issues/5637
2011-11-15T16:29:56Z
znz (Kazuhiro NISHIYAMA)
<p>\あ</p>
Ruby master - Bug #4143 (Closed): warning: "SUPPORT_JOKE" is not defined
https://bugs.ruby-lang.org/issues/4143
2010-12-10T11:18:05Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
chkbuild で以前から<br>
id.h:110:5: warning: "SUPPORT_JOKE" is not defined<br>
id.h:116:5: warning: "SUPPORT_JOKE" is not defined<br>
という警告が出ているのですが、id.h で「#if SUPPORT_JOKE」として参照しているのに<br>
SUPPORT_JOKE を #define している vm_opts.h を include せずに id.h だけを<br>
include しているファイルがあるからのようです。<br>
(debug.c のように vm_core.h 経由で vm_opts.h を include した後に id.h を<br>
include しているものもある。)</p>
<p>というわけで以下の修正で警告は出なくなるようです。</p>
<p>diff --git a/template/id.h.tmpl b/template/id.h.tmpl<br>
index b91292a..29548de 100644<br>
--- a/template/id.h.tmpl<br>
+++ b/template/id.h.tmpl<br>
@@ -50,6 +50,8 @@ end<br>
#include "parse.h"<br>
#endif</p>
<p>+#include "vm_opts.h" /* for SUPPORT_JOKE */<br>
+<br>
#define symIFUNC ID2SYM(idIFUNC)<br>
#define symCFUNC ID2SYM(idCFUNC)<br>
=end</p>
Ruby master - Bug #3477 (Closed): un.rb: httpd: --max-clients does not work
https://bugs.ruby-lang.org/issues/3477
2010-06-25T04:27:01Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
un.rb の httpd で --max-clients オプションを指定すると ArgumentError になります。<br>
どこかで to_i しておかないといけないようです。</p>
<p>% ruby-trunk -v<br>
ruby 1.9.3dev (2010-06-18 trunk 28359) [x86_64-linux]<br>
% ruby-trunk -run -e httpd -- --max-clients=1 .<br>
.../thread.rb:252:in <code>>': comparison of String with 0 failed (ArgumentError) from .../thread.rb:252:in </code>initialize'<br>
from .../webrick/server.rb:49:in <code>new' from .../webrick/server.rb:49:in </code>initialize'<br>
from .../webrick/httpserver.rb:24:in <code>initialize' from .../un.rb:311:in </code>new'<br>
from .../un.rb:311:in <code>block in httpd' from .../un.rb:60:in </code>setup'<br>
from .../un.rb:302:in <code>httpd' from -e:1:in </code>'<br>
%<br>
=end</p>
Ruby master - Bug #3476 (Closed): un.rb: httpd: invalid option --http-version
https://bugs.ruby-lang.org/issues/3476
2010-06-25T04:24:29Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
un.rb の httpd の help で --http-version というオプションがあると出ますが、<br>
--HTTPVersion にしないと使えません。</p>
<p>% ruby-trunk -v<br>
ruby 1.9.3dev (2010-06-18 trunk 28359) [x86_64-linux]<br>
% ruby-trunk -run -e help httpd<br>
Run WEBrick HTTP server.</p>
<p>ruby -run -e httpd -- [OPTION] DocumentRoot</p>
<p>--bind-address=ADDR address to bind<br>
--port=NUM listening port number<br>
--max-clients=MAX max number of simultaneous clients<br>
--temp-dir=DIR temporary directory<br>
--do-not-reverse-lookup disable reverse lookup<br>
--request-timeout=SECOND request timeout in seconds<br>
--http-version=VERSION HTTP version<br>
-v verbose</p>
<p>% ruby-trunk -run -e httpd -- --http-version=1.0 .<br>
.../un.rb:52:in <code>block in setup': invalid option: --http-version=1.0 (OptionParser::InvalidOption) from .../un.rb:38:in </code>new'<br>
from .../un.rb:38:in <code>setup' from .../un.rb:302:in </code>httpd'<br>
from -e:1:in `'<br>
%<br>
=end</p>
Ruby master - Bug #3371 (Closed): test-all aborted on amd64 lenny
https://bugs.ruby-lang.org/issues/3371
2010-05-31T19:48:30Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
amd64のlennyで<br>
<a href="http://chkbuild.n-z.jp/ruby/debian-amd64/ruby-trunk/log/20100507T073828.diff.txt.gz" class="external">http://chkbuild.n-z.jp/ruby/debian-amd64/ruby-trunk/log/20100507T073828.diff.txt.gz</a><br>
のあたりから test-all がすべてのテストを実行後、 Aborted (core dumped) になって結果が表示されません。<br>
=end</p>
Ruby master - Bug #3168 (Closed): TypeError in Timeout.timeout
https://bugs.ruby-lang.org/issues/3168
2010-04-19T08:00:06Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
<a href="http://d.hatena.ne.jp/moro/20100416/1271410920" class="external">http://d.hatena.ne.jp/moro/20100416/1271410920</a> で知ったのですが、timeout待ち用のスレッドが sleep の例外を無視してるのはまずいのではないでしょうか?</p>
<p>diff --git a/test/test_timeout.rb b/test/test_timeout.rb<br>
index 9ec9c02..472e7ad 100644<br>
--- a/test/test_timeout.rb<br>
+++ b/test/test_timeout.rb<br>
@@ -23,4 +23,12 @@ class TestTimeout < Test::Unit::TestCase<br>
end<br>
assert @flag, "<a href="/issues/1402">[ruby-dev:38319]</a>"<br>
end<br>
+</p>
<ul>
<li>def test_cannot_convert_into_time_interval</li>
<li>aoe = Thread.abort_on_exception</li>
<li>Thread.abort_on_exception = true</li>
<li>Timeout.timeout(1.i) { sleep 0.1 }</li>
<li>ensure</li>
<li>Thread.abort_on_exception = aoe</li>
<li>end<br>
end<br>
=end</li>
</ul>
Ruby master - Bug #3123 (Closed): uninitialized constant Object::C (NameError)
https://bugs.ruby-lang.org/issues/3123
2010-04-11T08:43:47Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
いつの間にかトップレベルでの uninitialized constant で Object:: が付くようになってしまっています。</p>
<p>% ruby-trunk -ve C<br>
ruby 1.9.2dev (2010-04-10 trunk 27284) [x86_64-linux]<br>
-e:1:in `': uninitialized constant Object::C (NameError)<br>
%</p>
<p>どこからなのか git bisect で調べてみたところ r25984 からのようです。<br>
=end</p>
Ruby master - Bug #3012 (Closed): update file list in sample/README
https://bugs.ruby-lang.org/issues/3012
2010-03-25T19:49:39Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
diff --git a/sample/README b/sample/README<br>
index 9187a9d..930172b 100644<br>
--- a/sample/README<br>
+++ b/sample/README<br>
@@ -3,10 +3,10 @@ biorhythm.rb biorhythm calculator<br>
cal.rb cal(1) clone<br>
cbreak.rb no echo done by ioctl<br>
clnt.rb socket client<br>
+coverage.rb<br>
dir.rb directory access<br>
dualstack-fetch.rb IPv6 demo<br>
dualstack-httpd.rb IPv6 demo<br>
-dstore.rb object database on dbm<br>
eval.rb simple evaluator<br>
export.rb method access example<br>
exyacc.rb extrace BNF from yacc file<br>
@@ -19,8 +19,6 @@ fib.scm Fibonacci number (Scheme)<br>
freq.rb count word occurrence<br>
from.rb scan mail spool<br>
fullpath.rb convert ls -lR to fullpath format<br>
-io.rb io test<br>
-irb.rb interactive ruby<br>
less.rb front end for less<br>
list.rb stupid object sample<br>
list2.rb stupid object sample<br>
@@ -37,11 +35,11 @@ pi.rb calculate PI<br>
rcs.awk random character stereogram (AWK)<br>
rcs.rb random character stereogram (Ruby)<br>
rcs.dat data for random character stereogram<br>
-rd2html.rb rd (Ruby Document) to HTML translator<br>
sieve.rb sieve of Eratosthenes<br>
svr.rb socket server<br>
test.rb test suite used by `make test'<br>
time.rb /usr/bin/time clone<br>
+timeout.rb<br>
trojan.rb simple tool to find file that may be trojan horse.<br>
tsvr.rb socket server using thread<br>
uumerge.rb merge files and uudecode them<br>
=end</p>
Ruby master - Bug #2695 (Closed): Supported Platforms
https://bugs.ruby-lang.org/issues/2695
2010-01-31T13:25:51Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
<a href="http://redmine.ruby-lang.org/wiki/ruby-19/SupportedPlatforms" class="external">http://redmine.ruby-lang.org/wiki/ruby-19/SupportedPlatforms</a> の Supported ですが、Debian GNU/Linux 4.0 on IA32 はセキュリティサポートももうすぐ終わるので、5.0 にあげた方が良いのではないでしょうか?</p>
<ul>
<li>
<a href="http://www.jp.debian.org/News/2010/20100121" class="external">http://www.jp.debian.org/News/2010/20100121</a><br>
=end</li>
</ul>
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>
Ruby master - Bug #1865 (Closed): uninitialized class variable @@accept_charset in CGI
https://bugs.ruby-lang.org/issues/1865
2009-08-03T12:33:55Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
cgi/util を直接 require して CGI.unescape を使うと NameError になります。</p>
<p>% ruby-trunk -v -r cgi/util -e 'CGI.unescape("")'<br>
ruby 1.9.2dev (2009-08-03 trunk 24359) [i686-linux]<br>
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.1/cgi/util.rb:15:in <code>unescape': uninitialized class variable @@accept_charset in CGI (NameError) from -e:1:in </code>'<br>
=end</p>
Ruby master - Feature #1800 (Closed): rubygems can replace system executable files
https://bugs.ruby-lang.org/issues/1800
2009-07-21T19:48:16Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
Japanese blog <a href="http://wota.jp/ac/?date=20090604#p01" class="external">http://wota.jp/ac/?date=20090604#p01</a> says,<br>
gem has bin/ls and Gem::Specification#executables= ["ls"],<br>
rubygem overwrites /usr/bin/ls without confirming.</p>
<p>I think this is potential security risk.<br>
=end</p>
Ruby master - Bug #1692 (Closed): warning: useless use of a literal in void context
https://bugs.ruby-lang.org/issues/1692
2009-06-26T16:14:58Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
1.8 では<br>
warning: useless use of a literal in void context<br>
が出るときに 1.9 だと何も出ません。</p>
<p>% ruby18 -ve '1'<br>
ruby 1.8.8dev (2009-06-23 revision 23825) [i686-linux]<br>
-e:1: warning: useless use of a literal in void context<br>
% ruby-trunk -ve '1'<br>
ruby 1.9.2dev (2009-06-24 trunk 23837) [i686-linux]<br>
%<br>
=end</p>
Ruby master - Bug #1675 (Closed): typo in variable.c
https://bugs.ruby-lang.org/issues/1675
2009-06-22T18:07:58Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
geneic は generic の typo ではないでしょうか。</p>
<a name="Index-trunkvariablec"></a>
<h1 >Index: trunk/variable.c<a href="#Index-trunkvariablec" class="wiki-anchor">¶</a></h1>
<p>--- trunk/variable.c (revision 23818)<br>
+++ trunk/variable.c (working copy)<br>
@@ -920,7 +920,7 @@<br>
}</p>
<h1>size_t<br>
-rb_geneic_ivar_memsize(VALUE obj)<br>
+rb_generic_ivar_memsize(VALUE obj)<br>
{<br>
st_data_t tbl;<br>
if (st_delete(generic_iv_tbl, &obj, &tbl))<br>
Index: trunk/ext/objspace/objspace.c</h1>
<p>--- trunk/ext/objspace/objspace.c (revision 23818)<br>
+++ trunk/ext/objspace/objspace.c (working copy)<br>
@@ -34,7 +34,7 @@<br>
size_t st_memsize(st_table *);<br>
size_t rb_io_memsize(rb_io_t *);<br>
size_t onig_memsize(regex_t *);<br>
-size_t rb_geneic_ivar_memsize(VALUE);<br>
+size_t rb_generic_ivar_memsize(VALUE);<br>
size_t rb_objspace_data_type_memsize(VALUE obj);</p>
<p>void rb_objspace_each_objects(<br>
@@ -51,7 +51,7 @@<br>
}</p>
<pre><code> if (FL_TEST(obj, FL_EXIVAR)) {
</code></pre>
<ul>
<li>size += rb_geneic_ivar_memsize(obj);</li>
</ul>
<ul>
<li>
<p>size += rb_generic_ivar_memsize(obj);<br>
}</p>
<p>switch (BUILTIN_TYPE(obj)) {<br>
=end</p>
</li>
</ul>
Ruby master - Bug #1523 (Closed): typo in sample/optparse/opttest.rb
https://bugs.ruby-lang.org/issues/1523
2009-05-26T20:15:10Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
separator ではないでしょうか。</p>
<a name="Index-opttestrb"></a>
<h1 >Index: opttest.rb<a href="#Index-opttestrb" class="wiki-anchor">¶</a></h1>
<p>--- opttest.rb (リビジョン 23541)<br>
+++ opttest.rb (作業コピー)<br>
@@ -13,7 +13,7 @@ ARGV.options do<br>
|opts|<br>
opts.banner << " argv..."</p>
<ul>
<li>
<a name="separater"></a>
<h1 >separater<a href="#separater" class="wiki-anchor">¶</a></h1>
</li>
</ul>
<ul>
<li>
<a name="separator"></a>
<h1 >separator<a href="#separator" class="wiki-anchor">¶</a></h1>
opts.on_tail<br>
opts.on_tail("common options:")<br>
=end</li>
</ul>
Backport191 - Backport #1485 (Rejected): warning in pathname when verbose mode
https://bugs.ruby-lang.org/issues/1485
2009-05-18T20:06:11Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
verbose mode で pathname を require すると warning がでます。</p>
<p>% ruby-trunk -v -r pathname -e ''<br>
ruby 1.9.2dev (2009-05-15 trunk 23433) [i686-linux]<br>
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.1/pathname.rb:273: warning: <code>*' interpreted as argument prefix % ruby-1.9.1 -v -r pathname -e '' ruby 1.9.1p129 (2009-05-12 revision 23411) [i686-linux] /home/kazu/opt/ruby-1.9.1/lib/ruby-1.9.1/1.9.1/pathname.rb:270: warning: </code><em>' interpreted as argument prefix<br>
% ruby18 -v -r pathname -e ''<br>
ruby 1.8.8dev (2009-05-15 revision 23432) [i686-linux]<br>
/home/kazu/opt/ruby18/lib/ruby/1.8/pathname.rb:263: warning: `</em>' interpreted as argument prefix<br>
% ruby-1.8.7 -v -r pathname -e ''<br>
ruby 1.8.7 (2009-04-08 patchlevel 160) [i686-linux]<br>
% ruby-1.8.6 -v -r pathname -e ''<br>
ruby 1.8.6 (2009-03-31 patchlevel 368) [i686-linux]<br>
%<br>
=end</p>
Ruby master - Bug #1483 (Rejected): some commands installed without program-suffix
https://bugs.ruby-lang.org/issues/1483
2009-05-18T17:32:52Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
trunkでrubyとgoruby以外にconfigureで指定した--program-suffixが反映されなくなっているようです。</p>
<p>% \ls $(ruby-trunk -r rbconfig -e 'puts RbConfig::CONFIG["bindir"]')<br>
erb gem goruby-trunk irb rake rdoc ri ruby-trunk testrb<br>
% \ls $(ruby-1.9.1 -r rbconfig -e 'puts RbConfig::CONFIG["bindir"]')<br>
erb-1.9.1 goruby-1.9.1 rake-1.9.1 ri-1.9.1 testrb-1.9.1<br>
gem-1.9.1 irb-1.9.1 rdoc-1.9.1 ruby-1.9.1<br>
%<br>
=end</p>
Ruby master - Bug #1435 (Closed): README.ja: 「defined(THINK_C)」
https://bugs.ruby-lang.org/issues/1435
2009-05-06T01:21:45Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
「* 移植」のところに</p>
<blockquote>
<p>「defined(THINK_C)」で<br>
括られている部分を参考にしてください</p>
</blockquote>
<p>と書かれていますが、「defined(THINK_C)」がREADME.ja以外に見つかりません。<br>
=end</p>
Ruby 1.8 - Bug #1417 (Closed): sleepすると反応がなくなる
https://bugs.ruby-lang.org/issues/1417
2009-04-28T18:57:12Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
ruby_1_8 ブランチで --enable-pthread のとき、スレッドを生成した後 sleep すると<br>
何も反応がなくなって SIGKILL で強制的に止めるしかなくなってしまいます。</p>
<p>% ruby18 -ve 'Thread.start{};sleep 1'<br>
ruby 1.8.8dev (2009-04-26 revision 23283) [i686-linux]<br>
ここで止まってCtrl+Cもきかない<br>
=end</p>
Ruby 1.8 - Bug #1402 (Closed): test_cookie(TestCookie)でtest-allが止まる
https://bugs.ruby-lang.org/issues/1402
2009-04-24T12:53:52Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
<a href="http://www.rubyist.net/~akr/chkbuild/debian/ruby-1.8-pth/last" class="external">http://www.rubyist.net/~akr/chkbuild/debian/ruby-1.8-pth/last</a><br>
のように ruby 1.8.8dev で --enable-pthread の場合に止まります。</p>
<p>挙動から推測すると、while修飾子の左がリテラルだとスレッドが<br>
切り替わっていないような気がします。</p>
<p>% cat t.rb<br>
require 'timeout'<br>
@flag = true<br>
Thread.start {<br>
sleep 0.1<br>
@flag = false<br>
}<br>
Timeout.timeout(1) {<br>
nil while @flag<br>
}<br>
% ruby18 -vd t.rb<br>
ruby 1.8.8dev (2009-04-22 revision 23257) [i686-linux]<br>
=end</p>
Ruby master - Bug #1146 (Closed): TestSocket#test_udp_server hangs when configure --with-lookup-o...
https://bugs.ruby-lang.org/issues/1146
2009-02-12T10:58:05Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
configureのときに--with-lookup-order-hack=INETをつけていると<br>
Socket.udp_server_sockets(0) {|sockets| ... } で sockets に<br>
IPv6で待ち受けていないのに、Socket.ip_address_list には IPv6 の<br>
アドレスがあるので、IPv6でのsendmsgで止まってしまうようです。</p>
<p>以下のようにして調べてみると "::" の有無があることがわかります。</p>
<p>また、--with-lookup-order-hack=INET ありで止まってしまうときに<br>
Ctrl+C を2回押さないと反応がありませんでした。</p>
<a name="Index-testsockettest_socketrb"></a>
<h1 >Index: test/socket/test_socket.rb<a href="#Index-testsockettest_socketrb" class="wiki-anchor">¶</a></h1>
<p>--- test/socket/test_socket.rb (revision 22249)<br>
+++ test/socket/test_socket.rb (working copy)<br>
@@ -233,6 +233,7 @@ class TestSocket < Test::Unit::TestCase<br>
end</p>
<pre><code> Socket.udp_server_sockets(0) {|sockets|
</code></pre>
<p>+p sockets.map{|ai| ai.local_address.ip_address } - ip_addrs.map(&:ip_address)<br>
begin<br>
port = sockets.first.local_address.ip_port</p>
<p>--with-lookup-order-hack=INET なし:<br>
% /tmp/r/bin/ruby -v ~/wc/ruby/trunk/test/socket/test_socket.rb -v<br>
ruby 1.9.2dev (2009-02-12 trunk 22247) [i686-linux]<br>
Loaded suite /home/kazu/wc/ruby/trunk/test/socket/test_socket<br>
Started<br>
TestSocket#test_accept_loop: 0.00 s: .<br>
TestSocket#test_accept_loop_with_unix: 0.00 s: .<br>
TestSocket#test_getaddrinfo: 0.00 s: .<br>
TestSocket#test_getnameinfo: 0.00 s: .<br>
TestSocket#test_initialize: 0.00 s: .<br>
TestSocket#test_ip_address_list: 0.00 s: .<br>
TestSocket#test_socket_new: 0.00 s: .<br>
TestSocket#test_sysaccept: 0.00 s: .<br>
TestSocket#test_tcp: 0.00 s: .<br>
TestSocket#test_tcp_server_sockets: 0.00 s: .<br>
TestSocket#test_tcp_server_sockets_port0: 0.00 s: .<br>
TestSocket#test_udp_server: ["::"]<br>
0.01 s: .<br>
TestSocket#test_unix: 0.00 s: .<br>
TestSocket#test_unix_server_socket: 0.00 s: .<br>
TestSocket#test_unpack_sockaddr: 0.00 s: .</p>
<p>Finished in 0.042818 seconds.</p>
<p>15 tests, 68 assertions, 0 failures, 0 errors, 0 skips<br>
%</p>
<p>--with-lookup-order-hack=INET あり:<br>
% /tmp/r2/bin/ruby -v ~/wc/ruby/trunk/test/socket/test_socket.rb -v<br>
ruby 1.9.2dev (2009-02-12 trunk 22247) [i686-linux]<br>
Loaded suite /home/kazu/wc/ruby/trunk/test/socket/test_socket<br>
Started<br>
TestSocket#test_accept_loop: 0.00 s: .<br>
TestSocket#test_accept_loop_with_unix: 0.00 s: .<br>
TestSocket#test_getaddrinfo: 0.00 s: .<br>
TestSocket#test_getnameinfo: 0.00 s: .<br>
TestSocket#test_initialize: 0.00 s: .<br>
TestSocket#test_ip_address_list: 0.00 s: .<br>
TestSocket#test_socket_new: 0.00 s: .<br>
TestSocket#test_sysaccept: 0.00 s: .<br>
TestSocket#test_tcp: 0.00 s: .<br>
TestSocket#test_tcp_server_sockets: 0.00 s: .<br>
TestSocket#test_tcp_server_sockets_port0: 0.00 s: .<br>
TestSocket#test_udp_server: []<br>
^C^C1.77 s: E<br>
TestSocket#test_unix: 0.00 s: .<br>
TestSocket#test_unix_server_socket: 0.00 s: .<br>
TestSocket#test_unpack_sockaddr: 0.00 s: .</p>
<p>Finished in 1.780257 seconds.</p>
<ol>
<li>Error:<br>
test_udp_server(TestSocket):<br>
Interrupt:<br>
/home/kazu/wc/ruby/trunk/test/socket/test_socket.rb:260:in <code>sendmsg' /home/kazu/wc/ruby/trunk/test/socket/test_socket.rb:260:in </code>block (2 levels) in test_udp_server'</li>
</ol>
<p>15 tests, 54 assertions, 0 failures, 1 errors, 0 skips<br>
%<br>
=end</p>
Ruby master - Bug #1138 (Rejected): rdoc of taint/untrust
https://bugs.ruby-lang.org/issues/1138
2009-02-11T03:17:10Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
taintとuntrustのrdocのcall-seqの「->」は「=>」の間違いではないでしょうか?</p>
<ul>
<li>
<p>call-seq:</p>
</li>
<li>
<pre><code>obj.taint -> obj
</code></pre>
</li>
<li>
<p>call-seq:</p>
</li>
<li>
<pre><code>obj.untrust -> obj
</code></pre>
</li>
</ul>
<p>=end</p>
Ruby master - Bug #1115 (Closed): $SAFE=1でのrequireがSecurityErrorになる
https://bugs.ruby-lang.org/issues/1115
2009-02-06T02:20:29Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
<a href="https://blade.ruby-lang.org/ruby-dev/37843">[ruby-dev:37843]</a>の件がredmineにチケットとして登録されていなかったので、登録します。</p>
<p>現在わかっている条件は以下の2つです。</p>
<ol>
<li>*.soをrequireする。</li>
</ol>
<p>% ruby-1.9.1 -ve '$SAFE=1;p require "zlib"'<br>
ruby 1.9.1p0 (2009-02-02 revision 21960) [i686-linux]<br>
-e:1:in <code>require': Insecure operation - require (SecurityError) from -e:1:in </code>'<br>
%</p>
<ol start="2">
<li>何かgemをインストールした状態で何でもいいのでrequireする。</li>
</ol>
<p>% ruby-1.9.1 -ve '$SAFE=1;p require "English"'<br>
ruby 1.9.1p0 (2009-02-02 revision 21960) [i686-linux]<br>
-e:1:in <code>require': Insecure operation - require (SecurityError) from -e:1:in </code>'<br>
%</p>
<p>何もgemをインストールしていなければ成功します。</p>
<p>% ruby-1.9.1 -ve '$SAFE=1;p require "English"'<br>
ruby 1.9.1p0 (2009-02-02 revision 21960) [i686-linux]<br>
true<br>
%<br>
=end</p>
Backport191 - Backport #1072 (Closed): Ripper#filename
https://bugs.ruby-lang.org/issues/1072
2009-01-30T05:13:46Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
Ripper::Filter#filenameが定義されているのにRipper#filenameが定義されていないため、NoMethodErrorになります。</p>
<p>% cat ~/check_regexp_n.rb<br>
#!/usr/bin/ruby</p>
<p>require 'ripper/filter'</p>
<p>class CheckRegexpN < Ripper::Filter<br>
def on_regexp_end(token, data)<br>
if /n/ =~ token<br>
puts "#{filename}:#{lineno}:#{column}:#{token}"<br>
end<br>
end<br>
end</p>
<p>ARGV.each do |path|<br>
open(path, "rb") do |f|<br>
parser = CheckRegexpN.new(f, path)<br>
p [parser.filename, parser.lineno, parser.column]<br>
parser.parse<br>
p [parser.filename, parser.lineno, parser.column]<br>
end<br>
end<br>
% ruby-trunk -vd ~/check_regexp_n.rb lib/minitest/spec.rb<br>
ruby 1.9.1p5000 (2009-01-30 trunk 21885) [i686-linux]<br>
Exception <code>NoMethodError' at .../1.9.1/ripper/filter.rb:27 - undefined method </code>filename' for #<a href="Ripper::Lexer:0x8170bbc" class="external">Ripper::Lexer:0x8170bbc</a><br>
.../1.9.1/ripper/filter.rb:27:in <code>filename': undefined method </code>filename' for #<a href="Ripper::Lexer:0x8170bbc" class="external">Ripper::Lexer:0x8170bbc</a> (NoMethodError)<br>
from .../check_regexp_n.rb:16:in <code>block (2 levels) in <main>' from .../check_regexp_n.rb:14:in </code>open'<br>
from .../check_regexp_n.rb:14:in <code>block in <main>' from .../check_regexp_n.rb:13:in </code>each'<br>
from .../check_regexp_n.rb:13:in `'<br>
%</p>
<p>ripper_linenoをまねして以下のようにripper_filenameを定義してみたのですが、<br>
if (NIL_P(parser->parsing_thread)) return Qnil;<br>
の行があるとnilしか返ってこなかったのでコメントアウトしています。</p>
<a name="Index-parsey"></a>
<h1 >Index: parse.y<a href="#Index-parsey" class="wiki-anchor">¶</a></h1>
<p>--- parse.y (リビジョン 21885)<br>
+++ parse.y (作業コピー)<br>
@@ -10239,6 +10239,25 @@</p>
<p>/*</p>
<ul>
<li>call-seq:</li>
</ul>
<ul>
<li>
<ul>
<li>ripper#filename -> String</li>
</ul>
</li>
<li>
<ul>
<li>
</ul>
</li>
<li>
<ul>
<li>Return current parsing filename.</li>
</ul>
</li>
<li>*/<br>
+static VALUE<br>
+ripper_filename(VALUE self)<br>
+{</li>
<li>struct parser_params *parser;</li>
<li>
<li>Data_Get_Struct(self, struct parser_params, parser);</li>
<li>if (!ripper_initialized_p(parser)) {</li>
<li>
<pre><code> rb_raise(rb_eArgError, "method called for uninitialized object");
</code></pre>
</li>
<li>}<br>
+/* if (NIL_P(parser->parsing_thread)) return Qnil; */</li>
<li>return parser->parser_ruby_sourcefile_string;<br>
+}</li>
<li>
</ul>
<p>+/*</p>
<ul>
<li>
<ul>
<li>call-seq:</li>
<li>ripper#lineno -> Integer</li>
<li>
<li>Return line number of current parsing line.<br>
@@ -10288,6 +10307,7 @@<br>
rb_define_method(Ripper, "initialize", ripper_initialize, -1);<br>
rb_define_method(Ripper, "parse", ripper_parse, 0);<br>
rb_define_method(Ripper, "column", ripper_column, 0);</li>
</ul>
</li>
<li>rb_define_method(Ripper, "filename", ripper_filename, 0);<br>
rb_define_method(Ripper, "lineno", ripper_lineno, 0);<br>
rb_define_method(Ripper, "end_seen?", rb_parser_end_seen_p, 0);<br>
rb_define_method(Ripper, "encoding", rb_parser_encoding, 0);<br>
=end</li>
</ul>
Ruby master - Bug #1071 (Closed): ripper: 改行を含む正規表現のon_regexp_endが変
https://bugs.ruby-lang.org/issues/1071
2009-01-30T05:13:39Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
正規表現に改行が含まれていると改行の後がon_tstring_contentではなくon_regexp_endに含まれるのは変なのではないでしょうか?</p>
<p>% ruby-trunk -v -r ripper -r pp -e 'pp Ripper.lex("/foo\nbar/")'<br>
ruby 1.9.1p5000 (2009-01-30 trunk 21885) [i686-linux]<br>
[[[1, 0], :on_regexp_beg, "/"],<br>
[[1, 1], :on_tstring_content, "foo\n"],<br>
[[2, 0], :on_regexp_end, "bar/"]]<br>
%<br>
=end</p>
Ruby master - Feature #1038 (Closed): Signal.trapのcommandにSymbol
https://bugs.ruby-lang.org/issues/1038
2009-01-22T18:22:39Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
Signal.trapの第1引数のsignalの方はSymbolでも受け付けるので<br>
第2引数のcommandの方も"SIG_IGN"などをStringだけではなく<br>
Symbolでも受け付けるようにしてほしいです。</p>
<p>% ruby-trunk -ve 'Signal.trap(:CHLD,:IGNORE);fork{exec("true")};sleep 1'<br>
ruby 1.9.1p5000 (2009-01-21 trunk 21717) [i686-linux]<br>
-e:1:in <code>sleep': undefined method </code>call' for :IGNORE:Symbol (NoMethodError)<br>
from -e:1:in `'<br>
% ruby-trunk -ve 'Signal.trap(:CHLD,"IGNORE");fork{exec("true")};sleep 1'<br>
ruby 1.9.1p5000 (2009-01-21 trunk 21717) [i686-linux]<br>
%<br>
=end</p>
Ruby master - Bug #900 (Closed): warnings in *.rb
https://bugs.ruby-lang.org/issues/900
2008-12-17T21:15:42Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
results in lib:<br>
% find lib -name '*.rb' | xargs -n1 ruby-trunk -wc 2>&1 | grep -v '^Syntax OK$' lib/optparse/version.rb:29: warning: shadowing outer local variable - pkg<br>
lib/optparse/version.rb:50: warning: shadowing outer local variable - klass<br>
lib/rinda/ring.rb:259: warning: shadowing outer local variable - ts<br>
lib/rinda/ring.rb:265: warning: shadowing outer local variable - ts<br>
lib/racc/parser.rb:173: warning: shadowing outer local variable - tok<br>
lib/racc/parser.rb:192: warning: (...) interpreted as grouped expression<br>
lib/shell/command-processor.rb:29: warning: shadowing outer local variable - m<br>
lib/shell/command-processor.rb:127: warning: <code>&' interpreted as argument prefix lib/shell/process-controller.rb:65: warning: </code>&' interpreted as argument prefix<br>
lib/rexml/validation/relaxng.rb:439: warning: mismatched indentations at 'end' with 'if' at 433<br>
lib/prime.rb:414: warning: shadowing outer local variable - j<br>
lib/net/imap.rb:3219: warning: shadowing outer local variable - k<br>
lib/irb/completion.rb:162: warning: shadowing outer local variable - m<br>
lib/irb/ext/change-ws.rb:59: warning: mismatched indentations at 'end' with 'class' at 13<br>
lib/yaml/baseemitter.rb:122: warning: mismatched indentations at 'end' with 'def' at 113<br>
lib/yaml/yamlnode.rb:19: warning: shadowing outer local variable - v<br>
%</p>
<p>all results attached.<br>
=end</p>
Ruby master - Bug #887 (Closed): thread.c: warning: format '%.6ld' expects type 'long int'
https://bugs.ruby-lang.org/issues/887
2008-12-15T23:28:29Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
Mac OS Xの環境で以下のwarningが出ているので、tv_secだけではなくtv_usecもlongにキャストしてしまえば良いのではないでしょうか。</p>
<p>gcc -DRUBY_DEBUG_ENV -O2 -g -Wall -Wformat=2 -Wundef -Wno-parentheses -pipe -fno-common -I. -I.ext/include/powerpc-darwin9.5.0 -I./include -I. -DRUBY_EXPORT -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -o thread.o -c thread.c<br>
thread.c: In function 'sleep_timeval':<br>
thread.c:809: warning: format '%.6ld' expects type 'long int', but argument 3 has type '__darwin_suseconds_t'<br>
thread.c:809: warning: format '%.6ld' expects type 'long int', but argument 5 has type '__darwin_suseconds_t'<br>
=end</p>
Ruby master - Bug #885 (Closed): Thread.new{fork{}}
https://bugs.ruby-lang.org/issues/885
2008-12-15T21:34:54Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
<a href="https://blade.ruby-lang.org/ruby-core/20537">[ruby-core:20537]</a> をちょっと変えて試してみたら謎の出力がありました。<br>
マシンに負荷がかかってる状態だと出にくいようです。</p>
<p>% ruby-trunk -ve 'Thread.new{fork{}}'<br>
ruby 1.9.1 (2008-12-15 revision 20759) [i686-linux]<br>
-e:1: Fixnum<br>
%<br>
=end</p>
Ruby master - Bug #846 (Closed): thread.c:2981: warning: format not a string literal and no forma...
https://bugs.ruby-lang.org/issues/846
2008-12-10T20:50:32Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
<a href="http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/last" class="external">http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/last</a><br>
gcc -DRUBY_DEBUG_ENV -O2 -g -Wall -Wformat=2 -Wundef -Wno-parentheses -I. -I.ext/include/i686-linux -I./include -I. -DRUBY_EXPORT -o thread.o -c thread.c<br>
thread.c: In function 'rb_mutex_unlock':<br>
thread.c:2981: warning: format not a string literal and no format arguments</p>
<p>という警告が出ています。<br>
mutex_unlockは%を含まない固定の文字列を返しているので、今のところ問題は<br>
なさそうに見えますが、以下のようにした方がよいのではないでしょうか?</p>
<a name="Index-threadc"></a>
<h1 >Index: thread.c<a href="#Index-threadc" class="wiki-anchor">¶</a></h1>
<p>--- thread.c (revision 20609)<br>
+++ thread.c (working copy)<br>
@@ -2978,7 +2978,7 @@ rb_mutex_unlock(VALUE self)<br>
GetMutexPtr(self, mutex);</p>
<pre><code> err = mutex_unlock(mutex);
</code></pre>
<ul>
<li>if (err) rb_raise(rb_eThreadError, err);</li>
</ul>
<ul>
<li>
<p>if (err) rb_raise(rb_eThreadError, "%s", err);</p>
<p>return self;<br>
}<br>
=end</p>
</li>
</ul>
Ruby master - Bug #845 (Closed): warning: "RUBY_VERSION_CODE" is not defined
https://bugs.ruby-lang.org/issues/845
2008-12-10T20:42:12Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
rational.cとcomplex.cでwarningが出ています。</p>
<p><a href="http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/last" class="external">http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/last</a></p>
<p>gcc -DRUBY_DEBUG_ENV -O2 -g -Wall -Wformat=2 -Wundef -Wno-parentheses -I. -I.ext/include/i686-linux -I./include -I. -DRUBY_EXPORT -o rational.o -c rational.c<br>
rational.c:380:5: warning: "RUBY_VERSION_CODE" is not defined<br>
rational.c:1544:5: warning: "NUBY" is not defined</p>
<p>gcc -DRUBY_DEBUG_ENV -O2 -g -Wall -Wformat=2 -Wundef -Wno-parentheses -I. -I.ext/include/i686-linux -I./include -I. -DRUBY_EXPORT -o complex.o -c complex.c<br>
complex.c:323:5: warning: "RUBY_VERSION_CODE" is not defined<br>
complex.c:1430:5: warning: "NUBY" is not defined<br>
=end</p>
Ruby 1.8 - Bug #795 (Rejected): test_gdbm.rb: tmptest_gdbm_,tmptest_gdbm_rdonlyが残っているとErrorになる
https://bugs.ruby-lang.org/issues/795
2008-11-26T00:31:02Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
test/gdbm/test_gdbm.rbが、segumentation faultなどで中断してしまって、<br>
tmptest_gdbm_,tmptest_gdbm_rdonlyが残ってしまうと次にテストを実行した<br>
ときにErrorになります。</p>
<p>test/dbm/test_dbm.rbなども同様の問題があるようです。</p>
<p>それからカレントディレクトリにファイルを作るのもあまり良くないと<br>
思うのですが、どうでしょうか。<br>
=end</p>
Ruby 1.8 - Bug #789 (Closed): RSTRING in ext/gdbm/gdbm.c
https://bugs.ruby-lang.org/issues/789
2008-11-25T16:01:52Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
西山和広です。</p>
<p><a href="/issues/788">[ruby-core:20082]</a>にひっかかったので、とりあえず</p>
<a name="Index-objectc"></a>
<h1 >Index: object.c<a href="#Index-objectc" class="wiki-anchor">¶</a></h1>
<p>--- object.c(revision 20352)<br>
+++ object.c(working copy)<br>
@@ -223,7 +223,7 @@<br>
}<br>
clone = rb_obj_alloc(rb_obj_class(obj));<br>
RBASIC(clone)->klass = rb_singleton_class_clone(obj);</p>
<ul>
<li>RBASIC(clone)->flags = (RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT)) & ~(FL_FREEZE|FL_FINALIZE);</li>
</ul>
<ul>
<li>RBASIC(clone)->flags = (RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT|ELTS_SHARED)) & ~(FL_FREEZE|FL_FINALIZE);<br>
init_copy(clone, obj);<br>
RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;</li>
</ul>
<p>として回避してみたところ、gdbmのテストの中で落ちるようになったので、<br>
調べてみたところ、rb_str_s_allocでELTS_SHAREDが設定されているのに<br>
aux.sharedを無視してaux.capaを設定していて、それを後で<br>
RSTRING(aux.shared)で参照されてしまうのが原因だとわかりました。</p>
<p>以下のようにした方が良いと思ったのですが、どうでしょうか?</p>
<a name="Index-extgdbmgdbmc"></a>
<h1 >Index: ext/gdbm/gdbm.c<a href="#Index-extgdbmgdbmc" class="wiki-anchor">¶</a></h1>
<p>--- ext/gdbm/gdbm.c(revision 20352)<br>
+++ ext/gdbm/gdbm.c(working copy)<br>
@@ -303,12 +303,7 @@<br>
if (val.dptr == 0)<br>
return Qnil;</p>
<ul>
<li>str = rb_obj_alloc(rb_cString);</li>
<li>RSTRING(str)->len = val.dsize;</li>
<li>RSTRING(str)->aux.capa = val.dsize;</li>
<li>RSTRING(str)->ptr = REALLOC_N(val.dptr,char,val.dsize+1);</li>
<li>RSTRING(str)->ptr[val.dsize] = '\0';</li>
<li>
</ul>
<ul>
<li>str = rb_str_new(val.dptr, val.dsize);<br>
OBJ_TAINT(str);<br>
return (VALUE)str;<br>
}<br>
@@ -349,12 +344,7 @@<br>
if (key.dptr == 0)<br>
return Qnil;</li>
</ul>
<ul>
<li>str = rb_obj_alloc(rb_cString);</li>
<li>RSTRING(str)->len = key.dsize;</li>
<li>RSTRING(str)->aux.capa = key.dsize;</li>
<li>RSTRING(str)->ptr = REALLOC_N(key.dptr,char,key.dsize+1);</li>
<li>RSTRING(str)->ptr[RSTRING(str)->len] = '\0';</li>
<li>
</ul>
<ul>
<li>str = rb_str_new(key.dptr, key.dsize);<br>
OBJ_TAINT(str);<br>
return str;<br>
}<br>
@@ -373,12 +363,7 @@<br>
if (key2.dptr == 0)<br>
return Qnil;</li>
</ul>
<ul>
<li>str = rb_obj_alloc(rb_cString);</li>
<li>RSTRING(str)->len = key2.dsize;</li>
<li>RSTRING(str)->aux.capa = key2.dsize;</li>
<li>RSTRING(str)->ptr = REALLOC_N(key2.dptr,char,key2.dsize+1);</li>
<li>RSTRING(str)->ptr[RSTRING(str)->len] = '\0';</li>
<li>
</ul>
<ul>
<li>str = rb_str_new(key2.dptr, key2.dsize);<br>
OBJ_TAINT(str);<br>
return str;<br>
}</li>
</ul>
<p>--<br>
|ZnZ(ゼット エヌ ゼット)<br>
|西山和広(Kazuhiro NISHIYAMA)<br>
=end</p>
Ruby master - Bug #751 (Closed): Regexp.new(dummy_encoding_string)
https://bugs.ruby-lang.org/issues/751
2008-11-13T19:30:28Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
<a href="http://mono.kmc.gr.jp/~yhara/d/?date=20081101#p03" class="external">http://mono.kmc.gr.jp/~yhara/d/?date=20081101#p03</a><br>
のようなことが起きるので、dummy encodingの文字列で<br>
Regexp.newしたときは例外になった方が良いのではないでしょうか?<br>
=end</p>
Ruby master - Bug #688 (Closed): test_exit_action(TestSignal)でTimeout::Error
https://bugs.ruby-lang.org/issues/688
2008-10-28T11:15:29Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
ruby 1.9.0 (2008-10-27 revision 19968) [powerpc-darwin9.5.0]<br>
や<br>
ruby 1.9.0 (2008-10-28 revision 19973) [x86_64-linux]<br>
の環境でTimeout::Errorになります。</p>
<ol start="4">
<li>Failure:<br>
test_exit_action(TestSignal) [.../test/ruby/test_signal.rb:52]:<br>
<a href="https://blade.ruby-lang.org/ruby-dev/26128">[ruby-dev:26128]</a>.<br>
Exception raised:<br>
<#<Timeout::Error: execution expired>>.<br>
=end</li>
</ol>
Ruby master - Bug #672 (Closed): rb_io_flush in pipe_open
https://bugs.ruby-lang.org/issues/672
2008-10-21T18:12:33Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
直後のrb_forkの中で<br>
#define prefork() ( <br>
rb_io_flush(rb_stdout), <br>
rb_io_flush(rb_stderr) <br>
)<br>
prefork();<br>
としているので、pipe_openのrb_io_flushは不要なのではないでしょうか?</p>
<a name="Index-ioc"></a>
<h1 >Index: io.c<a href="#Index-ioc" class="wiki-anchor">¶</a></h1>
<p>--- io.c (revision 19868)<br>
+++ io.c (working copy)<br>
@@ -4445,8 +4445,6 @@ pipe_open(struct rb_exec_arg <em>eargp, VAL<br>
}<br>
else {<br>
fflush(stdin); /</em> is it really needed? */</p>
<ul>
<li>rb_io_flush(rb_stdout);</li>
<li>rb_io_flush(rb_stderr);<br>
pid = rb_fork(&status, 0, 0, Qnil);<br>
if (pid == 0) { /* child */<br>
popen_redirect(&arg);<br>
=end</li>
</ul>
Ruby master - Bug #671 (Closed): TestSignal#test_exit_actionでEINTRのメッセージが出る
https://bugs.ruby-lang.org/issues/671
2008-10-21T16:08:41Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
TestSignal#test_exit_actionの子プロセス側で<br>
Thread.start { Thread.pass }<br>
のスレッドが何らかの理由で終了してしまうとselectシステムコールで待たずに<br>
readシステムコールで待つようになってしまって、以下のようになります。</p>
<p>Thread.start { Thread.pass }<br>
の後にsleep 0.01などを入れると確実に再現します。</p>
<p>% ruby-trunk test_signal.rb -v -n test_exit_action<br>
Loaded suite .../trunk/test/ruby/test_signal<br>
Started<br>
TestSignal#test_exit_action: .../trunk/test/ruby/test_signal.rb:46:in <code>sysread': Interrupted system call (Errno::EINTR) from .../trunk/test/ruby/test_signal.rb:46:in </code>block in test_exit_action'<br>
from .../trunk/test/ruby/test_signal.rb:40:in <code>fork' from .../trunk/test/ruby/test_signal.rb:40:in </code>test_exit_action'<br>
from .../lib/ruby/1.9.0/minitest/unit.rb:431:in <code>run' from .../lib/ruby/1.9.0/minitest/unit.rb:410:in </code>block (2 levels) in run_test_suites'<br>
from .../lib/ruby/1.9.0/minitest/unit.rb:404:in <code>each' from .../lib/ruby/1.9.0/minitest/unit.rb:404:in </code>block in run_test_suites'<br>
from .../lib/ruby/1.9.0/minitest/unit.rb:403:in <code>each' from .../lib/ruby/1.9.0/minitest/unit.rb:403:in </code>run_test_suites'<br>
from .../lib/ruby/1.9.0/minitest/unit.rb:383:in <code>run' from .../lib/ruby/1.9.0/minitest/unit.rb:327:in </code>block in autorun'<br>
0.12 s: .</p>
<p>Finished in 0.119494 seconds.</p>
<p>1 tests, 0 assertions, 0 failures, 0 errors, 0 skips<br>
%</p>
<p>以下のようにすれば確実にスレッドが残るようになると思うのですが、<br>
どうでしょうか?</p>
<a name="Index-testrubytest_signalrb"></a>
<h1 >Index: test/ruby/test_signal.rb<a href="#Index-testrubytest_signalrb" class="wiki-anchor">¶</a></h1>
<p>--- test/ruby/test_signal.rb (revision 19868)<br>
+++ test/ruby/test_signal.rb (working copy)<br>
@@ -41,7 +41,7 @@ class TestSignal < Test::Unit::TestCase<br>
Signal.trap(:USR1, "EXIT")<br>
w0.close<br>
w.syswrite("a")</p>
<ul>
<li>
<pre><code> Thread.start { Thread.pass }
</code></pre>
</li>
</ul>
<ul>
<li>
<pre><code> Thread.start { sleep(2) }
r0.sysread(4096)
}
r.sysread(1)
</code></pre>
</li>
</ul>
<p>=end</p>
Ruby master - Bug #626 (Closed): stop test-all at test/rdoc/test_rdoc_ri_driver.rb
https://bugs.ruby-lang.org/issues/626
2008-10-10T03:54:22Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
When readline is not installed, `make test-all' stopped at test/rdoc/test_rdoc_ri_driver.rb.</p>
<p>/home/kazu/wc/ruby-lang/trunk/lib/rdoc/ri/display.rb:6:in <code>require': no such file to load -- readline (LoadError) from /home/kazu/wc/ruby-lang/trunk/lib/rdoc/ri/display.rb:6:in </code><top (required)>'<br>
from /home/kazu/wc/ruby-lang/trunk/lib/rdoc/ri/driver.rb:7:in <code>require' from /home/kazu/wc/ruby-lang/trunk/lib/rdoc/ri/driver.rb:7:in </code><top (required)>'<br>
from /home/kazu/wc/ruby-lang/trunk/test/rdoc/test_rdoc_ri_driver.rb:3:in <code>require' from /home/kazu/wc/ruby-lang/trunk/test/rdoc/test_rdoc_ri_driver.rb:3:in </code><top (required)>'<br>
from /home/kazu/wc/ruby-lang/trunk/test/runner.rb:50:in <code>require' from /home/kazu/wc/ruby-lang/trunk/test/runner.rb:50:in </code>block in '<br>
from /home/kazu/wc/ruby-lang/trunk/test/runner.rb:49:in <code>each' from /home/kazu/wc/ruby-lang/trunk/test/runner.rb:49:in </code>'</p>
<p>Finished in 95.288762 seconds.</p>
<ol>
<li>Failure:<br>
test_handle_special_CROSSREF_no_underscore(TestRDocMarkupToHtmlCrossref) [/home/kazu/wc/ruby-lang/trunk/test/rdoc/test_rdoc_markup_to_html_crossref.rb:83]:<br>
Expected "<p> <a href="../files/home/kazu/wc/ruby-lang/trunk/test/rdoc/rdoc_markup_to_html_crossref_reference_rb.html">/home/kazu/wc/ruby-lang/trunk/test/rdoc/rdoc_markup_to_html_crossref_reference.rb </p> ", not "<p> /home/kazu/wc/ruby-lang/trunk/test/rdoc/rdoc_markup_to_html_crossref_reference.rb </p> ".</li>
</ol>
<p>460 tests, 5618 assertions, 1 failures, 0 errors, 0 skips<br>
make: *** [test-all] エラー 1<br>
=end</p>
Ruby 1.8 - Bug #613 (Closed): segmentetion fault by Marshal.dump
https://bugs.ruby-lang.org/issues/613
2008-10-01T16:13:12Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
西山和広です。</p>
<p>Marshal.dumpに第2引数のIOを指定すると落ちます。</p>
<p>% ruby18 -ve 'Marshal.dump(nil, open("/dev/null", "wb"))'<br>
ruby 1.8.7 (2008-09-27 revision 19596) [i686-linux]<br>
-e:1: [BUG] Segmentation fault<br>
ruby 1.8.7 (2008-09-27 revision 19596) [i686-linux]<br>
%</p>
<p>check_dump_argのarg->wrapperがNULLの時に落ちるようで、<br>
以下のように初期化すると確実に再現できます。</p>
<a name="Index-marshalc"></a>
<h1 >Index: marshal.c<a href="#Index-marshalc" class="wiki-anchor">¶</a></h1>
<p>--- marshal.c(リビジョン 19651)<br>
+++ marshal.c(作業コピー)<br>
@@ -761,7 +761,7 @@<br>
{<br>
VALUE obj, port, a1, a2;<br>
int limit = -1;</p>
<ul>
<li>struct dump_arg arg;</li>
</ul>
<ul>
<li>
<p>struct dump_arg arg = {0};<br>
struct dump_call_arg c_arg;</p>
<p>port = Qnil;</p>
</li>
</ul>
<p>--<br>
|ZnZ(ゼット エヌ ゼット)<br>
|西山和広(Kazuhiro NISHIYAMA)<br>
=end</p>
Ruby master - Bug #568 (Closed): test_dup(TestIO) may cause infinite loop
https://bugs.ruby-lang.org/issues/568
2008-09-16T20:21:42Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
西山和広です。</p>
<p>test_dup(TestIO)で無限ループになってしまうことがあるようです。</p>
<p>straceしてみたところ、1つ目のdupで例外にならなかった場合、<br>
出来たIOが2つ目のdupの中でGCされて、2つ目のdupで出来たIOが<br>
1つ目のdupでGCされて、というはまり方に見えます。</p>
<a name="Index-testrubytest_iorb"></a>
<h1 >Index: test/ruby/test_io.rb<a href="#Index-testrubytest_iorb" class="wiki-anchor">¶</a></h1>
<p>--- test/ruby/test_io.rb (revision 19381)<br>
+++ test/ruby/test_io.rb (working copy)<br>
@@ -633,7 +633,7 @@<br>
loop {a << IO.pipe}<br>
end<br>
assert_raise(Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM) do</p>
<ul>
<li>
<pre><code> loop {a[-1][0].dup; a[-1][1].dup}
</code></pre>
</li>
</ul>
<ul>
<li>
<pre><code> loop {a << [a[-1][0].dup, a[-1][1].dup]}
</code></pre>
end<br>
a.each do |r, w|<br>
r.close unless !r || r.closed?</li>
</ul>
<p>--<br>
|ZnZ(ゼット エヌ ゼット)<br>
|西山和広(Kazuhiro NISHIYAMA)<br>
=end</p>
Ruby master - Bug #500 (Closed): TZ=HSTでFailure: test_strftime(TestTime)
https://bugs.ruby-lang.org/issues/500
2008-08-27T01:28:09Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
<a href="http://zunda.freeshell.org/d/20080825.html#p04" class="external">http://zunda.freeshell.org/d/20080825.html#p04</a><br>
によるとローカルのタイムゾーンによっては失敗することがあるようです。</p>
<p>% env TZ=HST ruby-trunk -v test/ruby/test_time.rb -n /strftime/<br>
ruby 1.9.0 (2008-08-25 revision 18832) [i686-linux]<br>
Loaded suite test/ruby/test_time<br>
Started<br>
test/ruby/test_time.rb:377: warning: strftime called with empty format string<br>
F<br>
Finished in 0.01258855 seconds.</p>
<ol>
<li>Failure:<br>
test_strftime(TestTime) [test/ruby/test_time.rb:381]:<br>
<"Sat"> expected but was<br>
<"Fri">.</li>
</ol>
<p>1 tests, 26 assertions, 1 failures, 0 errors<br>
=end</p>
Ruby master - Bug #466 (Closed): test_str_crypt(TestM17NComb) failed
https://bugs.ruby-lang.org/issues/466
2008-08-21T20:19:22Z
znz (Kazuhiro NISHIYAMA)
<pre><code>$ ruby-trunk -v
ruby 1.9.0 (2008-08-21 revision 18753) [powerpc-darwin9.4.0]
</code></pre>
<p>の環境でtest_str_crypt(TestM17NComb)がFailureになります。</p>
<pre><code>$ ruby-trunk test/ruby/test_m17n_comb.rb -v -n /crypt/
Loaded suite test/ruby/test_m17n_comb
Started
test_str_crypt(TestM17NComb): F
Finished in 0.03673 seconds.
1) Failure:
test_str_crypt(TestM17NComb)
[test/ruby/test_m17n_comb.rb:800:in `block in test_str_crypt'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:83:in `block in each'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:75:in `block in each_index'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:46:in `block in make_large_block'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:26:in `block (2 levels) in make_basic_block'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:21:in `times'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:21:in `block in make_basic_block'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:20:in `times'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:20:in `make_basic_block'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:45:in `make_large_block'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:71:in `each_index'
/Users/nishiyamakazuhiro/wc/ruby-lang/trunk/test/ruby/allpairs.rb:82:in `each'
test/ruby/test_m17n_comb.rb:118:in `combination'
test/ruby/test_m17n_comb.rb:794:in `test_str_crypt']:
"".force_encoding("ASCII-8BIT").crypt("\xE0\xA0\xA1".force_encoding("UTF-8")).
<"\xE0\xA0fT7zdRv9Y7A"> expected but was
<"\xE0\xA0swiH3o6yAu2">.
1 tests, 55 assertions, 1 failures, 0 errors
$
</code></pre>
<pre><code>$ ruby-trunk -ve '3.times{p "".crypt("\xE0\xA0")}' ruby 1.9.0 (2008-08-21 revision 18753) [powerpc-darwin9.4.0]
"\xE0\xA0X8NBuQ4l6uQ"
"\xE0\xA0fT7zdRv9Y7A"
"\xE0\xA0fT7zdRv9Y7A"
$
</code></pre>
<p>のように2回目以降で結果が違うのが原因のようです。</p>
<p>直接crypt(2)を同じ引数で呼んでも同じ結果になります。</p>
<pre><code>$ cat a.c
</code></pre>
<pre><code class="c syntaxhl" data-language="c"><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp">
#include</span> <span class="cpf"><unistd.h></span><span class="cp">
</span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
<span class="p">{</span>
<span class="n">printf</span><span class="p">(</span><span class="s">"%s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">crypt</span><span class="p">(</span><span class="s">""</span><span class="p">,</span> <span class="s">"</span><span class="se">\xE0\xA0</span><span class="s">"</span><span class="p">));</span>
<span class="n">printf</span><span class="p">(</span><span class="s">"%s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">crypt</span><span class="p">(</span><span class="s">""</span><span class="p">,</span> <span class="s">"</span><span class="se">\xE0\xA0</span><span class="s">"</span><span class="p">));</span>
<span class="n">printf</span><span class="p">(</span><span class="s">"%s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">crypt</span><span class="p">(</span><span class="s">""</span><span class="p">,</span> <span class="s">"</span><span class="se">\xE0\xA0</span><span class="s">"</span><span class="p">));</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</code></pre>
<pre><code>$ gcc a.c
$ ./a.out |LANG=C cat -v
M-`M- X8NBuQ4l6uQ
M-`M- fT7zdRv9Y7A
M-`M- fT7zdRv9Y7A
</code></pre>
Ruby 1.8 - Bug #367 (Closed): ruby_1_8のrssで3E
https://bugs.ruby-lang.org/issues/367
2008-07-27T22:27:25Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
環境によってはrssでErrorが出ます。</p>
<ol>
<li>
<p>Error:<br>
test_atom_content(RSS::TestAtomCore):<br>
LoadError: no such file to load -- zlib<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/test_atom.rb:644:in <code>require' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/test_atom.rb:644:in </code>assert_atom_content_inline_other_base64_to_s'<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/test_atom.rb:643:in <code>assert_atom_content_inline_other_base64_to_s' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/test_atom.rb:604:in </code>assert_atom_content_to_s'<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/test_atom.rb:600:in <code>assert_atom_content_to_s' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/test_atom.rb:205:in </code>test_atom_content'</p>
</li>
<li>
<p>Error:<br>
test_entry_content_text(RSS::TestParserAtom):<br>
LoadError: no such file to load -- zlib<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:560:in <code>require' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:560:in </code>assert_atom_content_inline_other_text'<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:559:in <code>assert_atom_content_inline_other_text' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:553:in </code>assert_atom_content_inline_other'<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:552:in <code>assert_atom_content_inline_other' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:459:in </code>assert_atom_content'<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:456:in <code>assert_atom_content' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/test_parser_atom_entry.rb:100:in </code>test_entry_content_text'</p>
</li>
<li>
<p>Error:<br>
test_entry_content(RSS::TestParserAtomFeed):<br>
LoadError: no such file to load -- zlib<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:560:in <code>require' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:560:in </code>assert_atom_content_inline_other_text'<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:559:in <code>assert_atom_content_inline_other_text' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:553:in </code>assert_atom_content_inline_other'<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:552:in <code>assert_atom_content_inline_other' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:459:in </code>assert_atom_content'<br>
/home/kazu/wc/ruby-lang/ruby_1_8/test/rss/rss-assertions.rb:456:in <code>assert_atom_content' /home/kazu/wc/ruby-lang/ruby_1_8/test/rss/test_parser_atom_feed.rb:147:in </code>test_entry_content'</p>
</li>
</ol>
<p>1847 tests, 1343396 assertions, 0 failures, 3 errors<br>
=end</p>
Ruby master - Bug #356 (Closed): test_flush(TestIONonblock): Errno::EBADF: Bad file descriptor
https://bugs.ruby-lang.org/issues/356
2008-07-23T20:14:06Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
Ubuntu 8.04.1の環境でtest_flush(TestIONonblock)がErrno::EBADFになります。<br>
Debianなどの他の環境では(試した範囲内では)再現しませんでした。</p>
<p>% ruby-trunk -v test/io/nonblock/test_flush.rb<br>
ruby 1.9.0 (2008-07-23 revision 18181) [i686-linux]<br>
Loaded suite test/io/nonblock/test_flush<br>
Started<br>
E<br>
Finished in 0.001041173 seconds.</p>
<ol>
<li>Error:<br>
test_flush(TestIONonblock):<br>
Errno::EBADF: Bad file descriptor<br>
test/io/nonblock/test_flush.rb:27:in <code>flush' test/io/nonblock/test_flush.rb:27:in </code>block in test_flush'<br>
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/timeout.rb:52:in <code>timeout' /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/timeout.rb:82:in </code>timeout'<br>
test/io/nonblock/test_flush.rb:17:in `test_flush'</li>
</ol>
<p>1 tests, 0 assertions, 0 failures, 1 errors<br>
% lsb_release -a<br>
No LSB modules are available.<br>
Distributor ID: Ubuntu<br>
Description: Ubuntu 8.04.1<br>
Release: 8.04<br>
Codename: hardy<br>
%<br>
=end</p>
Ruby master - Bug #272 (Closed): test_chdir failed when Dir.tmpdir is symlink
https://bugs.ruby-lang.org/issues/272
2008-07-14T17:59:07Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
Dir.tmpdirが返すディレクトリがsymlinkのときにtest_chdirが失敗します。</p>
<p>% ln -s /tmp $HOME/symlink-tmpdir<br>
% env TMPDIR=$HOME/symlink-tmpdir ruby-trunk -v test/ruby/test_dir.rb<br>
ruby 1.9.0 (2008-07-14 revision 18060) [i686-linux]<br>
Loaded suite test/ruby/test_dir<br>
Started<br>
.test/ruby/test_dir.rb:111: warning: conflicting chdir during another chdir block<br>
F..........<br>
Finished in 0.0631458779999999 seconds.</p>
<ol>
<li>Failure:<br>
test_chdir(TestDir)<br>
[test/ruby/test_dir.rb:112:in <code>block in test_chdir' test/ruby/test_dir.rb:109:in </code>chdir'<br>
test/ruby/test_dir.rb:109:in `test_chdir']:<br>
<"/home/kazu/symlink-tmpdir/__test_dir__20080714-13467-1l19gzu"> expected but was<br>
<"/tmp/__test_dir__20080714-13467-1l19gzu">.</li>
</ol>
<p>12 tests, 78 assertions, 1 failures, 0 errors<br>
=end</p>
Ruby 1.8 - Bug #194 (Closed): test_circular_references(YAML_Unit_Tests)
https://bugs.ruby-lang.org/issues/194
2008-06-19T20:03:29Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
西山和広です。</p>
<p>1.8.5と1.8.6のmake test-allがDebian etchの環境で<br>
test_circular_references(YAML_Unit_Tests)<br>
で[BUG] Segmentation faultになります。</p>
<p>別の環境(Ubuntu hardy)だと<br>
SystemStackError: stack level too deep<br>
になっていました。</p>
<p>--<br>
|ZnZ(ゼット エヌ ゼット)<br>
|西山和広(Kazuhiro NISHIYAMA)<br>
=end</p>
Ruby master - Feature #108 (Closed): strftimeのusec対応
https://bugs.ruby-lang.org/issues/108
2008-06-07T00:31:23Z
znz (Kazuhiro NISHIYAMA)
<p>=begin<br>
Timeオブジェクトはusecを持っていますが、今のstrftimeの書式指定文字列ではusecやミリ秒が取り出せません。<br>
=end</p>