Project

General

Profile

Backport #5786

LoadError: cannot load such file -- openssl

Added by znz (Kazuhiro NISHIYAMA) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-dev:45021]

Description

openssl がビルドされていないと test-all で LoadError: cannot load such file -- openssl になっていくつかエラーになります。
途中で Ctrl+C で止めてしまっているのでもっと出るのかもしれません。

test_cgi_session_filestore(CGISessionTest):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:140:in
hex'
.../ruby/lib/cgi/session.rb:173:in create_new_id'
.../ruby/lib/cgi/session.rb:267:in
initialize'
.../ruby/test/cgi/test_cgi_session.rb:33:in new'
.../ruby/test/cgi/test_cgi_session.rb:33:in
test_cgi_session_filestore'

2) Error:
test_cgi_session_pstore(CGISessionTest):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:140:in
hex'
.../ruby/lib/cgi/session.rb:173:in create_new_id'
.../ruby/lib/cgi/session.rb:267:in
initialize'
.../ruby/test/cgi/test_cgi_session.rb:71:in new'
.../ruby/test/cgi/test_cgi_session.rb:71:in
test_cgi_session_pstore'

3) Error:
test_cgi_session_specify_session_key(CGISessionTest):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:140:in
hex'
.../ruby/lib/cgi/session.rb:173:in create_new_id'
.../ruby/lib/cgi/session.rb:267:in
initialize'
.../ruby/test/cgi/test_cgi_session.rb:148:in new'
.../ruby/test/cgi/test_cgi_session.rb:148:in
test_cgi_session_specify_session_key'

4) Error:
test_https_proxy_authentication(HTTPSProxyTest):
LoadError: cannot load such file -- openssl
.../ruby/test/net/http/test_https_proxy.rb:16:in `block (2 levels) in test_https_proxy_authentication'

5) Error:
test_ssl_socket_close_on_post_connection_check_fail(Net::TestSSLSocket):
LoadError: cannot load such file -- openssl
.../ruby/lib/net/smtp.rb:197:in default_ssl_context'
.../ruby/lib/net/smtp.rb:345:in
enable_starttls_auto'
.../ruby/test/net/smtp/test_ssl_socket.rb:51:in `test_ssl_socket_close_on_post_connection_check_fail'

