Project

General

Profile

Bug #11219

bootstrap test failed on sparc Solaris since r50743

Added by ngoto (Naohisa Goto) about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-dev:49023]

Description

r50743以降、sparc Solaris 10 にて bootstrap test が失敗します。
(64ビット、32ビット共)

test_syntax.rb           ..............................Fstderr output is not empty
   bootstraptest.tmp.rb:4: [BUG] unreachable
   ruby 2.3.0dev (2015-06-03) [sparc64-solaris2.10]

   -- Control frame information -----------------------------------------------
   c:0003 p:0022 s:0010 e:000007 METHOD bootstraptest.tmp.rb:4
   c:0002 p:0026 s:0005 E:000b20 EVAL   bootstraptest.tmp.rb:17 [FINISH]
   c:0001 p:0000 s:0002 E:001020 (none) [FINISH]

   -- Ruby level backtrace information ----------------------------------------
   bootstraptest.tmp.rb:17:in `<main>'
   bootstraptest.tmp.rb:4:in `test'

   -- Other runtime information -----------------------------------------------

   * Loaded script: bootstraptest.tmp.rb

   * Loaded features:

       0 enumerator.so
       1 rational.so
       2 complex.so
       3 /XXXXX-50743/.ext/sparc64-solaris2.10/enc/encdb.so
       4 /XXXXX-50743/.ext/sparc64-solaris2.10/enc/trans/transdb.so
       5 /XXXXX-50743/lib/unicode_normalize.rb

   [NOTE]
   You may have encountered a bug in the Ruby interpreter or extension libraries.
   Bug reports are welcome.
   For details: http://www.ruby-lang.org/bugreport.html
.............................................................................................................................


test_thread.rb           ..................................................


#142 test_eval.rb:212:in `<top (required)>': 
     class Module
       def my_module_eval(&block)
         module_eval(&block)
       end
     end
     class String
       Integer.my_module_eval do
         def hoge; end
       end
     end
     if Integer.instance_methods(false).map{|m|m.to_sym}.include?(:hoge) &&
        !String.instance_methods(false).map{|m|m.to_sym}.include?(:hoge)
       :ok
     else
       :ng
     end
  #=> "ng" (expected "ok")  [ruby-dev:34236]
#837 test_syntax.rb:233:in `<top (required)>': 
     class C
       def test
         [defined?(m1()), defined?(self.m1), defined?(C.new.m1),
          defined?(m2()), defined?(self.m2), defined?(C.new.m2),
          defined?(m3()), defined?(self.m3), defined?(C.new.m3)]
       end
       def m1
       end
       private
       def m2
       end
       protected
       def m3
       end
     end
     C.new.test + [defined?(C.new.m3)]
  #=> "" (expected "[\"method\", \"method\", \"method\", \"method\", nil, nil, \"method\", \"method\", \"method\", nil]")  
FAIL 2/1012 tests failed
make: *** [yes-btest-ruby] Error 1

r50743 は rb_method_definition_t のビットフィールド分割などの変更ですので、
おそらく、big endian と little endian の違いにより顕在化した問題で、
何かの値をVALUEなどと暗黙のうちに兼用している部分があるのだと思いますが、
探しだせませんでした。


Related issues

Related to Ruby master - Bug #10037: Since r46798 on Solaris, "[BUG] rb_vm_get_cref: unreachable" during makeClosedko1 (Koichi Sasada)Actions
#1

Updated by ngoto (Naohisa Goto) about 5 years ago

  • Related to Bug #10037: Since r46798 on Solaris, "[BUG] rb_vm_get_cref: unreachable" during make added

Updated by ko1 (Koichi Sasada) about 5 years ago

報告ありがとう御座います。

r50773 で、もうちょっと詳しいメッセージを出すようにしてみました。
どうなるか、試して頂けないでしょうか。

Updated by ngoto (Naohisa Goto) about 5 years ago

def->flags.visi = 0 ということになります。

