ruby 1.8.4 + mod_ruby = "undefined symbol: pthread_create"?

Alexander Wittig alexander at wittig.name
Sun Jan 15 05:05:37 PST 2006


Hi all

Thanks Pav for importing ruby 1.8.4 into the ports tree. Looks like 
things are going fairly well, my production systems still work after 
portupgrade -a :-)
However there has been one problem with mod_ruby: It does not load any 
more with apache20. I reinstalled everything (www/mod_ruby, 
textproc/eruby, lang/ruby18) but it still doesn't work. Error message 
from apache:

[root at hotzenplotz:/data/apache/wittig.name/alex]apachectl -DSSL -k restart
Syntax error on line 122 of /usr/local/etc/apache2/httpd.conf:
Cannot load /usr/local/libexec/apache2/mod_ruby.so into server: 
/usr/local/lib/libruby18.so.18: Undefined symbol "pthread_create"

This only happens on FBSD 6, FBSD 4 is not affected. I assume this is 
because apache is not built with -pthreads while rubylib is (at least on 
FBSD >= 5). The workaround I use is to load libpthread into apache from 
httpd.conf:

LoadFile /usr/lib/libpthread.so
LoadModule ruby_module   libexec/apache2/mod_ruby.so

After this the module loads and rhtml files are parsed correctly. I did 
not test the threading though, because I don't have any ruby code using it.
Could one of the pthreads gurus comment on this procedure? Is this a 
clean solution or just an ugly, error-prone hack? If the first: There 
should be a note included in www/mod_ruby/pkg_message and 
http.conf.mod_ruby should probably include the LoadFile, too. If the 
latter: What has to be done to make things work again? I do not recall 
having this problem with ruby 1.8.2.

Alexander


More information about the freebsd-ports mailing list