6) Error:
test_ssl_socket_open_on_post_connection_check_success(Net::TestSSLSocket):
LoadError: cannot load such file -- openssl
.../ruby/lib/net/smtp.rb:197:in default_ssl_context'
.../ruby/lib/net/smtp.rb:345:in
enable_starttls_auto'
.../ruby/test/net/smtp/test_ssl_socket.rb:67:in `test_ssl_socket_open_on_post_connection_check_success'


Files

signature.asc (499 Bytes) signature.asc Anonymous, 12/27/2011 07:53 PM

Associated revisions

Revision ca0bb518
Added by kazu over 7 years ago

  • test/net/http/test_https_proxy.rb
    (HTTPSProxyTest#test_https_proxy_authentication):
    add workaround to avoid to hang up without openssl.
    see #5786

  • test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
    ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 34421
Added by kazu over 7 years ago

  • test/net/http/test_https_proxy.rb
    (HTTPSProxyTest#test_https_proxy_authentication):
    add workaround to avoid to hang up without openssl.
    see #5786

  • test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
    ditto.

Revision 34421
Added by znz (Kazuhiro NISHIYAMA) over 7 years ago

  • test/net/http/test_https_proxy.rb
    (HTTPSProxyTest#test_https_proxy_authentication):
    add workaround to avoid to hang up without openssl.
    see #5786

  • test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
    ditto.

Revision 34421
Added by kazu over 7 years ago

  • test/net/http/test_https_proxy.rb
    (HTTPSProxyTest#test_https_proxy_authentication):
    add workaround to avoid to hang up without openssl.
    see #5786

  • test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
    ditto.

Revision 34421
Added by kazu over 7 years ago

  • test/net/http/test_https_proxy.rb
    (HTTPSProxyTest#test_https_proxy_authentication):
    add workaround to avoid to hang up without openssl.
    see #5786

  • test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
    ditto.

Revision 34421
Added by kazu over 7 years ago

  • test/net/http/test_https_proxy.rb
    (HTTPSProxyTest#test_https_proxy_authentication):
    add workaround to avoid to hang up without openssl.
    see #5786

  • test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
    ditto.

Revision 34421
Added by kazu over 7 years ago

  • test/net/http/test_https_proxy.rb
    (HTTPSProxyTest#test_https_proxy_authentication):
    add workaround to avoid to hang up without openssl.
    see #5786

  • test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
    ditto.

Revision 00af7b8f
Added by naruse (Yui NARUSE) over 7 years ago

merge revision(s) 34555: [Backport #5786]

    * compile.c (defined_expr): guard the whole expression.
      [ruby-dev:45021][Bug#5786]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 34607
Added by naruse (Yui NARUSE) over 7 years ago

merge revision(s) 34555: [Backport #5786]

* compile.c (defined_expr): guard the whole expression.
  [ruby-dev:45021][Bug#5786]

History

Updated by znz (Kazuhiro NISHIYAMA) over 7 years ago

% git grep -n 'autoload.*openssl'

lib/net/http.rb:24:autoload :OpenSSL, 'openssl'
%
で autoload が設定されていて、
lib/securerandom.rb:59: if defined? OpenSSL::Random
の defined? で LoadError になってしまうのが原因のようです。
autoload と defined? の組み合わせは以下のようにバージョン毎に微妙に挙動が違うようです。

% cat /tmp/test.rb

autoload :OpenSSL, 'openssl'
p defined?(OpenSSL)
p defined?(OpenSSL::Random)
% ./ruby -v /tmp/test.rb
ruby 1.8.7 (2011-12-10 patchlevel 356) [x86_64-linux]
"constant"
"constant"
% cd $(\ls -1d /home/chkbuild/tmp/build/ruby-1.9.2/|tail -n1)/bin
% ./ruby -v /tmp/test.rb

ruby 1.9.2p312 (2011-12-18 revision 34062) [x86_64-linux]
nil
nil
% cd $(\ls -1d /home/chkbuild/tmp/build/ruby-1.9.3/
|tail -n1)/bin
% ./ruby -v /tmp/test.rb

ruby 1.9.3p6 (2011-12-20 revision 34080) [x86_64-linux]
"constant"
"constant"
% cd $(\ls -1d /home/chkbuild/tmp/build/ruby-trunk/*|tail -n1)/bin
% ./ruby -v /tmp/test.rb
ruby 2.0.0dev (2011-12-21 trunk 34088) [x86_64-linux]
"constant"
"constant"
%

Updated by nahi (Hiroshi Nakamura) over 7 years ago

  • ruby -v changed from ruby 2.0.0dev (2011-12-21 trunk 34091) [x86_64-linux] to -

On Thu, Dec 22, 2011 at 00:32, Kazuhiro NISHIYAMA redmine@ruby-lang.org wrote:

% git grep -n 'autoload.*openssl'
lib/net/http.rb:24:autoload :OpenSSL, 'openssl'
%
で autoload が設定されていて、
lib/securerandom.rb:59: if defined? OpenSSL::Random
の defined? で LoadError になってしまうのが原因のようです。

なるほどー。いいバグですねえ。net/http.rbがOpenSSLをautoloadにしているので、net/http.rb経由でOpenSSLを触るテストは落ちるし、securerandom.rbもif
defined? OpenSSL::RandomのOpenSSL定数アクセスで落ちてしまう、ということでしょうか。

で、どうしますかね。opensslなしでもテスト通ったほうがいい?

autoload と defined? の組み合わせは以下のようにバージョン毎に微妙に挙動が違うようです。

詳しく見てませんが、opensslがインストールしてあるかどうかの差だったりします?

==

For Martin (emboss): He said he got test failures when ossl was not
built. net/http.rb defined autoload for OpenSSL so tests that depend
net/http.rb would try to load openssl via OpenSSL access then fail.
Tests that depend securerandom.rb also fails by 'if defined?
OpenSSL::Random', too. Also, 'if defined? OpenSSL' guards in
test/openssl would not work as expected.

Anyways, it's not the bug of ossl but of the build system, and not severe.

Updated by MartinBosslet (Martin Bosslet) over 7 years ago

That's so nice of you to translate, thank you! Please let me know if and how I can help!

Updated by kosaki (Motohiro KOSAKI) over 7 years ago

ええと。

ちゃんと読んでないのですが僕の理解が正しければ、 if defined? OpenSSL を使うのをやめて、テストの最初で require 'openssl' してみて例外投げてきたらスキップとかすればいい?

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

なかだです。

(11/12/22 0:32), Kazuhiro NISHIYAMA wrote:

% git grep -n 'autoload.*openssl'

lib/net/http.rb:24:autoload :OpenSSL, 'openssl'
%
で autoload が設定されていて、
lib/securerandom.rb:59: if defined? OpenSSL::Random
の defined? で LoadError になってしまうのが原因のようです。
autoload と defined? の組み合わせは以下のようにバージョン毎に微妙に挙動が違うようです。

% cat /tmp/test.rb

autoload :OpenSSL, 'openssl'
p defined?(OpenSSL)
p defined?(OpenSSL::Random)
% ./ruby -v /tmp/test.rb
ruby 1.8.7 (2011-12-10 patchlevel 356) [x86_64-linux]
"constant"
"constant"
% cd $(\ls -1d /home/chkbuild/tmp/build/ruby-1.9.2/|tail -n1)/bin
% ./ruby -v /tmp/test.rb

ruby 1.9.2p312 (2011-12-18 revision 34062) [x86_64-linux]
nil
nil
% cd $(\ls -1d /home/chkbuild/tmp/build/ruby-1.9.3/
|tail -n1)/bin
% ./ruby -v /tmp/test.rb

ruby 1.9.3p6 (2011-12-20 revision 34080) [x86_64-linux]
"constant"
"constant"
% cd $(\ls -1d /home/chkbuild/tmp/build/ruby-trunk/*|tail -n1)/bin
% ./ruby -v /tmp/test.rb
ruby 2.0.0dev (2011-12-21 trunk 34088) [x86_64-linux]
"constant"
"constant"

これは、1.9からautoloadされる定数がdefined?でnilになるというバグがあっ
たので1.9.3で直したのですが、そのときに定数のdefined?で例外が起きないと
いう(1.9.0で導入された誤った)仮定にそぐわなくなったためです。おそらく最
右辺以外の定数参照にISEQ_TYPE_DEFINED_GUARDを付ける必要があるのではない
かと思います。

--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦

Updated by Anonymous over 7 years ago

(2011/12/22 10:18), Nobuyoshi Nakada wrote:

これは、1.9からautoloadされる定数がdefined?でnilになるというバグがあっ
たので1.9.3で直したのですが、そのときに定数のdefined?で例外が起きないと
いう(1.9.0で導入された誤った)仮定にそぐわなくなったためです。おそらく最
右辺以外の定数参照にISEQ_TYPE_DEFINED_GUARDを付ける必要があるのではない
かと思います。

いまひとつ中田さんが書かれていることを理解しきれていませんが、
defined?(A::B) は、普通にAの定数参照をして、Aがautoloadだったらそれも解
決しちゃう、ということでいいですよね?

= 2.0.0dev

% cat autoload_defined.rb
autoload :OpenSSL, 'openssl'
p defined?(OpenSSL)
p $LOADED_FEATURES.grep(/openssl/).empty?
p defined?(OpenSSL::Random)
p $LOADED_FEATURES.grep(/openssl/).empty?
% ruby -v autoload_defined.rb
ruby 2.0.0dev (2011-12-26 trunk 34138) [x86_64-linux]
"constant"
true
"constant"
false

= 1.9.3

% ruby -v autoload_defined.rb
ruby 1.9.3p6 (2011-12-15 revision 34049) [x86_64-linux]
"constant"
true
"constant"
false

= 1.9.2

% ruby -v autoload_defined.rb
ruby 1.9.2p312 (2011-08-11 revision 32926) [x86_64-linux]
nil
true
nil
true

= 1.8.7

% ruby187 -v autoload_defined.rb
ruby 1.8.7 (2011-12-10 patchlevel 356) [x86_64-linux]
"constant"
true
"constant"
false

1.9.3で、1.8と同じ挙動になった、と。

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

なかだです。

(11/12/27 19:39), Hiroshi Nakamura wrote:

(2011/12/22 10:18), Nobuyoshi Nakada wrote:

これは、1.9からautoloadされる定数がdefined?でnilになるというバグがあっ
たので1.9.3で直したのですが、そのときに定数のdefined?で例外が起きないと
いう(1.9.0で導入された誤った)仮定にそぐわなくなったためです。おそらく最
右辺以外の定数参照にISEQ_TYPE_DEFINED_GUARDを付ける必要があるのではない
かと思います。

いまひとつ中田さんが書かれていることを理解しきれていませんが、
defined?(A::B) は、普通にAの定数参照をして、Aがautoloadだったらそれも解
決しちゃう、ということでいいですよね?

そうなります。

1.9.3で、1.8と同じ挙動になった、と。

ただし、Aの解決時に例外が起きても無視しなくなっているという違いが残って
います。具体的には、defined?(raise::A)が1.8まではnilになるのに対して、
1.9以降では例外になります。

--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦

Updated by Anonymous over 7 years ago

(2011/12/27 21:22), Nobuyoshi Nakada wrote:

ただし、Aの解決時に例外が起きても無視しなくなっているという違いが残って
います。具体的には、defined?(raise::A)が1.8まではnilになるのに対して、
1.9以降では例外になります。

やっと理解しました。

% ruby187 -e 'defined?(raise::Foo)'
% ruby -e 'defined?(raise::Foo)'
-e:1:in `': unhandled exception

