From: Trevor Wennblom Date: 2007-10-06T00:48:01+09:00 Subject: Solaris, FastCGI, Apache, and "timeout.rb:52: [BUG] Segmentation fault" --Apple-Mail-15-691186513 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Just installed Ruby 1.8.6-p110. There seems to be a bug related to net/http, FastCGI, and Apache (1 or 2). I'm seeing this with a Rails- based application that has no problems with Mongrel, Webrick, Lighttpd, or Apache/CGI. This is on a Solaris environment, Ruby compiled with GCC. % uname -a SunOS club 5.10 Generic_118822-08 sun4u sparc SUNW,Sun-Fire-V440 % gcc -v Using built-in specs. Target: sparc-sun-solaris2.10 Configured with: ../configure --enable-threads=posix --disable-nls -- with-ld=/usr/ccs/bin/ld --with-as=/usr/ccs/bin/as --enable-shared -- enable-languages=c,c++,objc,fortran --disable-libgcj Thread model: posix gcc version 4.1.2 I've attempted Ruby 1.8.6-p110 and the stable nightly, both with these parameters: ./configure --disable-pthread --disable-fastthread or ./configure --enable-pthread --enable-fastthread This is what appears in the Apache error_log: /usr/local/lib/ruby/1.8/timeout.rb:52: [BUG] Segmentation fault ruby 1.8.6 (2007-10-02) [sparc-solaris2.10] This is what appears in the Apache site log: [(time)] [error] [client (ip)] FastCGI: incomplete headers (0 bytes) received from server "/mysite/public/dispatch.fcgi" There are no errors in the Rails fastcgi.crash.log or development.log Here is the code that triggers the error, specifically the line "x.request( a )" - class PostsController < ApplicationController # GET /posts # GET /posts.xml def index require 'net/http' http = Net::HTTP.new("google.com", 80) http.start { |x| a = Net::HTTP::Get.new("/") x.request( a ) } end end Everything worked fine in Ruby 1.8.4. Any help would be appreciated. - To followup I've installed several of the Sunfreeware Ruby packages to narrow down the problem.[1] The basic steps each attempt: - Remove the local/lib/ruby directory - pkgrm - pkgadd - Install RubyGems - gem update - gem install rake - gem install rails - gem install fcgi - Restart Apache (2 in this case) - /usr/bin/pkill -USR1 dispatch.fcgi - Test page, look for error The error is present with: ruby-1.8.5p2-sol10-sparc-local ruby-1.8.6-sol10-sparc-local The error is NOT present with: ruby-1.8.4-sol10-sparc-local I really don't have the smarts to say if this is directly caused by Ruby or how the fcgi (FastCGI - fcgi.so) gem interacts with Ruby. [1]: ftp://ftp.sunfreeware.com/pub/freeware/sparc/10/ --Apple-Mail-15-691186513--