ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:48629] [ruby-trunk - Bug #10384] [Open] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
       [not found] <redmine.issue-10384.20141014131455@ruby-lang.org>
@ 2014-10-14 13:14 ` ngotogenome
  2015-01-05  3:38 ` [ruby-dev:48800] [ruby-trunk - Bug #10384] " shibata.hiroshi
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: ngotogenome @ 2014-10-14 13:14 UTC (permalink / raw
  To: ruby-dev

Issue #10384 has been reported by Naohisa Goto.

----------------------------------------
Bug #10384: Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
https://bugs.ruby-lang.org/issues/10384

* Author: Naohisa Goto
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-10-14) [sparc64-solaris2.10]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Solarisにて、make test-all中に以下のエラーが発生することが多くなっています。
(出ないこともたまにあります。)

~~~
  2) Error:
DL::TestHandle#test_static_sym:
DL::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/dl/test_handle.rb:34:in `sym'
    /XXXXX/test/dl/test_handle.rb:34:in `rescue in test_static_sym'
    /XXXXX/test/dl/test_handle.rb:27:in `test_static_sym'

  4) Error:
Fiddle::TestHandle#test_NEXT:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:171:in `[]'
    /XXXXX/test/fiddle/test_handle.rb:171:in `rescue in test_NEXT'
    /XXXXX/test/fiddle/test_handle.rb:144:in `test_NEXT'

  5) Error:
Fiddle::TestHandle#test_static_sym:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:41:in `sym'
    /XXXXX/test/fiddle/test_handle.rb:41:in `rescue in test_static_sym'
    /XXXXX/test/fiddle/test_handle.rb:34:in `test_static_sym'
~~~

Fiddle::Handle.sym および Fiddle::Handle.[] (DL::Handle.sym なども同様)は内部で RTLD_NEXT を使用しています。
Solarisのman dlsym(3C) より引用します。

http://docs.oracle.com/cd/E23823_01/html/816-5168/dlsym-3c.html

~~~
     RTLD_NEXT       Instructs dlsym() to search  for  the  named
                     symbol  in the objects that were loaded fol-
                     lowing the object  from  which  the  dlsym()
                     call is being made.
~~~

Solarisのdlsymでは、handleに RTLD_NEXT を指定した場合は、そのコードが読み込まれた後に読み込んだシンボルしか検索しません。
このため、require "objspace" による objspace.so の読み込みが require "fiddle" より前に発生していた場合はエラーになります。

(requireの順番によりエラーが出る・出ないの再現コード)

~~~
 % ruby -e 'require "objspace"; require "fiddle"; p Fiddle::Handle.sym("Init_objspace")'
-e:1:in `sym': unknown symbol "Init_objspace" (Fiddle::DLError)
        from -e:1:in `<main>'
 % ruby -e 'require "fiddle"; require "objspace"; p Fiddle::Handle.sym("Init_objspace")'
9223372034655938496
~~~

単純にgrepすると、require "objspace" は以下で行われています。

 test/dl/test_handle.rb:        require 'objspace'
 test/fiddle/test_closure.rb:      require 'objspace'
 test/fiddle/test_handle.rb:        require 'objspace'
 test/lib/profile_test_all.rb:require 'objspace'
 test/objspace/test_objspace.rb:require "objspace"
 test/ruby/test_file_exhaustive.rb:    require "objspace"