元に戻ると、

if defined? OpenSSL::Random

は、OpenSSLという定数が存在していなくても、例えば

if defined? NO_SUCH_CONST::FOO::BAR

等と同様、例外を上げたりしないことを期待しているということですね。

securerandom.rb絡みのテスト失敗は、これを直せばなくなるとして、net/http
やnet/smtpのテストはどうしましょうかね。

Updated by znz (Kazuhiro NISHIYAMA) over 7 years ago

  • Target version set to 2.0.0
  • ruby -v changed from - to ruby 2.0.0dev (2012-02-03 trunk 34424) [x86_64-linux]

r34421 にコミットした場当たり的な対処でとりあえず止まることはなくなりましたが、
1 failures, 33 errors です。

1) Failure:
test_install_security_policy(TestGemDependencyInstaller) [.../ruby/test/rubygems/test_gem_dependency_installer.rb:524]:
--- expected
+++ actual
@@ -1 +1 @@
-"Unsigned gem"
+"SSL is not installed on this system"

2) Error:
test_class_sign_cert(TestGemSecurity):
LoadError: cannot load such file -- openssl
.../ruby/test/rubygems/test_gem_security.rb:62:in `test_class_sign_cert'

3) Error:
test_cgi_session_specify_session_key(CGISessionTest):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:140:in
hex'
.../ruby/lib/cgi/session.rb:173:in create_new_id'
.../ruby/lib/cgi/session.rb:267:in
initialize'
.../ruby/test/cgi/test_cgi_session.rb:148:in new'
.../ruby/test/cgi/test_cgi_session.rb:148:in
test_cgi_session_specify_session_key'

4) Error:
test_ssl_socket_close_on_post_connection_check_fail(Net::TestSSLSocket):
LoadError: cannot load such file -- openssl
.../ruby/lib/net/smtp.rb:197:in default_ssl_context'
.../ruby/lib/net/smtp.rb:345:in
enable_starttls_auto'
.../ruby/test/net/smtp/test_ssl_socket.rb:51:in `test_ssl_socket_close_on_post_connection_check_fail'

