From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID, T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id DEE2A1FA7B for ; Wed, 14 Jun 2017 04:57:26 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C98D71207BF; Wed, 14 Jun 2017 13:57:23 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id D4652120765 for ; Wed, 14 Jun 2017 13:57:21 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=GL4imeFtYgPODoYmirkAUA0i22M=; b=IZE3Qk2ZHePbw/j6oD 2p+oMaf8ytZVA0XpIvEcaPWN7zpezSzMKm+tcS/Q8zOcptC5MhHw6RHXmfXvvjWB gJQeaLEeTtIZp3N1IsjKXi4DcQPqQwJycL6aXaWejmo9VhNbBosGVb6wGvcJsJx7 n3u0h20y1JSDWhXpBaWEf2WhU= Received: by filter1108p1mdw1.sendgrid.net with SMTP id filter1108p1mdw1-31198-5940C22D-41 2017-06-14 04:57:17.704347534 +0000 UTC Received: from herokuapp.com (ec2-54-92-183-230.compute-1.amazonaws.com [54.92.183.230]) by ismtpd0004p1iad1.sendgrid.net (SG) with ESMTP id xVQutEYOSSC-c6GEqT6cJQ for ; Wed, 14 Jun 2017 04:57:17.664 +0000 (UTC) Date: Wed, 14 Jun 2017 04:57:17 +0000 From: k@rhe.jp To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56706 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11033 X-Redmine-Issue-Author: tknerr X-Redmine-Issue-Assignee: X-Redmine-Sender: rhenium X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS4St/HzyfywUykqy91W4xSc1rS+kkg7y6kdTV XbxHWd7Jd8SIU6+fJoiCFtl5F6CMBj3O8/Zui9Q3ZbgIipgc1QzdkW9B7wGIrPbzNzc4bl+4IfF5b1 FaAsSc1ju2X2ypKjQYvgIIw0dGBiC9sS7W43 X-ML-Name: ruby-core X-Mail-Count: 81678 Subject: [ruby-core:81678] [Ruby trunk Bug#11033] OpenSSL related threading issues in Ruby 2.1 and 2.2 X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11033 has been updated by rhenium (Kazuki Yamaguchi). Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: REQUIRED [Bug #8386] is unrelated to this. The X509_load_cert_crl_file() function called from OpenSSL::X509::Store#add_file is leaking error in the OpenSSL error queue. This is fixed in OpenSSL's master branch a while ago. https://github.com/openssl/openssl/commit/c0452248ea1a59a41023a4765ef7d9825e80a62b I'm adding a workaround to ruby/openssl for previous versions of OpenSSL. ---------------------------------------- Bug #11033: OpenSSL related threading issues in Ruby 2.1 and 2.2 https://bugs.ruby-lang.org/issues/11033#change-65369 * Author: tknerr (Torben Knerr) * Status: Open * Priority: Normal * Assignee: openssl * Target version: * ruby -v: 2.1.5p273, 2.2.1p85 * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: REQUIRED ---------------------------------------- I'm experiencing some problems with multiple https connections in Ruby 2.1 and 2.2, whilst in Ruby 2.0 everything is working fine. This happens on a Windows 7 (64-bit) box in the context of installing multiple gems in parallel via bundlers `BUNDLE_JOBS=` setting. What I see are multiple `OpenSSL::SSL::SSLError: SSL_read: cert already in hash table` warnings and at some more or less random point it bails out because it cannot install a gem. When I repeat the `bundle install` command it will get past that gem and fail at a later one. I can repeat until all gems are installed. This is the stacktrace I get for every of the ssl warnings: ``` ... Installing polyglot 0.3.5 4: polyglot (0.3.5) from X:/home/.gem/ruby/2.2.0/specifications/polyglot-0.3.5.gemspec OpenSSL::SSL::SSLError: SSL_read: cert already in hash table X:/tools/ruby-2.2.1/lib/ruby/2.2.0/openssl/buffering.rb:182:in `sysread_nonblock' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/openssl/buffering.rb:182:in `read_nonblock' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/net/protocol.rb:153:in `rbuf_fill' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/net/protocol.rb:134:in `readuntil' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/net/protocol.rb:144:in `readline' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/net/http/response.rb:39:in `read_status_line' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/net/http/response.rb:28:in `read_new' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:1414:in `block in transport_request' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:1411:in `catch' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:1411:in `transport_request' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:1384:in `request' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/rubygems/request.rb:154:in `perform_request' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/rubygems/request.rb:109:in `fetch' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:346:in `request' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:231:in `fetch_http' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:247:in `fetch_http' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:267:in `fetch_path' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:302:in `cache_update_path' X:/tools/ruby-2.2.1/lib/ruby/2.2.0/rubygems/remote_fetcher.rb:168:in `download' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/rubygems_integration.rb:544:in `download_gem' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/fetcher.rb:63:in `download_gem_from_uri' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/source/rubygems.rb:370:in `fetch_gem' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/source/rubygems.rb:98:in `install' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/installer.rb:107:in `install_gem_from_spec' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/installer.rb:287:in `block in install_in_parallel' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/worker.rb:55:in `call' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/worker.rb:55:in `apply_func' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/worker.rb:50:in `block in process_queue' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/worker.rb:47:in `loop' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/worker.rb:47:in `process_queue' X:/tools/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.2/lib/bundler/worker.rb:22:in `block (2 levels) in initialize' ... ``` This is originally reported here (with a bit more details): https://github.com/bundler/bundler/issues/3545 Any ideas? Might it be a regression of #8386? -- https://bugs.ruby-lang.org/