FreeBSD, ruby 1.8.2, libpthreads

Wednesday, 12. 09. 2007  –  Category: all, vague

Anecdotally people recommend not using libpthread with Ruby on FreeBSD. I’ve duly always told the port to not use it, but ldd has always shown that it’s linked. autoconf insists on configuring the build with it, despite the --disable-pthread flag.

My long time response to this was *shrug* – Ruby seems fine. Until a weird production problem, unrepeatable on stage, where certain Rails stacks (those running in development mode to expose some aspect of the Globalize plugin to translators) crashed badly, with SIGBUS or SIGILL.

I came across this script:

$ ruby -e 'def d(x); p x; d x+1; end; d 0'

which exposes the problem perfectly. With a pthread’d Ruby it dumps core, with a no-thread Ruby it gracefully raises stack level too deep (SystemStackError)

More here


I discussed this on the FreeBSD ports list, discussion here.

Seems like the problem is on its way out.

Leave a Reply