5) Error:
test_ssl_socket_open_on_post_connection_check_success(Net::TestSSLSocket):
LoadError: cannot load such file -- openssl
.../ruby/lib/net/smtp.rb:197:in default_ssl_context'
.../ruby/lib/net/smtp.rb:345:in
enable_starttls_auto'
.../ruby/test/net/smtp/test_ssl_socket.rb:67:in `test_ssl_socket_open_on_post_connection_check_success'

6) Error:
test_execute_private_key(TestGemCommandsCertCommand):
LoadError: cannot load such file -- openssl
.../ruby/lib/rubygems/commands/cert_command.rb:67:in block in initialize'
.../ruby/lib/rubygems/command.rb:445:in
call'
.../ruby/lib/rubygems/command.rb:445:in block (2 levels) in configure_options'
.../ruby/lib/optparse.rb:1360:in
call'
.../ruby/lib/optparse.rb:1360:in block in parse_in_order'
.../ruby/lib/optparse.rb:1347:in
catch'
.../ruby/lib/optparse.rb:1347:in parse_in_order'
.../ruby/lib/optparse.rb:1341:in
order!'
.../ruby/lib/optparse.rb:1432:in permute!'
.../ruby/lib/optparse.rb:1453:in
parse!'
.../ruby/lib/rubygems/command.rb:348:in handle_options'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:90:in
block in test_execute_private_key'
.../ruby/lib/rubygems/user_interaction.rb:40:in use_ui'
.../ruby/lib/rubygems/user_interaction.rb:63:in
use_ui'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:89:in `test_execute_private_key'