test_syntax.rb           ..............................Fstderr output is not empty
   bootstraptest.tmp.rb:4: [BUG] vm_defined: unreachable: 0
   ruby 2.3.0dev (2015-06-05) [sparc64-solaris2.10]

   -- Control frame information -----------------------------------------------
   c:0003 p:0022 s:0010 e:000007 METHOD bootstraptest.tmp.rb:4
   c:0002 p:0026 s:0005 E:000780 EVAL   bootstraptest.tmp.rb:17 [FINISH]
   c:0001 p:0000 s:0002 E:000ce0 (none) [FINISH]

   -- Ruby level backtrace information ----------------------------------------
   bootstraptest.tmp.rb:17:in `<main>'
   bootstraptest.tmp.rb:4:in `test'

   -- Other runtime information -----------------------------------------------

   * Loaded script: bootstraptest.tmp.rb

   * Loaded features:

       0 enumerator.so
       1 rational.so
       2 complex.so
       3 /XXXXX-50774/.ext/sparc64-solaris2.10/enc/encdb.so
       4 /XXXXX-50774/.ext/sparc64-solaris2.10/enc/trans/transdb.so
       5 /XXXXX-50774/lib/unicode_normalize.rb

   [NOTE]
   You may have encountered a bug in the Ruby interpreter or extension libraries.
   Bug reports are welcome.
   For details: http://www.ruby-lang.org/bugreport.html
.............................................................................................................................
test_thread.rb           ..................................................
#142 test_eval.rb:212:in `<top (required)>': 
     class Module
       def my_module_eval(&block)
         module_eval(&block)
       end
     end
     class String
       Integer.my_module_eval do
         def hoge; end
       end
     end
     if Integer.instance_methods(false).map{|m|m.to_sym}.include?(:hoge) &&
        !String.instance_methods(false).map{|m|m.to_sym}.include?(:hoge)
       :ok
     else
       :ng
     end
  #=> "ng" (expected "ok")  [ruby-dev:34236]
#837 test_syntax.rb:233:in `<top (required)>': 
     class C
       def test
         [defined?(m1()), defined?(self.m1), defined?(C.new.m1),
          defined?(m2()), defined?(self.m2), defined?(C.new.m2),
          defined?(m3()), defined?(self.m3), defined?(C.new.m3)]
       end
       def m1
       end
       private
       def m2
       end
       protected
       def m3
       end
     end
     C.new.test + [defined?(C.new.m3)]
  #=> "" (expected "[\"method\", \"method\", \"method\", \"method\", nil, nil, \"method\", \"method\", \"method\", nil]")  
FAIL 2/1012 tests failed
make: *** [yes-btest-ruby] Error 1

Updated by ngoto (Naohisa Goto) about 5 years ago

r50743 の変更を見ていると、
eval_intern.h 内で rb_cref_t を無理やり構造体 rb_scope_visibility_t にキャストしてから操作していますが、
これと、従来からある cref->flags へのビット操作関数 CREF_PUSHED_BY_EVAL_SET その他の操作が、
少なくともビッグエンディアン環境では、対象のビットが被るかもしれませんし、
それ以外の環境でも、キャストによる代入によって元のビットを上書きする可能性があると思います。

rb_cref_t の先頭要素 VALUE flags をフラグとしてのみ使用するなら、これを直接ビットフィールド化して、無理なキャストをしないほうが、トラブルが無いと思いました。

#5

Updated by ko1 (Koichi Sasada) about 5 years ago

  • Status changed from Open to Closed

Applied in changeset r50782.


  • internal.h: move definition of rb_cref_t to method.h.
  • eval_intern.h: move definition of rb_scope_visibility_t to method.h.
  • method.h: change rb_cref_t::scope_visi from VALUE to rb_scope_visibility_t. [Bug #11219]
  • vm.c (vm_cref_new): accept rb_method_visibility_t directly.
  • vm_insnhelper.c (rb_vm_rewrite_cref): don't use 0, but METHOD_VISI_UNDEF.
  • vm_method.c (rb_scope_visibility_set): don't need to use cast.
  • vm_method.c (rb_scope_module_func_set): ditto.

Updated by ko1 (Koichi Sasada) about 5 years ago

  • Status changed from Closed to Feedback

ありがとうございます。
cast をしないようにしてみました。

ちょっと試してみて貰えないでしょうか。

Updated by ngoto (Naohisa Goto) about 5 years ago

r50782 にて bootstrap test は PASS all 1012 tests になりました。

かわりに、 make test-all 中に
test/socket/test_nonblock.rb:266: [BUG] Segmentation fault at 0x00000000000008
が出ていますが、これは同時期の別の変更のせいの気がします。

Updated by ko1 (Koichi Sasada) about 5 years ago

  • Status changed from Feedback to Closed

Updated by usa (Usaku NAKAMURA) about 5 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED

Also available in: Atom PDF