From owner-freebsd-ports@FreeBSD.ORG Fri Nov 2 03:34:02 2007 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDD1216A417 for ; Fri, 2 Nov 2007 03:34:02 +0000 (UTC) (envelope-from mezz7@cox.net) Received: from eastrmmtao103.cox.net (eastrmmtao103.cox.net [68.230.240.9]) by mx1.freebsd.org (Postfix) with ESMTP id 6450313C4B8 for ; Fri, 2 Nov 2007 03:34:02 +0000 (UTC) (envelope-from mezz7@cox.net) Received: from eastrmimpo01.cox.net ([68.1.16.119]) by eastrmmtao103.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20071102033319.MFYZ1445.eastrmmtao103.cox.net@eastrmimpo01.cox.net>; Thu, 1 Nov 2007 23:33:19 -0400 Received: from mezz.mezzweb.com ([24.255.149.218]) by eastrmimpo01.cox.net with bizsmtp id 7fZ71Y00T4iy4EG0000000; Thu, 01 Nov 2007 23:33:07 -0400 Date: Thu, 01 Nov 2007 22:37:50 -0500 To: lemon From: "Jeremy Messenger" Content-Type: text/plain; format=flowed; delsp=yes; charset=us-ascii MIME-Version: 1.0 References: <472A3F63.9010500@zomo.co.uk> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <472A3F63.9010500@zomo.co.uk> User-Agent: Opera Mail/9.24 (Linux) Cc: freebsd-ports@freebsd.org Subject: Re: ruby18, -pthreads, deep recursion 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: Fri, 02 Nov 2007 03:34:02 -0000 On Thu, 01 Nov 2007 16:04:35 -0500, lemon wrote: > Hi, > > I've been struggling with FreeBSD's ruby18 port and threads. I realise > there's previous discussion[0] about this and I feel I'm blundering > somewhat, but here goes. > > On both 7.x and 6.x boxes I've built ruby18 with the pthreads knob > deliberately turned off (the default). The resultant ruby has problems > with deep recursion, shown by this script[1] but less pathologically in > production in a busy RoR site too. > > $ ruby -e 'def d(x); p x; d x+1; end; d 0' > > This bombs with SIGILL[2]. > > I note that, as per the conversations linked above, this build uses the > GCC option -pthread and links against libthr[3]. > > If I build the port without -pthread (and related config.h #define), > install the library alongside the from-port one, and employ the > resultant binary with some libmap.conf guidance I get a ruby which > behaves far nicer[4]. I can recurse way deeper and receive a graceful > SystemStackError exception when things hit the wall[5]. > > What's the score here? Clearly there's motive for building like it does, > but the hacked ruby works better for me in everyday life. Any ideas? > > I hope this is on-topic for freebsd-ports. I mailed the maintainer first > but got no response. People did a lot of test for lofi and me. You can see http://freebsd.rambler.ru/bsdmail/cvs-all_2005/msg08680.html ... Have ruby compiles without -pthread breaks more stuff than with -pthread. But we can't enable thread option because it also break more stuff than disable thread support. Weird? As for your problem of ruby with -pthread. I have known about that problem and there used to have a PR of it, but I can't find that PR. It was only a problem that ruby with -pthread is causing. I am not going to work on ruby all over again, so don't ask me. :-) I am hoping that someone can bring 100% solution, but we haven't get Mr. Right for ruby yet. Maybe Ruby 1.9 or 2.x with new VM/thread will solve this problem or not. Cheers, Mezz > Regards, l. -- mezz7@cox.net - mezz@FreeBSD.org FreeBSD GNOME Team - FreeBSD Multimedia Hat (ports, not src) http://www.FreeBSD.org/gnome/ - gnome@FreeBSD.org http://wiki.freebsd.org/multimedia - multimedia@FreeBSD.org