7) Error:
test_execute_remove(TestGemCommandsCertCommand):
LoadError: cannot load such file -- openssl
.../ruby/lib/rubygems/commands/cert_command.rb:43:in rescue in block (2 levels) in initialize'
.../ruby/lib/rubygems/commands/cert_command.rb:37:in
block (2 levels) in initialize'
.../ruby/lib/rubygems/commands/cert_command.rb:36:in glob'
.../ruby/lib/rubygems/commands/cert_command.rb:36:in
block in initialize'
.../ruby/lib/rubygems/command.rb:445:in call'
.../ruby/lib/rubygems/command.rb:445:in
block (2 levels) in configure_options'
.../ruby/lib/optparse.rb:1360:in call'
.../ruby/lib/optparse.rb:1360:in
block in parse_in_order'
.../ruby/lib/optparse.rb:1347:in catch'
.../ruby/lib/optparse.rb:1347:in
parse_in_order'
.../ruby/lib/optparse.rb:1341:in order!'
.../ruby/lib/optparse.rb:1432:in
permute!'
.../ruby/lib/optparse.rb:1453:in parse!'
.../ruby/lib/rubygems/command.rb:348:in
handle_options'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:102:in block in test_execute_remove'
.../ruby/lib/rubygems/user_interaction.rb:40:in
use_ui'
.../ruby/lib/rubygems/user_interaction.rb:63:in use_ui'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:101:in
test_execute_remove'

8) Error:
test_execute_list(TestGemCommandsCertCommand):
LoadError: cannot load such file -- openssl
.../ruby/lib/rubygems/commands/cert_command.rb:24:in rescue in block (2 levels) in initialize'
.../ruby/lib/rubygems/commands/cert_command.rb:20:in
block (2 levels) in initialize'
.../ruby/lib/rubygems/commands/cert_command.rb:19:in glob'
.../ruby/lib/rubygems/commands/cert_command.rb:19:in
block in initialize'
.../ruby/lib/rubygems/command.rb:445:in call'
.../ruby/lib/rubygems/command.rb:445:in
block (2 levels) in configure_options'
.../ruby/lib/optparse.rb:1360:in call'
.../ruby/lib/optparse.rb:1360:in
block in parse_in_order'
.../ruby/lib/optparse.rb:1347:in catch'
.../ruby/lib/optparse.rb:1347:in
parse_in_order'
.../ruby/lib/optparse.rb:1341:in order!'
.../ruby/lib/optparse.rb:1432:in
permute!'
.../ruby/lib/optparse.rb:1453:in parse!'
.../ruby/lib/rubygems/command.rb:348:in
handle_options'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:81:in block in test_execute_list'
.../ruby/lib/rubygems/user_interaction.rb:40:in
use_ui'
.../ruby/lib/rubygems/user_interaction.rb:63:in use_ui'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:80:in
test_execute_list'

9) Error:
test_execute_certificate(TestGemCommandsCertCommand):
LoadError: cannot load such file -- openssl
.../ruby/lib/rubygems/commands/cert_command.rb:61:in block in initialize'
.../ruby/lib/rubygems/command.rb:445:in
call'
.../ruby/lib/rubygems/command.rb:445:in block (2 levels) in configure_options'
.../ruby/lib/optparse.rb:1360:in
call'
.../ruby/lib/optparse.rb:1360:in block in parse_in_order'
.../ruby/lib/optparse.rb:1347:in
catch'
.../ruby/lib/optparse.rb:1347:in parse_in_order'
.../ruby/lib/optparse.rb:1341:in
order!'
.../ruby/lib/optparse.rb:1432:in permute!'
.../ruby/lib/optparse.rb:1453:in
parse!'
.../ruby/lib/rubygems/command.rb:348:in handle_options'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:69:in
block in test_execute_certificate'
.../ruby/lib/rubygems/user_interaction.rb:40:in use_ui'
.../ruby/lib/rubygems/user_interaction.rb:63:in
use_ui'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:68:in `test_execute_certificate'

10) Error:
test_execute_sign(TestGemCommandsCertCommand):
LoadError: cannot load such file -- openssl
.../ruby/lib/rubygems/commands/cert_command.rb:67:in block in initialize'
.../ruby/lib/rubygems/command.rb:445:in
call'
.../ruby/lib/rubygems/command.rb:445:in block (2 levels) in configure_options'
.../ruby/lib/optparse.rb:1391:in
call'
.../ruby/lib/optparse.rb:1391:in block in parse_in_order'
.../ruby/lib/optparse.rb:1347:in
catch'
.../ruby/lib/optparse.rb:1347:in parse_in_order'
.../ruby/lib/optparse.rb:1341:in
order!'
.../ruby/lib/optparse.rb:1432:in permute!'
.../ruby/lib/optparse.rb:1453:in
parse!'
.../ruby/lib/rubygems/command.rb:348:in handle_options'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:113:in
block in test_execute_sign'
.../ruby/lib/rubygems/user_interaction.rb:40:in use_ui'
.../ruby/lib/rubygems/user_interaction.rb:63:in
use_ui'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:112:in `test_execute_sign'

