From owner-freebsd-ports@FreeBSD.ORG Tue Jun 5 13:44:02 2012 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2981106566B; Tue, 5 Jun 2012 13:44:01 +0000 (UTC) (envelope-from swills@mouf.net) Received: from mouf.net (mouf.net [IPv6:2607:fc50:0:4400:216:3eff:fe69:33b2]) by mx1.freebsd.org (Postfix) with ESMTP id A56F98FC15; Tue, 5 Jun 2012 13:44:01 +0000 (UTC) Received: from mouf.net (www@localhost [127.0.0.1]) by mouf.net (8.14.4/8.14.4) with ESMTP id q55Dhst3062636; Tue, 5 Jun 2012 09:43:54 -0400 (EDT) (envelope-from swills@mouf.net) Received: from 198.85.229.5 (SquirrelMail authenticated user swills) by mouf.net with HTTP; Tue, 5 Jun 2012 09:43:55 -0400 Message-ID: In-Reply-To: <07758721-BD54-4732-9B17-83D4CCCF55E0@freebsd.org> References: <4FC96D45.8080904@FreeBSD.org> <20120601193059.af9201da.stas@FreeBSD.org> <4FCD51E4.4030309@FreeBSD.org> <20120605085202.GI85127@deviant.kiev.zoral.com.ua> <07758721-BD54-4732-9B17-83D4CCCF55E0@freebsd.org> Date: Tue, 5 Jun 2012 09:43:55 -0400 From: "Steve Wills" To: "Stanislav Sedov" User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mouf.net [127.0.0.1]); Tue, 05 Jun 2012 09:43:55 -0400 (EDT) X-Spam-Status: No, score=-1.0 required=4.5 tests=ALL_TRUSTED,FSL_RCVD_USER autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mouf.net X-Virus-Scanned: clamav-milter 0.97.2 at mouf.net X-Virus-Status: Clean Cc: Konstantin Belousov , Steve Wills , ports@freebsd.org, ruby@freebsd.org Subject: Re: Ruby 1.9 as default X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 13:44:02 -0000 > > On Jun 5, 2012, at 1:52 AM, Konstantin Belousov wrote: > >> On Mon, Jun 04, 2012 at 08:25:08PM -0400, Steve Wills wrote: >>> On 06/01/12 22:30, Stanislav Sedov wrote: >>>> >>>> I'm not sure it's a good idea. >>>> Ruby 1.9 still has some nasty bugs on FreeBSD, related to the threads >>>> and >>>> fork. That is fork in ruby 1.9 hangs sometimes... >>> >>> The ONLY thing I can find is this: >>> >>> http://bugs.ruby-lang.org/issues/2097 >>> >>> which implies that it's fixed. If there's more to this issue than >>> "broken on 7.3 and earlier", PLEASE let me know. >> >> If ruby indeed does what the bugs described, that is, calls non-async >> signal safe functions from the threaded process after fork, then you >> are guaranteed to get random hangs sometimes. > > Actually, the problem I'm trying to debug right now is more weird. > When I run mono via system(3) from the ruby 1.9 process (I mean, > exactly system(3), not via some ruby wrapper) twice, it hangs on some > umtx the second time. This works all the time. > > I'm still trying to track it down in mono, though it's not clear how > this can happen at all. Isn't execve(2) used by system(3) is supposed > to clear everything (mutexes at least)? > Is this perhaps the -pthread issue I hit with perl? The issue is that if you call (dlopen, exec, whatever) a threaded app from a non-threaded on, it hangs due to the fact that libc takes shortcuts and doesn't initialize thread related things in non-threaded apps. The solution is to build with -pthread. (I may be describing the problem wrong, but the solution of building with -pthread works.) Perhaps we need to build ruby with -pthread? Steve