Bug #5021

test_empty(DL::TestCFunc): DL::DLError: unknown symbol "strcpy"

Added by Makoto Kishimoto almost 4 years ago. Updated almost 4 years ago.

[ruby-dev:44091]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 1.9.3dev (2011-07-10) [x86_64-freebsd8.2] Backport:

Description

手元の環境(FreeBSD 8.2 STABLE)で、
make test-all TESTS='-n test_empty dl/test_cfunc.rb open-uri/test_open-uri.rb'
のようにして test-all を実行すると、DL::TestCFunc の test_empty で以下のようにエラーが起きます

$ make test-all TESTS='-n test_empty dl/test_cfunc.rb open-uri/test_open-uri.rb'
./miniruby -I../ruby-git/lib -I. -I.ext/common ../ruby-git/tool/runruby.rb --extout=.ext -- --disable-gems "../ruby-git/test/runner.rb" --ruby="./miniruby -I../ruby-git/lib -I. -I.ext/common ../ruby-git/tool/runruby.rb --extout=.ext -- --disable-gems" -n test_empty dl/test_cfunc.rb open-uri/test_open-uri.rb
Run options: "--ruby=./miniruby -I../ruby-git/lib -I. -I.ext/common ../ruby-git/tool/runruby.rb --extout=.ext -- --disable-gems" -n test_empty

Running tests:

.E

Finished tests in 0.002551s, 784.1563 tests/s, 0.0000 assertions/s.

1) Error:
test_empty(DL::TestCFunc):
DL::DLError: unknown symbol "strcpy"
/export/home/ksmakoto/ruby-working/ruby-wk/ruby-git/test/dl/test_cfunc.rb:9:in []'
/export/home/ksmakoto/ruby-working/ruby-wk/ruby-git/test/dl/test_cfunc.rb:9:in
setup'

2 tests, 0 assertions, 0 failures, 1 errors, 0 skips
*** Error code 1

Stop in /export/home/ksmakoto/ruby-working/ruby-wk/BUILD.

HEAD の他、trunk の open-uri のテストが作られた最初のリビジョンでも同様にエラーになります
また、test-all で全てのテストを実行した場合にも起きることがあり、test ディレクトリ以下のディレクトリ中のファイルの並び順によって起きたり起きなかったりします。起きるパターンになっていると必ず起きます

Associated revisions

Revision 32586
Added by Yui NARUSE almost 4 years ago

  • ext/dl/handle.c (dlhandle_sym): clear previous error with dlerror() before calling dlsym(). [Bug #5021]

Revision 32586
Added by Yui NARUSE almost 4 years ago

  • ext/dl/handle.c (dlhandle_sym): clear previous error with dlerror() before calling dlsym(). [Bug #5021]

History

#1 Updated by Yui NARUSE almost 4 years ago

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

This issue was solved with changeset r32586.
Makoto, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/dl/handle.c (dlhandle_sym): clear previous error with dlerror() before calling dlsym(). [Bug #5021]

#2 Updated by Yui NARUSE almost 4 years ago

ちなみに、これの再現コードは以下のとおりでした。

require 'dl'
require 'socket'
Socket.gethostbyname("localhost")
DL::dlopen("/usr/lib/libc.so")['strcpy']

Also available in: Atom PDF