11) Error:
test_execute_build(TestGemCommandsCertCommand):
Gem::Exception: SSL is not installed on this system
.../ruby/lib/rubygems/gem_openssl.rb:33:in ensure_ssl_available'
.../ruby/lib/rubygems/security.rb:705:in
build_self_signed_cert'
.../ruby/lib/rubygems/commands/cert_command.rb:52:in block in initialize'
.../ruby/lib/rubygems/command.rb:445:in
call'
.../ruby/lib/rubygems/command.rb:445:in block (2 levels) in configure_options'
.../ruby/lib/optparse.rb:1360:in
call'
.../ruby/lib/optparse.rb:1360:in block in parse_in_order'
.../ruby/lib/optparse.rb:1347:in
catch'
.../ruby/lib/optparse.rb:1347:in parse_in_order'
.../ruby/lib/optparse.rb:1341:in
order!'
.../ruby/lib/optparse.rb:1432:in permute!'
.../ruby/lib/optparse.rb:1453:in
parse!'
.../ruby/lib/rubygems/command.rb:348:in handle_options'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:49:in
block (2 levels) in test_execute_build'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:48:in chdir'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:48:in
block in test_execute_build'
.../ruby/lib/rubygems/user_interaction.rb:40:in use_ui'
.../ruby/lib/rubygems/user_interaction.rb:63:in
use_ui'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:47:in `test_execute_build'

12) Error:
test_execute_add(TestGemCommandsCertCommand):
LoadError: cannot load such file -- openssl
.../ruby/lib/rubygems/commands/cert_command.rb:11:in block in initialize'
.../ruby/lib/rubygems/command.rb:445:in
call'
.../ruby/lib/rubygems/command.rb:445:in block (2 levels) in configure_options'
.../ruby/lib/optparse.rb:1360:in
call'
.../ruby/lib/optparse.rb:1360:in block in parse_in_order'
.../ruby/lib/optparse.rb:1347:in
catch'
.../ruby/lib/optparse.rb:1347:in parse_in_order'
.../ruby/lib/optparse.rb:1341:in
order!'
.../ruby/lib/optparse.rb:1432:in permute!'
.../ruby/lib/optparse.rb:1453:in
parse!'
.../ruby/lib/rubygems/command.rb:348:in handle_options'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:36:in
block in test_execute_add'
.../ruby/lib/rubygems/user_interaction.rb:40:in use_ui'
.../ruby/lib/rubygems/user_interaction.rb:63:in
use_ui'
.../ruby/test/rubygems/test_gem_commands_cert_command.rb:35:in `test_execute_add'

13) Error:
test_cgi_session_filestore(CGISessionTest):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:140:in
hex'
.../ruby/lib/cgi/session.rb:173:in create_new_id'
.../ruby/lib/cgi/session.rb:267:in
initialize'
.../ruby/test/cgi/test_cgi_session.rb:33:in new'
.../ruby/test/cgi/test_cgi_session.rb:33:in
test_cgi_session_filestore'

14) Error:
test_self_open_signed(TestGemPackageTarOutput):
Gem::Exception: SSL is not installed on this system
.../ruby/lib/rubygems/gem_openssl.rb:33:in ensure_ssl_available'
.../ruby/lib/rubygems/security.rb:792:in
initialize'
.../ruby/test/rubygems/test_gem_package_tar_output.rb:56:in new'
.../ruby/test/rubygems/test_gem_package_tar_output.rb:56:in
test_self_open_signed'

15) Error:
test_class_email_to_name(TestGemSecurity):
LoadError: cannot load such file -- openssl
.../ruby/lib/rubygems/security.rb:755:in email_to_name'
.../ruby/test/rubygems/test_gem_security.rb:79:in
test_class_email_to_name'

16) Error:
test_class_build_self_signed_cert(TestGemSecurity):
Gem::Exception: SSL is not installed on this system
.../ruby/lib/rubygems/gem_openssl.rb:33:in ensure_ssl_available'
.../ruby/lib/rubygems/security.rb:705:in
build_self_signed_cert'
.../ruby/test/rubygems/test_gem_security.rb:49:in `test_class_build_self_signed_cert'

