Project

General

Profile

Backport #3794

test/openssl/test_ssl.rb hungs on mswin32_100

Added by arton (Akio Tajima) almost 9 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
[ruby-dev:42188]

Description

=begin
opensslがWinSockのerrnoを変換していないため、rb_io_wait_readableがEWOULDBLOCKと認識せずスレッドの切り替えが行われません。
パッチです。

--- ossl_ssl.c.org 2010-09-06 19:45:34.000000000 +0900
+++ ossl_ssl.c 2010-09-06 19:46:27.000000000 +0900
@@ -1018,7 +1018,7 @@ ossl_ssl_setup(VALUE self)
}

#ifdef _WIN32
-#define ssl_get_error(ssl, ret) (errno = WSAGetLastError(), SSL_get_error(ssl, ret))
+#define ssl_get_error(ssl, ret) (errno = rb_w32_map_errno(WSAGetLastError()), SSL_get_error(ssl, ret))
#else
#define ssl_get_error(ssl, ret) SSL_get_error(ssl, ret)
#endif
=end


Related issues

Related to Ruby master - Bug #3798: ruby 1.9.2 + OpenSSL 1.0.0.a on Windows 64 test hang .....Closed09/07/2010Actions

Associated revisions

Revision 849c3478
Added by nahi (Hiroshi Nakamura) almost 9 years ago

  • ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was blocked on Windows while blocking call for SSLSocket. Need to convert errno for letting rb_io_wait_readable detect EWOULDBLOCK. Patch by arton. ref #3794.

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

Revision 29197
Added by nahi (Hiroshi Nakamura) almost 9 years ago

  • ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was blocked on Windows while blocking call for SSLSocket. Need to convert errno for letting rb_io_wait_readable detect EWOULDBLOCK.
    Patch by arton. ref #3794.

Revision 29197
Added by nahi (Hiroshi Nakamura) almost 9 years ago

  • ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was blocked on Windows while blocking call for SSLSocket. Need to convert errno for letting rb_io_wait_readable detect EWOULDBLOCK.
    Patch by arton. ref #3794.

Revision 29197
Added by nahi (Hiroshi Nakamura) almost 9 years ago

  • ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was blocked on Windows while blocking call for SSLSocket. Need to convert errno for letting rb_io_wait_readable detect EWOULDBLOCK.
    Patch by arton. ref #3794.

Revision 29197
Added by nahi (Hiroshi Nakamura) almost 9 years ago

  • ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was blocked on Windows while blocking call for SSLSocket. Need to convert errno for letting rb_io_wait_readable detect EWOULDBLOCK.
    Patch by arton. ref #3794.

Revision 29197
Added by nahi (Hiroshi Nakamura) almost 9 years ago

  • ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was blocked on Windows while blocking call for SSLSocket. Need to convert errno for letting rb_io_wait_readable detect EWOULDBLOCK.
    Patch by arton. ref #3794.

Revision 29197
Added by nahi (Hiroshi Nakamura) almost 9 years ago

  • ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was blocked on Windows while blocking call for SSLSocket. Need to convert errno for letting rb_io_wait_readable detect EWOULDBLOCK.
    Patch by arton. ref #3794.

Revision 5be97645
Added by yugui (Yuki Sonoda) over 8 years ago

merges r29197 from trunk into ruby_1_9_2.

    * ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was
      blocked on Windows while blocking call for SSLSocket.  Need to
      convert errno for letting rb_io_wait_readable detect EWOULDBLOCK.
      Patch by arton. ref #3794.

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

Revision 30334
Added by yugui (Yuki Sonoda) over 8 years ago

merges r29197 from trunk into ruby_1_9_2.

    * ext/openssl/ossl_ssl.c (ssl_get_error): Thread context switch was
      blocked on Windows while blocking call for SSLSocket.  Need to 
      convert errno for letting rb_io_wait_readable detect EWOULDBLOCK.  
      Patch by arton. ref #3794.

History

#1

Updated by nahi (Hiroshi Nakamura) almost 9 years ago

  • Assignee set to nahi (Hiroshi Nakamura)

=begin

=end

#2

Updated by nahi (Hiroshi Nakamura) almost 9 years ago

=begin
広範囲に影響するものの、ビルド環境ないのでそのまま取り込んで様子を見ようと思いますが、
以前から伺っていたように、OpenSSL 1.0.0aとの組み合わせのときだけ発症、
という理解であっていますか?
=end

#3

Updated by arton (Akio Tajima) almost 9 years ago

=begin
artonです。

OpenSSL 1.0.0aとの組み合わせのときだけ発症、
という理解であっていますか?
勘違いだと思います。(私は、1.9.2-p0は、OpenSSL 1.0.0aでしか試していない
ので)
あのコードを読む限り、OpenSSLは無関係です。

--
arton artonx@yahoo.co.jp


GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
http://pr.mail.yahoo.co.jp/gyao/

=end

#4

Updated by nahi (Hiroshi Nakamura) almost 9 years ago

=begin

あのコードを読む限り、OpenSSLは無関係です。

了解です。御確認ありがとうございます。そのまま当てます。
=end

#5

Updated by nahi (Hiroshi Nakamura) almost 9 years ago

  • Status changed from Open to Closed
#6

Updated by usa (Usaku NAKAMURA) almost 9 years ago

=begin
まあいまさらですけど情報を残しておきますと、本件はVC10からerrno.hの
中身が変わりやがったことが影響したものと思われます。
VC9以前ではWSAGetLastError()の返す値は我々のerrnoと原則同値だった
ので、基本的には無変換でよかったのです。

なお対応方針として今回のパッチ適用で間違ってはいません。
=end

#7

Updated by usa (Usaku NAKAMURA) over 8 years ago

  • Category set to ext
  • Status changed from Closed to Assigned
  • Assignee changed from nahi (Hiroshi Nakamura) to yugui (Yuki Sonoda)

=begin
というわけなのでr29197のバックポートをお願いします。
これ抜きだとopenssl絡みでtest-allが刺さりまくるので、割と致命的です。
=end

#8

Updated by yugui (Yuki Sonoda) over 8 years ago

=begin
r30334にてマージしました。ご確認ください
=end

#9

Updated by yugui (Yuki Sonoda) over 8 years ago

  • Status changed from Assigned to Closed

=begin

=end

Also available in: Atom PDF