From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6939 64.71.128.0/18 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.raindrops.general Subject: Re: raindrops tests fail on smp, fork is to blame Date: Fri, 22 Jun 2012 15:29:20 -0700 Message-ID: <20120622222920.GA32552@dcvr.yhbt.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1340404174 12361 80.91.229.3 (22 Jun 2012 22:29:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 22 Jun 2012 22:29:34 +0000 (UTC) To: raindrops@librelist.org Original-X-From: raindrops@librelist.org Sat Jun 23 00:29:33 2012 Return-path: Envelope-to: gclrrg-raindrops@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: raindrops@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.raindrops.general:96 Archived-At: Received: from zedshaw.xen.prgmr.com ([64.71.167.205]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SiCM8-00014X-GS for gclrrg-raindrops@m.gmane.org; Sat, 23 Jun 2012 00:29:32 +0200 Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id DC07121DF73 for ; Fri, 22 Jun 2012 22:37:56 +0000 (UTC) Hleb Valoshka <375gnu@gmail.com> wrote: > Hello! > > Raindrops build hangs on debian's build servers, but not on my local > box. This occurs when tests are run under ruby1.9.1. You can see > example of build log in [0]. It took a lot of time to understand that > the main difference between build and my box is number of CPUs: > debian's servers are smp, my kvm box had only 1 cpu. > > Today I decided to start kvm with option -smp 2, and voila! build > hung. The more tests with fork() you have the higher probability build > will hang. When all tests are enabled, the probability of hang is > about 100% when tests are run by gem2deb (it loads all test files > simultaneously) and about 5-10% with "make test". When test_concurrect > from test_middleware.rb and test_incr_shared, test_incr_decr and > test_evaporate_with_fork from test_raindrops.rb are disabled build > runs without hangs. > > Any ideas? This is only on GNU/kFreeBSD, right? I managed to reproduce this on my older Debian GNU/kFreeBSD 6.0 KVM instance, too. I suspect it's a bad interaction with the internal timer thread of Ruby 1.9 and fork(). Probably some mutex is held when the fork() happens and attempting to acquire it in the child process causes a deadlock. Even without loading raindrops, the following code locks up for me with ruby1.9.1 1.9.2.0-2 on my Debian GNU/kFreeBSD 6.0 instance: 1000.times do pid = fork do 1 + 1 end Process.waitpid2(pid) end Can you try it on 1.9.3-p194 on your newer wheezy/sid install? I think some libc folks will need to be roped into this fix this.