17) Error:
test_class_build_cert(TestGemSecurity):
LoadError: cannot load such file -- openssl
.../ruby/test/rubygems/test_gem_security.rb:8:in `test_class_build_cert'

18) Error:
test_cgi_session_pstore(CGISessionTest):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:140:in
hex'
.../ruby/lib/cgi/session.rb:173:in create_new_id'
.../ruby/lib/cgi/session.rb:267:in
initialize'
.../ruby/test/cgi/test_cgi_session.rb:71:in new'
.../ruby/test/cgi/test_cgi_session.rb:71:in
test_cgi_session_pstore'

19) Error:
test_set_form(TestNetHTTP_v1_2):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:191:in
urlsafe_base64'
.../ruby/lib/net/http.rb:2018:in send_request_with_body_data'
.../ruby/lib/net/http.rb:1973:in
exec'
.../ruby/lib/net/http.rb:1348:in block in transport_request'
.../ruby/lib/net/http.rb:1347:in
catch'
.../ruby/lib/net/http.rb:1347:in transport_request'
.../ruby/lib/net/http.rb:1321:in
request'
.../ruby/test/net/http/test_http.rb:383:in _test_set_form_multipart'
.../ruby/test/net/http/test_http.rb:364:in
block in test_set_form'
.../ruby/lib/net/http.rb:774:in start'
.../ruby/test/net/http/utils.rb:11:in
start'
.../ruby/test/net/http/test_http.rb:362:in `test_set_form'

20) Error:
test_set_form_with_file(TestNetHTTP_v1_2):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:191:in
urlsafe_base64'
.../ruby/lib/net/http.rb:2018:in send_request_with_body_data'
.../ruby/lib/net/http.rb:1973:in
exec'
.../ruby/lib/net/http.rb:1348:in block in transport_request'
.../ruby/lib/net/http.rb:1347:in
catch'
.../ruby/lib/net/http.rb:1347:in transport_request'
.../ruby/lib/net/http.rb:1321:in
request'
.../ruby/test/net/http/test_http.rb:412:in block in test_set_form_with_file'
.../ruby/lib/net/http.rb:774:in
start'
.../ruby/test/net/http/utils.rb:11:in start'
.../ruby/test/net/http/test_http.rb:408:in
test_set_form_with_file'

21) Error:
test_set_form(TestNetHTTP_v1_2_chunked):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:191:in
urlsafe_base64'
.../ruby/lib/net/http.rb:2018:in send_request_with_body_data'
.../ruby/lib/net/http.rb:1973:in
exec'
.../ruby/lib/net/http.rb:1348:in block in transport_request'
.../ruby/lib/net/http.rb:1347:in
catch'
.../ruby/lib/net/http.rb:1347:in transport_request'
.../ruby/lib/net/http.rb:1321:in
request'
.../ruby/test/net/http/test_http.rb:383:in _test_set_form_multipart'
.../ruby/test/net/http/test_http.rb:364:in
block in test_set_form'
.../ruby/lib/net/http.rb:774:in start'
.../ruby/test/net/http/utils.rb:11:in
start'
.../ruby/test/net/http/test_http.rb:362:in `test_set_form'

22) Error:
test_set_form_with_file(TestNetHTTP_v1_2_chunked):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:191:in
urlsafe_base64'
.../ruby/lib/net/http.rb:2018:in send_request_with_body_data'
.../ruby/lib/net/http.rb:1973:in
exec'
.../ruby/lib/net/http.rb:1348:in block in transport_request'
.../ruby/lib/net/http.rb:1347:in
catch'
.../ruby/lib/net/http.rb:1347:in transport_request'
.../ruby/lib/net/http.rb:1321:in
request'
.../ruby/test/net/http/test_http.rb:412:in block in test_set_form_with_file'
.../ruby/lib/net/http.rb:774:in
start'
.../ruby/test/net/http/utils.rb:11:in start'
.../ruby/test/net/http/test_http.rb:408:in
test_set_form_with_file'

23) Error:
test_no_server(TestResolvDNS):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:224:in
random_number'
.../ruby/lib/resolv.rb:596:in random'
.../ruby/lib/resolv.rb:614:in
rangerand'
.../ruby/lib/resolv.rb:646:in bind_random_port'
.../ruby/lib/resolv.rb:783:in
initialize'
.../ruby/lib/resolv.rb:552:in new'
.../ruby/lib/resolv.rb:552:in
make_udp_requester'
.../ruby/lib/resolv.rb:510:in each_resource'
.../ruby/lib/resolv.rb:500:in
getresources'
.../ruby/test/resolv/test_dns.rb:149:in block in test_no_server'
.../ruby/lib/resolv.rb:302:in
open'
.../ruby/test/resolv/test_dns.rb:148:in `test_no_server'

