Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Nov 2007 22:37:50 -0500
From:      "Jeremy Messenger" <mezz7@cox.net>
To:        lemon <lemon+freebsd@zomo.co.uk>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: ruby18, -pthreads, deep recursion
Message-ID:  <op.t05a1ct19aq2h7@mezz.mezzweb.com>
In-Reply-To: <472A3F63.9010500@zomo.co.uk>
References:  <472A3F63.9010500@zomo.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 01 Nov 2007 16:04:35 -0500, lemon <lemon+freebsd@zomo.co.uk> 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.
<snip>


-- 
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.t05a1ct19aq2h7>