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,RP_MATCHES_RCVD,SPF_PASS, T_DKIM_INVALID 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 C611520209 for ; Fri, 30 Jun 2017 10:56:44 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 939E0120755; Fri, 30 Jun 2017 19:56:43 +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 A6AE1120730 for ; Fri, 30 Jun 2017 19:56:41 +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=2g9/wjyUUoP6XUW85N1KgNdU0Fg=; b=MsJJL1vpgbKEsOSzBL MARz0ssWpydU8HUwEB2R+LpdBOlAoVRjhFJs30UeKdlIHPuO8WGrmW0UCCk3hvsy iOFl0++JKsGgy6vvdMdFemja/i7Gb01QpoydexaAEilRS11+EeQxoV0x96zNc4e8 Yb4WOI/aWq5E8VBcyst6lg1pE= Received: by filter0439p1mdw1.sendgrid.net with SMTP id filter0439p1mdw1-8308-59562E65-24 2017-06-30 10:56:37.458716212 +0000 UTC Received: from herokuapp.com (ec2-54-158-194-247.compute-1.amazonaws.com [54.158.194.247]) by ismtpd0039p1mdw1.sendgrid.net (SG) with ESMTP id gtx8LWBlSzueOdc3TBJcbA Fri, 30 Jun 2017 10:56:37.416 +0000 (UTC) Date: Fri, 30 Jun 2017 10:56:38 +0000 (UTC) From: usa@garbagecollect.jp To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56881 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11384 X-Redmine-Issue-Author: normalperson X-Redmine-Sender: usa 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS5XGc2PbkHcmPeDqt7O0ZSyISMdrK4xs5QJtA KY0noU8/6jW/j6d9uPUton3ML11TjZELHhWoN+vGIIMbmgSZPL3jZp6Lflgka4ZW8CgG+4wl4JNj1Y KCQuHxZ3UX/fXqLa+SgBSuEANuV+FqELlltbHJkrOf2v/y+ZUum1+8i/1A== X-ML-Name: ruby-core X-Mail-Count: 81853 Subject: [ruby-core:81853] [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 usa (Usaku NAKAMURA). Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: REQUIRED, 2.4: REQUIRED to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: DONE, 2.4: REQUIRED ruby_2_3 r59221 merged revision(s) 58696. ---------------------------------------- Bug #11384: multi-threaded autoload sometimes fails https://bugs.ruby-lang.org/issues/11384#change-65575 * 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: 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/