24) Error:
test_query_ipv4_address_timeout(TestResolvDNS):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:224:in
random_number'
.../ruby/lib/resolv.rb:596:in random'
.../ruby/lib/resolv.rb:614:in
rangerand'
.../ruby/lib/resolv.rb:646:in bind_random_port'
.../ruby/lib/resolv.rb:783:in
initialize'
.../ruby/lib/resolv.rb:552:in new'
.../ruby/lib/resolv.rb:552:in
make_udp_requester'
.../ruby/lib/resolv.rb:510:in each_resource'
.../ruby/lib/resolv.rb:500:in
getresources'
.../ruby/test/resolv/test_dns.rb:121:in block (2 levels) in test_query_ipv4_address_timeout'
.../ruby/lib/resolv.rb:302:in
open'
.../ruby/test/resolv/test_dns.rb:118:in block in test_query_ipv4_address_timeout'
.../ruby/test/resolv/test_dns.rb:19:in
with_udp'
.../ruby/test/resolv/test_dns.rb:115:in `test_query_ipv4_address_timeout'

25) Error:
test_s_base64(TestSecureRandom):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:161:in
base64'
.../ruby/test/test_securerandom.rb:109:in `test_s_base64'

26) Error:
test_s_hex(TestSecureRandom):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:140:in
hex'
.../ruby/test/test_securerandom.rb:101:in `test_s_hex'

27) Error:
test_s_random_bytes(TestSecureRandom):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/test/test_securerandom.rb:12:in
test_s_random_bytes'

28) Error:
test_s_random_number_float(TestSecureRandom):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:230:in
random_number'
.../ruby/test/test_securerandom.rb:129:in block in test_s_random_number_float'
.../ruby/test/test_securerandom.rb:128:in
times'
.../ruby/test/test_securerandom.rb:128:in `test_s_random_number_float'

29) Error:
test_s_random_number_float_by_zero(TestSecureRandom):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:230:in
random_number'
.../ruby/test/test_securerandom.rb:136:in block in test_s_random_number_float_by_zero'
.../ruby/test/test_securerandom.rb:135:in
times'
.../ruby/test/test_securerandom.rb:135:in `test_s_random_number_float_by_zero'

30) Error:
test_s_random_number_int(TestSecureRandom):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:224:in
random_number'
.../ruby/test/test_securerandom.rb:144:in block in test_s_random_number_int'
.../ruby/test/test_securerandom.rb:142:in
times'
.../ruby/test/test_securerandom.rb:142:in `test_s_random_number_int'

31) Error:
test_s_urlsafe_base64(TestSecureRandom):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:191:in
urlsafe_base64'
.../ruby/test/test_securerandom.rb:118:in block in test_s_urlsafe_base64'
.../ruby/test/test_securerandom.rb:117:in
times'
.../ruby/test/test_securerandom.rb:117:in `test_s_urlsafe_base64'

32) Error:
test_uuid(TestSecureRandom):
LoadError: cannot load such file -- openssl
.../ruby/lib/securerandom.rb:59:in random_bytes'
.../ruby/lib/securerandom.rb:247:in
uuid'
.../ruby/test/test_securerandom.rb:150:in `test_uuid'

33) Error:
test_connect(TestWEBrickHTTPProxy):
LoadError: cannot load such file -- openssl
.../ruby/test/webrick/test_httpproxy.rb:136:in `test_connect'

34) Error:
test_upstream_proxy(TestWEBrickHTTPProxy):
LoadError: cannot load such file -- openssl
.../ruby/test/webrick/test_httpproxy.rb:249:in block (2 levels) in test_upstream_proxy'
.../ruby/test/webrick/utils.rb:41:in
yield'
.../ruby/test/webrick/utils.rb:41:in start_server'
.../ruby/test/webrick/utils.rb:56:in
start_httpproxy'
.../ruby/test/webrick/test_httpproxy.rb:200:in block in test_upstream_proxy'
.../ruby/test/webrick/utils.rb:41:in
yield'
.../ruby/test/webrick/utils.rb:41:in start_server'
.../ruby/test/webrick/utils.rb:56:in
start_httpproxy'
.../ruby/test/webrick/test_httpproxy.rb:190:in `test_upstream_proxy'

9517 tests, 2239674 assertions, 1 failures, 33 errors, 49 skips

Updated by znz (Kazuhiro NISHIYAMA) over 7 years ago

r34555 で関連する修正が入っていますが、'autoload :OpenSSL, "openssl"; p defined?(OpenSSL) は "constant" のままのようなので、 r34421 で入れた対処は revert せずにそのままにしておきます。

#11

Updated by naruse (Yui NARUSE) over 7 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby trunk to Backport193
  • Target version deleted (2.0.0)
#12

Updated by naruse (Yui NARUSE) over 7 years ago

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

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


merge revision(s) 34555: [Backport #5786]

* compile.c (defined_expr): guard the whole expression.
  [ruby-dev:45021][Bug#5786]

Also available in: Atom PDF