これらのテストの実行順番に依存して(ファイルシステムのディレクトリエントリの順番の偶然などのタイミングによって?)、エラーが出たり出なかったりするようです。




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-dev:48800] [ruby-trunk - Bug #10384] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
       [not found] <redmine.issue-10384.20141014131455@ruby-lang.org>
  2014-10-14 13:14 ` [ruby-dev:48629] [ruby-trunk - Bug #10384] [Open] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris ngotogenome
@ 2015-01-05  3:38 ` shibata.hiroshi
  2015-01-05 15:16 ` [ruby-dev:48802] [ruby-trunk - Bug #10384] [Closed] " nobu
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: shibata.hiroshi @ 2015-01-05  3:38 UTC (permalink / raw
  To: ruby-dev

Issue #10384 has been updated by Hiroshi SHIBATA.

Related to Bug #9928: Fiddle::TestHandle#test_NEXT fails on AIX due to unexported symbols of extension libraries added

----------------------------------------
Bug #10384: Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
https://bugs.ruby-lang.org/issues/10384#change-50794

* Author: Naohisa Goto
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-10-14) [sparc64-solaris2.10]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Solarisにて、make test-all中に以下のエラーが発生することが多くなっています。
(出ないこともたまにあります。)

~~~
  2) Error:
DL::TestHandle#test_static_sym:
DL::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/dl/test_handle.rb:34:in `sym'
    /XXXXX/test/dl/test_handle.rb:34:in `rescue in test_static_sym'
    /XXXXX/test/dl/test_handle.rb:27:in `test_static_sym'

  4) Error:
Fiddle::TestHandle#test_NEXT:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:171:in `[]'
    /XXXXX/test/fiddle/test_handle.rb:171:in `rescue in test_NEXT'
    /XXXXX/test/fiddle/test_handle.rb:144:in `test_NEXT'

  5) Error:
Fiddle::TestHandle#test_static_sym:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:41:in `sym'
    /XXXXX/test/fiddle/test_handle.rb:41:in `rescue in test_static_sym'
    /XXXXX/test/fiddle/test_handle.rb:34:in `test_static_sym'
~~~

Fiddle::Handle.sym および Fiddle::Handle.[] (DL::Handle.sym なども同様)は内部で RTLD_NEXT を使用しています。
Solarisのman dlsym(3C) より引用します。

http://docs.oracle.com/cd/E23823_01/html/816-5168/dlsym-3c.html

~~~
     RTLD_NEXT       Instructs dlsym() to search  for  the  named
                     symbol  in the objects that were loaded fol-
                     lowing the object  from  which  the  dlsym()
                     call is being made.
~~~

Solarisのdlsymでは、handleに RTLD_NEXT を指定した場合は、そのコードが読み込まれた後に読み込んだシンボルしか検索しません。
このため、require "objspace" による objspace.so の読み込みが require "fiddle" より前に発生していた場合はエラーになります。

(requireの順番によりエラーが出る・出ないの再現コード)

~~~
 % ruby -e 'require "objspace"; require "fiddle"; p Fiddle::Handle.sym("Init_objspace")'
-e:1:in `sym': unknown symbol "Init_objspace" (Fiddle::DLError)
        from -e:1:in `<main>'
 % ruby -e 'require "fiddle"; require "objspace"; p Fiddle::Handle.sym("Init_objspace")'
9223372034655938496
~~~

単純にgrepすると、require "objspace" は以下で行われています。

 test/dl/test_handle.rb:        require 'objspace'
 test/fiddle/test_closure.rb:      require 'objspace'
 test/fiddle/test_handle.rb:        require 'objspace'
 test/lib/profile_test_all.rb:require 'objspace'
 test/objspace/test_objspace.rb:require "objspace"
 test/ruby/test_file_exhaustive.rb:    require "objspace"

