From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id D40221BA00CB for ; Sat, 13 May 2017 06:07:19 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 708DFB5D88B for ; Sat, 13 May 2017 06:51:41 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 883D818CC883 for ; Sat, 13 May 2017 06:51:41 +0900 (JST) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 121C4120731; Sat, 13 May 2017 06:51:40 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id CB9DC120461 for ; Sat, 13 May 2017 06:51:36 +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=mAsTfzSTNDaztTkABXmFnLnvoKY=; b=A6zTvSXcnbtQNcJP8Z SkFdOAbTQVmNFSMkB9wWMAgpbzjbIY5816Zvb2xQY3MdUXLeegyZgtGjl96tMwtx u1gkMtGRjsCeQ39gqABst6egMRMdaAPSKRC4ZuAHOaoGWBDNmbndiY7taDfm/Yvg b7DH1cyYYY1cLOIAQ1fedtxLM= Received: by filter1097p1mdw1.sendgrid.net with SMTP id filter1097p1mdw1-21039-59162E64-3 2017-05-12 21:51:32.013336783 +0000 UTC Received: from herokuapp.com (ec2-54-167-54-144.compute-1.amazonaws.com [54.167.54.144]) by ismtpd0036p1mdw1.sendgrid.net (SG) with ESMTP id hr4E1XYTSJyjX4MyFr4XKA Fri, 12 May 2017 21:51:32.096 +0000 (UTC) Date: Fri, 12 May 2017 21:51:31 +0000 From: normalperson@yhbt.net To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56154 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11384 X-Redmine-Issue-Author: normalperson X-Redmine-Sender: normalperson 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4hnA5c2T7GK/48TDRzv2e9mc6yNcr0gnAPLk 36s2YYaw8l5ezYwCzOd++UnuSok9OwyU70FzFzmIMIE95u0+pBLGBIBvRZnzmaxQLnc5idYHUzIF6R O0mLtzoF5btTeFVsN+vVpimZ0kTWB4ThsaRWjiOuf7hD6XXt0+U/a9vYYw== X-ML-Name: ruby-core X-Mail-Count: 81130 Subject: [ruby-core:81130] [Ruby trunk Bug#11384] multi-threaded autoload sometimes fails 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 #11384 has been updated by normalperson (Eric Wong). File 0001-autoload-always-wait-on-loading-thread.patch added Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: REQUIRED, 2.4: REQUIRED I think the attached patch should fix it, over 12 million iterations and still going strong. ---------------------------------------- Bug #11384: multi-threaded autoload sometimes fails https://bugs.ruby-lang.org/issues/11384#change-64779 * Author: normalperson (Eric Wong) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: trunk r51319 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: REQUIRED, 2.4: REQUIRED ---------------------------------------- ~~~ I get this failure once in a blue moon: #8 test_autoload.rb:46:in `': open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} autoload :ZZZ, "./zzz.rb" t1 = Thread.new {ZZZ.ok} t2 = Thread.new {ZZZ.ok} [t1.value, t2.value].join #=> "" (expected "okok") stderr output is not empty bootstraptest.tmp.rb:5:in `block in
': uninitialized constant ZZZ (Name +Error) test_autoload.rb FAIL 1/8 FAIL 1/1010 tests failed It is a very rare failure, I extracted it into a standalone script and it took over 500,000 runs to hit it: unless test(?e, "zzz.rb") open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} end autoload :ZZZ, "./zzz.rb" t1 = Thread.new {ZZZ.ok} t2 = Thread.new {ZZZ.ok} [t1.value, t2.value].join ~~~ I'll work on this when I find time, but maybe somebody else can look at it sooner. I'm not sure if it affects older versions. ---Files-------------------------------- 0001-autoload-always-wait-on-loading-thread.patch (1.96 KB) -- https://bugs.ruby-lang.org/