Bug #5021
closedtest_empty(DL::TestCFunc): DL::DLError: unknown symbol "strcpy"
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.
- 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 ディレクトリ以下のディレクトリ中のファイルの並び順によって起きたり起きなかったりします。起きるパターンになっていると必ず起きます
Updated by naruse (Yui NARUSE) about 13 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(). [ruby-dev:44091] [Bug #5021]
Updated by naruse (Yui NARUSE) about 13 years ago
ちなみに、これの再現コードは以下のとおりでした。
require 'dl'
require 'socket'
Socket.gethostbyname("localhost")
DL::dlopen("/usr/lib/libc.so")['strcpy']