XEN, Ruby Enterprise Edition and 4gb Seg Fixup

My new CentOS XEN server has a virtual machine which serves as a dedicated web server. The on the console and in /var/log/messages the following message appeared:

1
2
4gb seg fixup, process ruby (pid 20252), cs:ip 73:00e0a636
printk: 151939 messages suppressed.

The console is unusable, because every second a new message appears. The logfile is unusable as well, because it is very large and takes long to open in a text editor and interesting messages are difficult to find. After some google’ing I’ve found the following page with some instructions to fix it. I’ve mixed up various methods, but this is the most robust one to use. It creates a wrapper around the gcc and g++ binaries with the correct parameters.

1
2
3
4
5
6
7
8
mv /usr/bin/gcc /usr/bin/gcc.orig
mv /usr/bin/g++ /usr/bin/g++.orig
echo '#!/bin/sh' > /usr/bin/gcc
echo '#!/bin/sh' > /usr/bin/g++
echo 'exec gcc.orig -mno-tls-direct-seg-refs $@' >> /usr/bin/gcc
echo 'exec g++.orig -mno-tls-direct-seg-refs $@' >> /usr/bin/g++
chmod a+x /usr/bin/gcc
chmod a+x /usr/bin/g++

Extract the Ruby Enterprise Edition. Be careful to use a fresh extracted version to compile, because the files will not be recompiled. Compile and install Ruby Enterprise Edition as stated in the manual.

1
2
tar zxvf ruby-enterprise-1.8.7-2009.10.tar.gz
./ruby-enterprise-1.8.7-2009.10/installer

Don’t forget to reinstall passenger, and off course reinstall all the gems from the old installation.

Now you can restore gcc and g++ as this will probably break yum updates of gcc and g++.

1
2
rm -rf /usr/bin/gcc && mv /usr/bin/gcc.orig /usr/bin/gcc
rm -rf /usr/bin/g++ && mv /usr/bin/g++.orig /usr/bin/g++

Hopefully I’ve saved you guys some time ;-)

Comments

Copyright © 2013 - Tom Pesman - Powered by Octopress