Forum: Ruby on Rails segmentation fault from mysql_adapter.rb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Divya M. (Guest)
on 2009-03-19 09:27
(Received via mailing list)
Hello, I'm a rails newbie.

I wrote a simple application to navigate between 2 pages. This is my
controller file
---------------------------------------------------------------
class SayController < ApplicationController

def hello
end

def gudbye
end

end
--------------------------------------------------------------

I have 2 rhtml files in views/say folder hello.rhtml & gudbye.rhtml

hello.rhtml contains a line <%= link_to "Logout", :action => "gudbye"
%>

Similarly, gudbye.rhtml contains <%= link_to "Go Back", :action=>
"hello" %>

Then,
---------------------------------------------------------------------------------------
demo>ruby script/server
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
--------------------------------------------------------------------------------------

This much is working fine.
When I go to http://localhost:3000/say/hello in browser, my hello page
is getting displayed.

The problem is that at random times, I get a segmentation fault, when
I click the link (to either hello or gudbye page)
-------------------------------------------------------------------------------------------------------------------------------------
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/ lib/ active_record/
connection_adapters/ mysql_adapter.rb:202: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [i386-mswin32]

This application has requested the Runtime to terminate it in an
unusual way.

Please contact the application's support team for more information.

demo>
-------------------------------------------------------------------------------------------------------------------------------------

This happens only at random times, sometimes the two links work fine,
sometimes it do not.

Can some one please help me.
Nicklas H. (Guest)
on 2009-03-30 13:17
I'm getting this error message as well every morning when I'm back at
work. I suppose monit could be of help here if I wasn't running in a
Windows environment.

/Nicklas

Divya M. wrote:
> The problem is that at random times, I get a segmentation fault, when
> I click the link (to either hello or gudbye page)
> 
-------------------------------------------------------------------------------------------------------------------------------------
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/ lib/ active_record/
> connection_adapters/ mysql_adapter.rb:202: [BUG] Segmentation fault
> ruby 1.8.6 (2007-09-24) [i386-mswin32]
>
> This application has requested the Runtime to terminate it in an
> unusual way.
>
> Please contact the application's support team for more information.
>
> demo>
> 
-------------------------------------------------------------------------------------------------------------------------------------
>
> This happens only at random times, sometimes the two links work fine,
> sometimes it do not.
>
> Can some one please help me.
adedip (Guest)
on 2009-04-16 22:29
(Received via mailing list)
Solved in any way!? I got the same problem..

On Mar 30, 11:17 am, Nicklas H. <removed_email_address@domain.invalid>
Divya M. (Guest)
on 2009-04-17 12:00
Not yet solved. :(
adedip (Guest)
on 2009-04-17 13:23
(Received via mailing list)
Do you guys think that is a webserver problem? I mean switching from
webrick to something else .. would I solve it?

On Apr 17, 10:00 am, Divya M. <removed_email_address@domain.invalid>
Nicklas H. (Guest)
on 2009-04-20 18:36
adedip wrote:
> Do you guys think that is a webserver problem? I mean switching from
> webrick to something else .. would I solve it?
>
> On Apr 17, 10:00�am, Divya M. <removed_email_address@domain.invalid>

I am using Mongrel, so switching to that won't help. This is totaly
driving me crazy.
Drew (Guest)
on 2009-04-21 01:09
(Received via mailing list)
Im having the same problem too, im getting it on that tutorial for
creating your own blog, when I try and submit the form the ruby server
crashes and I get the same error.

MYSQL Problem?



On Apr 20, 10:36 am, Nicklas H. <removed_email_address@domain.invalid>
Nicklas H. (Guest)
on 2009-04-21 10:19
Drew wrote:
> Im having the same problem too, im getting it on that tutorial for
> creating your own blog, when I try and submit the form the ruby server
> crashes and I get the same error.
>
> MYSQL Problem?
>
>
>
> On Apr 20, 10:36�am, Nicklas H. <removed_email_address@domain.invalid>

Could it be some kind of timeout between MySQL and web server?
Zie (Guest)
on 2009-04-21 18:43
(Received via mailing list)
There is really easy way to test if it's a time out issue. Simply
create a action in your controller that queries the database.
Something as simple as User.find(:first). Setup a cron on either your
server or local maching to call that method (ie curl mystite.com/
active ) once a minute or whatever your connection timeout is set in
mysql. Wake up tomorrow, if you see an error.

Other stuff to look into:
Double check that mysql gem is installed.
Check your mysql timeout:
http://www.issociate.de/board/goto/847434/Persista...

Really version 2+ of rails shouldn't really have this problem




On Apr 21, 2:19 am, Nicklas H. <removed_email_address@domain.invalid>
Gregg H. (Guest)
on 2009-05-04 20:16
Divya M. wrote:

> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/ lib/ active_record/
> connection_adapters/ mysql_adapter.rb:202: [BUG] Segmentation fault
> ruby 1.8.6 (2007-09-24) [i386-mswin32]
>
> This application has requested the Runtime to terminate it in an
> unusual way.
>
> Please contact the application's support team for more information.
>
> demo>
>


I am getting this same problem.  I am getting it after setting up a new
dev environment on a windows machine.  I first saw it in RubyMine (IDE),
when I went to the Tools->Rake Tasks->db->create->all  command.  I got
this as the output:

C:\Ruby\bin\ruby.exe -e
STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) C:\Ruby\bin/rake
db:create:all
(in H:/projects/DMS)
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:202:
[BUG] Segmentation fault
ruby 1.8.6 (2008-08-11) [i386-mswin32]