これらのテストの実行順番に依存して(ファイルシステムのディレクトリエントリの順番の偶然などのタイミングによって?)、エラーが出たり出なかったりするようです。




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-dev:48802] [ruby-trunk - Bug #10384] [Closed] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
       [not found] <redmine.issue-10384.20141014131455@ruby-lang.org>
  2014-10-14 13:14 ` [ruby-dev:48629] [ruby-trunk - Bug #10384] [Open] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris ngotogenome
  2015-01-05  3:38 ` [ruby-dev:48800] [ruby-trunk - Bug #10384] " shibata.hiroshi
@ 2015-01-05 15:16 ` nobu
  2015-03-30 15:33 ` [ruby-dev:48914] [Ruby trunk - Bug #10384] " nagachika00
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: nobu @ 2015-01-05 15:16 UTC (permalink / raw
  To: ruby-dev

Issue #10384 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r49157.

----------
test_handle.rb: use -test-/dln/empty

* test/fiddle/test_handle.rb (test_NEXT): use -test-/dln/empty
  which is always a shared object and is not used by others.
  [ruby-dev:48629] [Bug #10384]

----------------------------------------
Bug #10384: Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
https://bugs.ruby-lang.org/issues/10384#change-50802

* Author: Naohisa Goto
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-10-14) [sparc64-solaris2.10]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Solarisにて、make test-all中に以下のエラーが発生することが多くなっています。
(出ないこともたまにあります。)

~~~
  2) Error:
DL::TestHandle#test_static_sym:
DL::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/dl/test_handle.rb:34:in `sym'
    /XXXXX/test/dl/test_handle.rb:34:in `rescue in test_static_sym'
    /XXXXX/test/dl/test_handle.rb:27:in `test_static_sym'

  4) Error:
Fiddle::TestHandle#test_NEXT:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:171:in `[]'
    /XXXXX/test/fiddle/test_handle.rb:171:in `rescue in test_NEXT'
    /XXXXX/test/fiddle/test_handle.rb:144:in `test_NEXT'

  5) Error:
Fiddle::TestHandle#test_static_sym:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:41:in `sym'
    /XXXXX/test/fiddle/test_handle.rb:41:in `rescue in test_static_sym'
    /XXXXX/test/fiddle/test_handle.rb:34:in `test_static_sym'
~~~

Fiddle::Handle.sym および Fiddle::Handle.[] (DL::Handle.sym なども同様)は内部で RTLD_NEXT を使用しています。
Solarisのman dlsym(3C) より引用します。

http://docs.oracle.com/cd/E23823_01/html/816-5168/dlsym-3c.html

~~~
     RTLD_NEXT       Instructs dlsym() to search  for  the  named
                     symbol  in the objects that were loaded fol-
                     lowing the object  from  which  the  dlsym()
                     call is being made.
~~~

Solarisのdlsymでは、handleに RTLD_NEXT を指定した場合は、そのコードが読み込まれた後に読み込んだシンボルしか検索しません。
このため、require "objspace" による objspace.so の読み込みが require "fiddle" より前に発生していた場合はエラーになります。

(requireの順番によりエラーが出る・出ないの再現コード)

~~~
 % ruby -e 'require "objspace"; require "fiddle"; p Fiddle::Handle.sym("Init_objspace")'
-e:1:in `sym': unknown symbol "Init_objspace" (Fiddle::DLError)
        from -e:1:in `<main>'
 % ruby -e 'require "fiddle"; require "objspace"; p Fiddle::Handle.sym("Init_objspace")'
9223372034655938496
~~~

単純にgrepすると、require "objspace" は以下で行われています。

 test/dl/test_handle.rb:        require 'objspace'
 test/fiddle/test_closure.rb:      require 'objspace'
 test/fiddle/test_handle.rb:        require 'objspace'
 test/lib/profile_test_all.rb:require 'objspace'
 test/objspace/test_objspace.rb:require "objspace"
 test/ruby/test_file_exhaustive.rb:    require "objspace"

これらのテストの実行順番に依存して(ファイルシステムのディレクトリエントリの順番の偶然などのタイミングによって?)、エラーが出たり出なかったりするようです。




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-dev:48914] [Ruby trunk - Bug #10384] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
       [not found] <redmine.issue-10384.20141014131455@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2015-01-05 15:16 ` [ruby-dev:48802] [ruby-trunk - Bug #10384] [Closed] " nobu
@ 2015-03-30 15:33 ` nagachika00
  2015-04-22  4:57 ` [ruby-dev:48944] " ngotogenome
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: nagachika00 @ 2015-03-30 15:33 UTC (permalink / raw
  To: ruby-dev

Issue #10384 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE

Backported into `ruby_2_1` at r50129.

----------------------------------------
Bug #10384: Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
https://bugs.ruby-lang.org/issues/10384#change-51979

* Author: Naohisa Goto
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0dev (2014-10-14) [sparc64-solaris2.10]
* Backport: 2.0.0: REQUIRED, 2.1: DONE
----------------------------------------
Solarisにて、make test-all中に以下のエラーが発生することが多くなっています。
(出ないこともたまにあります。)

~~~
  2) Error:
DL::TestHandle#test_static_sym:
DL::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/dl/test_handle.rb:34:in `sym'
    /XXXXX/test/dl/test_handle.rb:34:in `rescue in test_static_sym'
    /XXXXX/test/dl/test_handle.rb:27:in `test_static_sym'

  4) Error:
Fiddle::TestHandle#test_NEXT:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:171:in `[]'
    /XXXXX/test/fiddle/test_handle.rb:171:in `rescue in test_NEXT'
    /XXXXX/test/fiddle/test_handle.rb:144:in `test_NEXT'

  5) Error:
Fiddle::TestHandle#test_static_sym:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:41:in `sym'
    /XXXXX/test/fiddle/test_handle.rb:41:in `rescue in test_static_sym'
    /XXXXX/test/fiddle/test_handle.rb:34:in `test_static_sym'
~~~

Fiddle::Handle.sym および Fiddle::Handle.[] (DL::Handle.sym なども同様)は内部で RTLD_NEXT を使用しています。
Solarisのman dlsym(3C) より引用します。

http://docs.oracle.com/cd/E23823_01/html/816-5168/dlsym-3c.html

~~~
     RTLD_NEXT       Instructs dlsym() to search  for  the  named
                     symbol  in the objects that were loaded fol-
                     lowing the object  from  which  the  dlsym()
                     call is being made.
~~~

Solarisのdlsymでは、handleに RTLD_NEXT を指定した場合は、そのコードが読み込まれた後に読み込んだシンボルしか検索しません。
このため、require "objspace" による objspace.so の読み込みが require "fiddle" より前に発生していた場合はエラーになります。

(requireの順番によりエラーが出る・出ないの再現コード)

~~~
 % ruby -e 'require "objspace"; require "fiddle"; p Fiddle::Handle.sym("Init_objspace")'
-e:1:in `sym': unknown symbol "Init_objspace" (Fiddle::DLError)
        from -e:1:in `<main>'
 % ruby -e 'require "fiddle"; require "objspace"; p Fiddle::Handle.sym("Init_objspace")'
9223372034655938496
~~~

単純にgrepすると、require "objspace" は以下で行われています。

 test/dl/test_handle.rb:        require 'objspace'
 test/fiddle/test_closure.rb:      require 'objspace'
 test/fiddle/test_handle.rb:        require 'objspace'
 test/lib/profile_test_all.rb:require 'objspace'
 test/objspace/test_objspace.rb:require "objspace"
 test/ruby/test_file_exhaustive.rb:    require "objspace"

これらのテストの実行順番に依存して(ファイルシステムのディレクトリエントリの順番の偶然などのタイミングによって?)、エラーが出たり出なかったりするようです。




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-dev:48944] [Ruby trunk - Bug #10384] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
       [not found] <redmine.issue-10384.20141014131455@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2015-03-30 15:33 ` [ruby-dev:48914] [Ruby trunk - Bug #10384] " nagachika00
@ 2015-04-22  4:57 ` ngotogenome
  2015-04-24  8:34 ` [ruby-dev:48945] " usa
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: ngotogenome @ 2015-04-22  4:57 UTC (permalink / raw
  To: ruby-dev

Issue #10384 has been updated by Naohisa Goto.

Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: REQUIRED, 2.1: REQUIRED

----------------------------------------
Bug #10384: Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
https://bugs.ruby-lang.org/issues/10384#change-52215

* Author: Naohisa Goto
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0dev (2014-10-14) [sparc64-solaris2.10]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
Solarisにて、make test-all中に以下のエラーが発生することが多くなっています。
(出ないこともたまにあります。)

~~~
  2) Error:
DL::TestHandle#test_static_sym:
DL::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/dl/test_handle.rb:34:in `sym'
    /XXXXX/test/dl/test_handle.rb:34:in `rescue in test_static_sym'
    /XXXXX/test/dl/test_handle.rb:27:in `test_static_sym'

  4) Error:
Fiddle::TestHandle#test_NEXT:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:171:in `[]'
    /XXXXX/test/fiddle/test_handle.rb:171:in `rescue in test_NEXT'
    /XXXXX/test/fiddle/test_handle.rb:144:in `test_NEXT'

  5) Error:
Fiddle::TestHandle#test_static_sym:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:41:in `sym'
    /XXXXX/test/fiddle/test_handle.rb:41:in `rescue in test_static_sym'
    /XXXXX/test/fiddle/test_handle.rb:34:in `test_static_sym'
~~~

Fiddle::Handle.sym および Fiddle::Handle.[] (DL::Handle.sym なども同様)は内部で RTLD_NEXT を使用しています。
Solarisのman dlsym(3C) より引用します。

http://docs.oracle.com/cd/E23823_01/html/816-5168/dlsym-3c.html

~~~
     RTLD_NEXT       Instructs dlsym() to search  for  the  named
                     symbol  in the objects that were loaded fol-
                     lowing the object  from  which  the  dlsym()
                     call is being made.
~~~

Solarisのdlsymでは、handleに RTLD_NEXT を指定した場合は、そのコードが読み込まれた後に読み込んだシンボルしか検索しません。
このため、require "objspace" による objspace.so の読み込みが require "fiddle" より前に発生していた場合はエラーになります。

(requireの順番によりエラーが出る・出ないの再現コード)

~~~
 % ruby -e 'require "objspace"; require "fiddle"; p Fiddle::Handle.sym("Init_objspace")'
-e:1:in `sym': unknown symbol "Init_objspace" (Fiddle::DLError)
        from -e:1:in `<main>'
 % ruby -e 'require "fiddle"; require "objspace"; p Fiddle::Handle.sym("Init_objspace")'
9223372034655938496
~~~

単純にgrepすると、require "objspace" は以下で行われています。

 test/dl/test_handle.rb:        require 'objspace'
 test/fiddle/test_closure.rb:      require 'objspace'
 test/fiddle/test_handle.rb:        require 'objspace'
 test/lib/profile_test_all.rb:require 'objspace'
 test/objspace/test_objspace.rb:require "objspace"
 test/ruby/test_file_exhaustive.rb:    require "objspace"

これらのテストの実行順番に依存して(ファイルシステムのディレクトリエントリの順番の偶然などのタイミングによって?)、エラーが出たり出なかったりするようです。




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-dev:48945] [Ruby trunk - Bug #10384] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
       [not found] <redmine.issue-10384.20141014131455@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2015-04-22  4:57 ` [ruby-dev:48944] " ngotogenome
@ 2015-04-24  8:34 ` usa
  2016-03-28 14:53 ` [ruby-dev:49535] [Ruby trunk Bug#10384] " nagachika00
  2016-03-28 17:50 ` [ruby-dev:49537] " nagachika00
  7 siblings, 0 replies; 8+ messages in thread
From: usa @ 2015-04-24  8:34 UTC (permalink / raw
  To: ruby-dev

Issue #10384 has been updated by Usaku NAKAMURA.

Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE

ruby_2_1 r50383 merged revision(s) 49154,49155,49156,49159.

----------------------------------------
Bug #10384: Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
https://bugs.ruby-lang.org/issues/10384#change-52235

* Author: Naohisa Goto
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0dev (2014-10-14) [sparc64-solaris2.10]
* Backport: 2.0.0: REQUIRED, 2.1: DONE
----------------------------------------
Solarisにて、make test-all中に以下のエラーが発生することが多くなっています。
(出ないこともたまにあります。)

~~~
  2) Error:
DL::TestHandle#test_static_sym:
DL::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/dl/test_handle.rb:34:in `sym'
    /XXXXX/test/dl/test_handle.rb:34:in `rescue in test_static_sym'
    /XXXXX/test/dl/test_handle.rb:27:in `test_static_sym'

  4) Error:
Fiddle::TestHandle#test_NEXT:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:171:in `[]'
    /XXXXX/test/fiddle/test_handle.rb:171:in `rescue in test_NEXT'
    /XXXXX/test/fiddle/test_handle.rb:144:in `test_NEXT'

  5) Error:
Fiddle::TestHandle#test_static_sym:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:41:in `sym'
    /XXXXX/test/fiddle/test_handle.rb:41:in `rescue in test_static_sym'
    /XXXXX/test/fiddle/test_handle.rb:34:in `test_static_sym'
~~~

Fiddle::Handle.sym および Fiddle::Handle.[] (DL::Handle.sym なども同様)は内部で RTLD_NEXT を使用しています。
Solarisのman dlsym(3C) より引用します。

http://docs.oracle.com/cd/E23823_01/html/816-5168/dlsym-3c.html

~~~
     RTLD_NEXT       Instructs dlsym() to search  for  the  named
                     symbol  in the objects that were loaded fol-
                     lowing the object  from  which  the  dlsym()
                     call is being made.
~~~

Solarisのdlsymでは、handleに RTLD_NEXT を指定した場合は、そのコードが読み込まれた後に読み込んだシンボルしか検索しません。
このため、require "objspace" による objspace.so の読み込みが require "fiddle" より前に発生していた場合はエラーになります。

(requireの順番によりエラーが出る・出ないの再現コード)

~~~
 % ruby -e 'require "objspace"; require "fiddle"; p Fiddle::Handle.sym("Init_objspace")'
-e:1:in `sym': unknown symbol "Init_objspace" (Fiddle::DLError)
        from -e:1:in `<main>'
 % ruby -e 'require "fiddle"; require "objspace"; p Fiddle::Handle.sym("Init_objspace")'
9223372034655938496
~~~

単純にgrepすると、require "objspace" は以下で行われています。

 test/dl/test_handle.rb:        require 'objspace'
 test/fiddle/test_closure.rb:      require 'objspace'
 test/fiddle/test_handle.rb:        require 'objspace'
 test/lib/profile_test_all.rb:require 'objspace'
 test/objspace/test_objspace.rb:require "objspace"
 test/ruby/test_file_exhaustive.rb:    require "objspace"

これらのテストの実行順番に依存して(ファイルシステムのディレクトリエントリの順番の偶然などのタイミングによって?)、エラーが出たり出なかったりするようです。




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-dev:49535] [Ruby trunk Bug#10384] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
       [not found] <redmine.issue-10384.20141014131455@ruby-lang.org>
                   ` (5 preceding siblings ...)
  2015-04-24  8:34 ` [ruby-dev:48945] " usa
@ 2016-03-28 14:53 ` nagachika00
  2016-03-28 17:50 ` [ruby-dev:49537] " nagachika00
  7 siblings, 0 replies; 8+ messages in thread
From: nagachika00 @ 2016-03-28 14:53 UTC (permalink / raw
  To: ruby-dev

Issue #10384 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE

Backported into `ruby_2_2` branch at r54316.

----------------------------------------
Bug #10384: Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
https://bugs.ruby-lang.org/issues/10384#change-57744

* Author: Naohisa Goto
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0dev (2014-10-14) [sparc64-solaris2.10]
* Backport: 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE
----------------------------------------
Solarisにて、make test-all中に以下のエラーが発生することが多くなっています。
(出ないこともたまにあります。)

~~~
  2) Error:
DL::TestHandle#test_static_sym:
DL::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/dl/test_handle.rb:34:in `sym'
    /XXXXX/test/dl/test_handle.rb:34:in `rescue in test_static_sym'
    /XXXXX/test/dl/test_handle.rb:27:in `test_static_sym'

  4) Error:
Fiddle::TestHandle#test_NEXT:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:171:in `[]'
    /XXXXX/test/fiddle/test_handle.rb:171:in `rescue in test_NEXT'
    /XXXXX/test/fiddle/test_handle.rb:144:in `test_NEXT'

  5) Error:
Fiddle::TestHandle#test_static_sym:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:41:in `sym'
    /XXXXX/test/fiddle/test_handle.rb:41:in `rescue in test_static_sym'
    /XXXXX/test/fiddle/test_handle.rb:34:in `test_static_sym'
~~~

Fiddle::Handle.sym および Fiddle::Handle.[] (DL::Handle.sym なども同様)は内部で RTLD_NEXT を使用しています。
Solarisのman dlsym(3C) より引用します。

http://docs.oracle.com/cd/E23823_01/html/816-5168/dlsym-3c.html

~~~
     RTLD_NEXT       Instructs dlsym() to search  for  the  named
                     symbol  in the objects that were loaded fol-
                     lowing the object  from  which  the  dlsym()
                     call is being made.
~~~

Solarisのdlsymでは、handleに RTLD_NEXT を指定した場合は、そのコードが読み込まれた後に読み込んだシンボルしか検索しません。
このため、require "objspace" による objspace.so の読み込みが require "fiddle" より前に発生していた場合はエラーになります。

(requireの順番によりエラーが出る・出ないの再現コード)

~~~
 % ruby -e 'require "objspace"; require "fiddle"; p Fiddle::Handle.sym("Init_objspace")'
-e:1:in `sym': unknown symbol "Init_objspace" (Fiddle::DLError)
        from -e:1:in `<main>'
 % ruby -e 'require "fiddle"; require "objspace"; p Fiddle::Handle.sym("Init_objspace")'
9223372034655938496
~~~

単純にgrepすると、require "objspace" は以下で行われています。

 test/dl/test_handle.rb:        require 'objspace'
 test/fiddle/test_closure.rb:      require 'objspace'
 test/fiddle/test_handle.rb:        require 'objspace'
 test/lib/profile_test_all.rb:require 'objspace'
 test/objspace/test_objspace.rb:require "objspace"
 test/ruby/test_file_exhaustive.rb:    require "objspace"

これらのテストの実行順番に依存して(ファイルシステムのディレクトリエントリの順番の偶然などのタイミングによって?)、エラーが出たり出なかったりするようです。




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-dev:49537] [Ruby trunk Bug#10384] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
       [not found] <redmine.issue-10384.20141014131455@ruby-lang.org>
                   ` (6 preceding siblings ...)
  2016-03-28 14:53 ` [ruby-dev:49535] [Ruby trunk Bug#10384] " nagachika00
@ 2016-03-28 17:50 ` nagachika00
  7 siblings, 0 replies; 8+ messages in thread
From: nagachika00 @ 2016-03-28 17:50 UTC (permalink / raw
  To: ruby-dev

Issue #10384 has been updated by Tomoyuki Chikanaga.


r49154 should be backported too. Backported into `ruby_2_2` branch at r54342.

----------------------------------------
Bug #10384: Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris
https://bugs.ruby-lang.org/issues/10384#change-57771

* Author: Naohisa Goto
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0dev (2014-10-14) [sparc64-solaris2.10]
* Backport: 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE
----------------------------------------
Solarisにて、make test-all中に以下のエラーが発生することが多くなっています。
(出ないこともたまにあります。)

~~~
  2) Error:
DL::TestHandle#test_static_sym:
DL::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/dl/test_handle.rb:34:in `sym'
    /XXXXX/test/dl/test_handle.rb:34:in `rescue in test_static_sym'
    /XXXXX/test/dl/test_handle.rb:27:in `test_static_sym'

  4) Error:
Fiddle::TestHandle#test_NEXT:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:171:in `[]'
    /XXXXX/test/fiddle/test_handle.rb:171:in `rescue in test_NEXT'
    /XXXXX/test/fiddle/test_handle.rb:144:in `test_NEXT'

  5) Error:
