ActiveRecord Seg Fault

Dean Karres
Thu, 28 Jul 2005 21:59:38 -0000

Hi,

I''m brand new to Ruby and Rails and was following the Rolling With
Ruby on Rails example.

I am running Apache 1.3,x
Ruby 1.8.2
activerecord-1.11.1
MySql 4.1.x
Red Hat Enterprise 3

Rails was installed through gems in the last week.


In the tutorial mentioned above you build a DB table and note the
scaffold and should then be able to Add, List, ...  records.  I can
Add records with no problem.  It is once I add the record and the
rails stuff tries to go to "list" the result that thnigs fail.

The obvious part is the resulting error page that says

    Rails application failed to start properly

I start digging throug various Rails and server logs and find this
in a server error log:


[Thu Jul 28 15:22:51 2005] [error] [client 130.126.126.243] Premature end of
script headers: dispatch.cgi
[Thu Jul 28 15:25:01 2005] [error] [client 130.126.126.243]
/usr/local/encap/ruby-1.8.2/lib/usr/local/encap/ruby-1.8.2/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/
connection_adapters/mysql_adapter.rb:232: [BUG] Segmentation fault
[Thu Jul 28 15:25:01 2005] [error] [client 130.126.126.243] ruby 1.8.2
(2004-12-25) [i686-linux]


Based on some things I have seen on-line -- the dispatch* scripts
are all executable (don''t forget that the "Add" record part
is working)

Don''t sweat the "/usr/local/encap/ruby-1.8.2/lib/..." bit in
the
executable path.  We are using a package managment tool called "encap"
to handle third-party product installs.  Plus, again, the Add record
part is working but the List part is not.

My sample app is actually simpler than the tutorial app.  the table
I have created is

CREATE TABLE products (
  id int(10) unsigned NOT NULL auto_increment,
  name varchar(64) NOT NULL default '''',
  PRIMARY KEY  (id),
  UNIQUE KEY name (name)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Dean...K...

--
        Dean Karres / karres at itg dot uiuc dot edu / www.itg.uiuc.edu

                  Imaging Technology Group / Beckman Institute
                             University of Illinois
                    405 North Mathews / Urbana, IL 61801 USA