This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.

Process finished with exit code 3
E. Litwin (Guest)
on 2009-05-04 20:33
(Received via mailing list)
What version of MySQL is everybody (that is having this problem)
running?

I tried upgrading to 5.1 a while back and couldn't get Rails
(ActiveRecord) to even work with it.
I downgraded back to 5.0.x and everything worked fine again. I haven't
tried going to 5.1 again.

On May 4, 9:16 am, "Gregg H." <removed_email_address@domain.invalid>
Gregg H. (Guest)
on 2009-05-04 21:19
E. Litwin wrote:
> What version of MySQL is everybody (that is having this problem)
> running?
>
> I tried upgrading to 5.1 a while back and couldn't get Rails
> (ActiveRecord) to even work with it.
> I downgraded back to 5.0.x and everything worked fine again. I haven't
> tried going to 5.1 again.
>
> On May 4, 9:16�am, "Gregg H." <removed_email_address@domain.invalid>

I am running the latest 5.1 downloaded from
http://dev.mysql.com/downloads/mysql/5.1.html#downloads

The strange thing is using the rake task for drop all works.  And just
as another sidenote, the create all task that seg faults for me does
actually make the databases.  I just dont know where it dies.
Gregg H. (Guest)
on 2009-05-08 00:11
I am also getting this, which I believe is related to the same problem:

==  InitialStructureAndData: migrating
========================================
-- create_table("areas", {:force=>true})
rake aborted!
An error has occurred, all later migrations canceled:

undefined method `each' for #<Mysql:0x4007ff4>

(See full trace by running task with --trace)
Gregg H. (Guest)
on 2009-05-08 00:58
Gregg H. wrote:
> I am also getting this, which I believe is related to the same problem:
>
> ==  InitialStructureAndData: migrating
> ========================================
> -- create_table("areas", {:force=>true})
> rake aborted!
> An error has occurred, all later migrations canceled:
>
> undefined method `each' for #<Mysql:0x4007ff4>
>
> (See full trace by running task with --trace)

Fixed the problem.  This solves both of my errors:

http://forums.aptana.com/viewtopic.php?f=20&t=7563...
Vicky T (Guest)
on 2009-07-03 18:42
(Received via mailing list)
The help at the aptana site fixed both my strange problems.  Thanks so
much.  I was looking into changing to Mongrel/Apache to fix them.

One problem was when doing a find method on an ActiveRecord , ie
Contact.find(1), it would get a seg fault . Contact.save would work
fine and everything was getting to the MySQL db when I used ruby
console.  I'm working my way through the Ruby on Rails Bible by
Timothy Fisher and it was very frustrating when simple examples did
not work but enough worked that I didn't suspect my installation.

The solution from the aptera site was to install a MySQL 5.0 dll
( libmsql.dll )in place of the 5.1 one.  When I looked in the ruby/bin
directory it wasn't even there.   Copying that file over (and
restarting webrick, MySQL server  & console) did the trick. I  thought
I had installed the mysql gem but I'm new to RoR so I certainly could
have messed up somewhere.  It also fixed my strange problem where
trying to view
pages would crash Webrick.

I am using MySQL 5.0 but I do have 5.1 installed.

On May 7, 1:58 pm, "Gregg H." <removed_email_address@domain.invalid>
Patrick A. (Guest)
on 2010-08-03 23:09
Divya M. wrote:
> Not yet solved. :(


I had a simular problem (i am also newbie)
for me it was solved by adding "host: localhost" in the
config/database.yml file

Hope it can help some others to..

grtz,
patrick
This topic is locked and can not be replied to.