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 0A51B19C000E for ; Thu, 29 Oct 2015 10:42:10 +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 4C597B5D89F for ; Thu, 29 Oct 2015 11:10:10 +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 406CD95243A for ; Thu, 29 Oct 2015 11:10:10 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id B209D1204CC; Thu, 29 Oct 2015 11:10:07 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 582BF120484 for ; Thu, 29 Oct 2015 11:10:01 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=RFQYfVhA33FeNFexdprAQXHvPzI=; b=clDqFxpBcICGU94o2h BgUny5+NrQisLwTA6GQPAKBap+ipEtM8DvnjKWg1nGPUo5lb57Ou2yy8AEdSPY+m RFDIEjZZvNIOvUhj1V8TYH7rE3mOEAvBmy5tf8eq19ehKLZLg+B2U/zQ4G9WtdMZ +oAut6QU9VwhFF76kaGD/pr1w= Received: by filter0551p1mdw1.sendgrid.net with SMTP id filter0551p1mdw1.18758.56317FF32 2015-10-29 02:09:55.021938725 +0000 UTC Received: from herokuapp.com (ec2-54-234-121-181.compute-1.amazonaws.com [54.234.121.181]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id Vs1Y5ubMQUCX_YDrliexRg for ; Thu, 29 Oct 2015 02:09:54.918 +0000 (UTC) Date: Thu, 29 Oct 2015 02:09:54 +0000 From: shugo@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 45887 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11384 X-Redmine-Issue-Author: normalperson X-Redmine-Sender: shugo 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS5fuVVUqKS9fXR1yBmTVnY2s7QUzm6hvdH8fk 4tR4QP2ijP3RNAeMZRan2C7TIUw6bnP6lCE2w62UYCT3HlNXgvCRyh/2Qm2a661nfLbC/ZMjUpraMb 0IG1gHdLcjRRlvsDVk/8MupJ+3xmTf8GAqyw X-ML-Name: ruby-core X-Mail-Count: 71258 Subject: [ruby-core:71258] [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: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11384 has been updated by Shugo Maeda. Eric Wong wrote: > shugo@ruby-lang.org wrote: > > The script causes an error within 100 times on My Ubuntu 14.04 box, > > but it runs over 10,000 times with your patch. > > Is my patch still running beyond 10,000 times? It's still running beyond 49,000 times on my notebook, which sleeps at night. I'll inform you if any error occurs. ---------------------------------------- Bug #11384: multi-threaded autoload sometimes fails https://bugs.ruby-lang.org/issues/11384#change-54631 * Author: Eric Wong * Status: Closed * Priority: Normal * Assignee: * ruby -v: trunk r51319 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- ~~~ 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. -- https://bugs.ruby-lang.org/