When running a rails app using webrick or mongrel, I can load any given page (involving a controller) once, and any subsequent page loads trigger a "Segmentation fault" without any other info. If I use ruby18_with_gems I get this: "/usr/bin/ruby: line 1: 11610 Segmentation fault RUBYOPT="-rubygems" /usr/bin/ruby18 "$@"" This problem is very new, and has only started occurring since I last updated my Gentoo linux system. It's not my application specifically; I've tried a creating a brand-new application which has the same problem. It's not all of ruby; instiki works just fine and so do basic, html-loading instances of webrick. The rails mailing list has not seen this occur. I did try recompiling ruby and reinstalling the rails gem (as well as activerecord, actionpack, actionmailer, actionwebservice, activesupport). I use ruby and rubygems from portage, but I use rails and associated packages from gems. I'm using ruby-1.8.4-r1 and rubygems-0.8.11. Neither are masked. (I have also tried rubygems-0.8.11-r3). I was loading ruby-mysql, but I have since disabled activerecord, and there has been no change in the problem. This is a list of the packages I emerged just before this problem started: sys-apps/sed-4.1.4-r1 sys-apps/man-pages-2.22 app-crypt/hashalot-0.3-r2 virtual/perl-Test-Simple-0.62 app-misc/pax-utils-0.1.9 sys-apps/baselayout-1.11.14-r5 dev-libs/openssl-0.9.7i virtual/perl-Storable-2.15 app-crypt/gnupg-1.4.2.1 media-libs/imlib2-1.2.1.009 virtual/perl-libnet-1.19 virtual/perl-Digest-MD5-2.33 virtual/perl-MIME-Base64-3.05 virtual/perl-digest-base-1.13 app-admin/eselect-1.0 sys-apps/eject-2.1.0-r1 sys-power/acpid-1.0.4-r3 x11-libs/openmotif-2.2.3-r9 media-libs/lcms-1.14-r1 x11-wm/enlightenment-0.16.8 dev-libs/nspr-4.6.1-r2 sys-apps/usbutils-0.71-r1 media-gfx/imagemagick-6.2.5.5 dev-libs/gmp-4.1.4-r3 app-vim/gentoo-syntax-20051221 www-client/links-2.1_pre20 media-libs/id3lib-3.8.3-r4 x11-themes/gtk-engines-2.6.7 www-client/mozilla-launcher-1.45 net-dns/bind-tools-9.3.2 dev-libs/libtasn1-0.2.18 net-libs/gnutls-1.2.10 Portage 2.0.54 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, 2.6.13-gentoo-r3 i686) ================================================================= System uname: 2.6.13-gentoo-r3 i686 Intel(R) Pentium(R) M processor 1.86GHz Gentoo Base System version 1.6.14 dev-lang/python: 2.3.5-r2, 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i386-pc-linux-gnu" CFLAGS="-O2 -mcpu=i686" CHOST="i386-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=i686" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://gentoo.chem.wisc.edu/gentoo/ http://cudlug.cudenver.edu/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.us.gentoo.org/gentoo-portage" USE="x86 X aac aim alsa apache2 apm arts audiofile avi berkdb bitmap-fonts bonobo browserplugin bzip2 cdb cdparanoia cdr cli crypt cups curl dba directfb divx4linux dvd dvdr emboss encode esd ethereal exif expat fam firefox foomaticdb fortran gd gdbm gif glut gmp gnome gpm gstreamer gtk gtk2 gtkhtml idn imagemagick imap imlib jabber java javascript jpeg lcms ldap libg++ libwww mad maildir mhash mikmod mng motif mozdevelop mp3 mpeg mysql ncurses nls ogg oggvorbis opengl oracle oscar oss pam pcre pdflib perl php png python quicktime readline real ruby samba sasl sdk sdl soap spell ssl tcpd threads tiff truetype truetype-fonts type1-fonts udev usb vorbis wifi win32codecs xml xml2 xmms xpm xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
use ruby-config to change your default ruby back to ruby18 instead of ruby_with_gems.
I think ruby18_with_gems is cursed, and I need to remove it.
I've just added a rubygems -r4 package which I think helps with this, but I recommend not using ruby18_with_gems anymore.
(In reply to comment #3) > I've just added a rubygems -r4 package which I think helps with this, but I > recommend not using ruby18_with_gems anymore. I actually wasn't using ruby18_with_gems except briefly to see if it helped with the segfaults. It had no effect except to print slightly more information. I'll try the -r4 package as soon as I can find it.
The segfault happens in webrick/mongrel, right? Can you run webrick/mongrel in gdb and get a backtrace?
Created attachment 80449 [details] Stack trace of a segmentation fault
Problem still occurs. I added a stack trace of a crash with webrick. I also tried to emerge the -r4 rubygems in hopes that might help, but I constantly get a digest verification error. Could be my mirrors' fault, I suppose. Anyway, I doubt the problem is with rubygems, since the emerge which broke rails did not include a rubygems upgrade. I still have a nearly identical gentoo box which has not yet performed that emerge, and rails does not have this issue there.
Yikes! I'm a bit baffled by that. Can you re-emerge ruby with debug symbols (USE="debug") and try er again, so we'll get line numbers of the source in the stack trace. We may have to send it to the ruby-core folks..
Following the Gentoo instructions here (http://www.gentoo.org/doc/en/bugzilla-howto.xml) I generated a much more detailed backtrace, which I'm attaching here. It's interesting: the first thing it says is "rb_eval (self=7909646, n=0xb75c4ba8) at eval.c:2833 2833 eval.c: No such file or directory. in eval.c " That definitely sounds like useful information. Hopefully someone can understand it.
Created attachment 80561 [details] Debug ruby stack trace after segfault
to clarify, you're using ruby 1.8.4, right? (What does /usr/bin/ruby symlink point to?)
/usr/bin/ruby -> ruby18
I am going to commit a new ruby to portage - 1.8.4.20060226 which is a snapshot of 1.8.4 as of today. Can you try it out and see if it helps? Otherwise, I recommend submitting a bug report at rubyforge.org, as this looks to be happening in the ruby interpreter and seems to be a grave bug indeed.
(In reply to comment #13) > I am going to commit a new ruby to portage - 1.8.4.20060226 which is a snapshot > of 1.8.4 as of today. Can you try it out and see if it helps? Same problem. I've submitted a bug to rubyforge. Thanks for the help. http://rubyforge.org/tracker/index.php?func=detail&aid=3683&group_id=426&atid=1698
I tried using a newly compiled stable ruby release, and there was no change. However: I then noticed that running a rails application as another user on the same machine had no problems. I figured it couldn't possibly be permissions, so I started removing things from my home directory to see if it would help. Below is a list of files I removed and, somehow, removing them has solved the problem. Call me foolish perhaps for not trying this before, but it seems troubling that some rcfiles could cause ruby to segfault. I wondered if it was my .gem directory, but I think it was empty... 868 rm -rf .rbbr 869 rm -rf .rssowl/ 874 rm -rf .vmware 881 rm -rf .adesklets 882 rm -rf .audacity 883 rm -rf .crash_reportrc 888 rm -rf .fltk/ 892 rm -rf .gem/ 895 rm -rf .gstreamer-0.8/ 899 rm -rf .install4j 902 rm -rf .irbrc Thank you for the assistance!