Fiddle::TestHandle#test_static_sym:
Fiddle::DLError: unknown symbol "Init_objspace"
    /XXXXX/test/fiddle/test_handle.rb:41:in `sym'
    /XXXXX/test/fiddle/test_handle.rb:41:in `rescue in test_static_sym'
    /XXXXX/test/fiddle/test_handle.rb:34:in `test_static_sym'
~~~

Fiddle::Handle.sym および Fiddle::Handle.[] (DL::Handle.sym なども同様)は内部で RTLD_NEXT を使用しています。
Solarisのman dlsym(3C) より引用します。

http://docs.oracle.com/cd/E23823_01/html/816-5168/dlsym-3c.html

~~~
     RTLD_NEXT       Instructs dlsym() to search  for  the  named
                     symbol  in the objects that were loaded fol-
                     lowing the object  from  which  the  dlsym()
                     call is being made.
~~~

Solarisのdlsymでは、handleに RTLD_NEXT を指定した場合は、そのコードが読み込まれた後に読み込んだシンボルしか検索しません。
このため、require "objspace" による objspace.so の読み込みが require "fiddle" より前に発生していた場合はエラーになります。

(requireの順番によりエラーが出る・出ないの再現コード)

~~~
 % ruby -e 'require "objspace"; require "fiddle"; p Fiddle::Handle.sym("Init_objspace")'
-e:1:in `sym': unknown symbol "Init_objspace" (Fiddle::DLError)
        from -e:1:in `<main>'
 % ruby -e 'require "fiddle"; require "objspace"; p Fiddle::Handle.sym("Init_objspace")'
9223372034655938496
~~~

単純にgrepすると、require "objspace" は以下で行われています。

 test/dl/test_handle.rb:        require 'objspace'
 test/fiddle/test_closure.rb:      require 'objspace'
 test/fiddle/test_handle.rb:        require 'objspace'
 test/lib/profile_test_all.rb:require 'objspace'
 test/objspace/test_objspace.rb:require "objspace"
 test/ruby/test_file_exhaustive.rb:    require "objspace"

これらのテストの実行順番に依存して(ファイルシステムのディレクトリエントリの順番の偶然などのタイミングによって?)、エラーが出たり出なかったりするようです。




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-28 17:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-10384.20141014131455@ruby-lang.org>
2014-10-14 13:14 ` [ruby-dev:48629] [ruby-trunk - Bug #10384] [Open] Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle::TestHandle#test_NEXT and Fiddle::TestHandle#test_static_sym on Solaris ngotogenome
2015-01-05  3:38 ` [ruby-dev:48800] [ruby-trunk - Bug #10384] " shibata.hiroshi
2015-01-05 15:16 ` [ruby-dev:48802] [ruby-trunk - Bug #10384] [Closed] " nobu
2015-03-30 15:33 ` [ruby-dev:48914] [Ruby trunk - Bug #10384] " nagachika00
2015-04-22  4:57 ` [ruby-dev:48944] " ngotogenome
2015-04-24  8:34 ` [ruby-dev:48945] " usa
2016-03-28 14:53 ` [ruby-dev:49535] [Ruby trunk Bug#10384] " nagachika00
2016-03-28 17:50 ` [ruby-dev:49537] " nagachika00

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).