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=-2.7 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,SPF_PASS, T_DKIM_INVALID shortcircuit=no autolearn=no 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 D60A4202AE for ; Sun, 9 Jul 2017 20:46:26 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id D7BB41207FE; Mon, 10 Jul 2017 05:46:25 +0900 (JST) 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 5BE901207F5 for ; Mon, 10 Jul 2017 05:46:20 +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=y6ERhjvpasYy0OHdXdeEKh1A3RM=; b=iKSig+x1QpyIG9mLDD DlZOmjZ0zs7TbdGe2fK7iDvEYVCOP+1EpGwd66UaHcSVkOboTZUUMypOXMlkMnjK 9/cUKHEoC871QTmsKDbThbGyoQrqTCSM1XRqDZ8GTW7MOsw1pDMEhbNmhE0inmKg QYhgadK5+kXq2bwiMrDx0mp8U= Received: by filter0420p1mdw1.sendgrid.net with SMTP id filter0420p1mdw1-485-59629618-19 2017-07-09 20:46:16.896601688 +0000 UTC Received: from herokuapp.com (ec2-54-167-182-125.compute-1.amazonaws.com [54.167.182.125]) by ismtpd0004p1iad1.sendgrid.net (SG) with ESMTP id dgXKa2s-SBOFn0HgK8BQdQ Sun, 09 Jul 2017 20:46:16.851 +0000 (UTC) Date: Sun, 09 Jul 2017 20:46:17 +0000 (UTC) From: nagachika00@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 57019 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11384 X-Redmine-Issue-Author: normalperson X-Redmine-Sender: nagachika 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4DFKG7TsU/xYjITLmJFYcsoqy99eVnNucnRL /BK0DOviISNcZDy3dPhLRU8E8SuKq4p0F3/iw5jtifvFnwFd2t0k+P4u2a45SHLceUA02DzMm4XjXx WwEipcStzfO+673rxwZCQaM2Xm/yuZOikrDl08BK87Gl8bY66O2cVwAt8A== X-ML-Name: ruby-core X-Mail-Count: 81984 Subject: [ruby-core:81984] [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 nagachika (Tomoyuki Chikanaga). Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: DONE, 2.4: REQUIRED to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: DONE, 2.4: DONE ruby_2_4 r59303 merged revision(s) 58696. ---------------------------------------- Bug #11384: multi-threaded autoload sometimes fails https://bugs.ruby-lang.org/issues/11384#change-65712 * Author: normalperson (Eric Wong) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: trunk r51319 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: DONE, 2.4: DONE ---------------------------------------- ~~~ 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/