James Waldrop
2005-Oct-15 17:40 UTC
mysql_adapter problem, segfault in list action, line 232
Hi there, I''m new to Ruby and Rails both and trying to track down a problem with MySQL and the mysql_adapter. It''s not the typical password hashing problem that I have found many references to online, however I am using MySQL 4.1.3, and probably will be moving to MySQL 5 shortly. I have installed Ruby 1.8.2, the latest production release of Rails (using gems) and updated my MySQL library (also using gems). I also have tried downloading and compiling the latest C MySQL/Ruby driver, just to make sure that I have the right stuff, with the same results. My developer.log has the following (with ansi escapes removed): Processing PlaceController#create (for 66.92.17.103 at Sat Oct 15 10:13:26 PDT 2005) Parameters: {"place"=>{"name"=>"This is some place", "description"=>"A place that would be nice to go to if only we could list it."}, "commit"=>"Create", "action"=>"create", "controller"=>"place"} Place Columns (0.008184) SHOW FIELDS FROM places Place Columns (0.006617) SHOW FIELDS FROM places SQL (0.000090) BEGIN SQL (0.053878) INSERT INTO places (`name`, `description`) VALUES(''This is some place'', ''A place that would be nice to go to if only we could list it.'') SQL (0.000099) COMMIT Redirected to http://host.name.com/place/list Completed in 0.10770 (9 reqs/sec) | DB: 0.06887 (63%) [http://host.name.com/place/create/] Processing PlaceController#list (for 66.92.17.103 at Sat Oct 15 10:13:28 PDT 2005) Parameters: {"action"=>"list", "controller"=>"place"} Place Count (0.008895) SELECT COUNT(*) FROM places EOF I include the create log simply to show that I am in fact able to access the database successfully. The data is there, but it cannot be listed from mysql_adapter (listing it in other clients work fine). Other attempts to list using Place.find_all also fail in exactly the same way. The Apache error log contains: [Sat Oct 15 10:13:28 2005] [error] [client 66.92.17.103] /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:232: [BUG] Segmentation fault, referer: http://host.name.com/place/new I''ve looked at the Subversion repository for mysql_adapter.rb, trying to see if there''s something new there that might help. I was getting this same error trying to list tables/models with nothing in them, but once I incorporated the null checking that is in the latest revision those went away. However, listing a table that has data gives this same error. Since then I''ve reverted to the current production revision of the file, so as to have a clean base against which to apply any suggestions I receive from this list. I found exactly one bug filed by someone who was having this same problem. However, their solution seemed to be related to the fact that they had multiple versions of MySQL installed and Ruby was linking against the wrong libs. I only have one version of MySQL installed as far as I can tell, and when I hand-installed the Mysql/Ruby C driver I made sure to point it at /var/lib/mysql, where my libs live. So, this problem seems to differ in some non-obvious way. One last, potentially relevant, detail is that I''m running RedHat Linux 3.2.3-26, and Ruby was compiled with gcc 3.2.3 using the typical configure; make; make install cycle. TIA for any help you can provide, James