# Segmentation fault on page requests

**URL:** <https://www.ruby-forum.com/t/segmentation-fault-on-page-requests/61133>\
**Category:** Rails\
**Created:** [May 20, 2006, 7:01pm UTC](https://www.ruby-forum.com/t/segmentation-fault-on-page-requests/61133 "2006-05-20T19:01:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cody\_Caughlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dec6dc/32.png) [@Cody\_Caughlan](https://www.ruby-forum.com/u/Cody_Caughlan)\
**Post date:** [May 20, 2006, 7:01pm UTC](https://www.ruby-forum.com/t/segmentation-fault-on-page-requests/61133/1 "2006-05-20T19:01:22Z")

</div>

Hi,

I am new to Rails and got the “Agile Web Dev with Rails book”,  
following along with the examples…starting the Depot sample app, but  
am running into segmentation faults and my WEBrick console looks like  
this:

http://127.0.0.1:3000/admin/ -\> /admin/show/1 c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller ration.rb:45: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [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.

The core Ruby/Rails distribution source file that throws this error is  
not always the same (e.g my console says it has also been thrown by  
“c:/ruby/lib/ruby/1.8/webrick/accesslog.rb:51:”)

It doesnt always happen in the same action. Sometimes when I “Edit” a  
product, sometimes when I just cancel an edit or sometimes just doing  
a basic list action. It doesnt happen _every_ time, somewhere around  
50%.

I did a search for “segmentation fault” on this list and I can see  
that others have experienced issues similar to this.

Environment: Windows 2000

- Ruby: 1.8.2
- MySQL 5.0.16 on a separate Linux machine
- latest Rails (1.1.2)
- MySQL bindings retrieved via “gem install mysql” and then choosing  
Option 1( mysql 2.7.2006.05.10 (mswin32)" (I also tried a slightly  
dated version “mysql 2.7.2006.04.21”, same result…

Thanks in advance  
/Cody  
Thanks!

---

<div class="post-metadata">

**Author:** ![Cody\_Caughlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dec6dc/32.png) [@Cody\_Caughlan](https://www.ruby-forum.com/u/Cody_Caughlan)\
**Post date:** [May 20, 2006, 7:22pm UTC](https://www.ruby-forum.com/t/segmentation-fault-on-page-requests/61133/2 "2006-05-20T19:22:39Z")

</div>

Hi Cody,

Cody Caughlan wrote:

> I am new to Rails and got the “Agile Web Dev with Rails book”, following  
> along with the examples…starting the Depot sample app,  
> but am running into segmentation faults and my WEBrick console looks like  
> this:

Don’t know for sure if this is your problem, but…

One source of segmentation faults has been traced to an incompatibility  
with  
the compiled MySQL driver on Win2K (both a patch and a permanent fix are  
“in  
the works”). The quick workaround is to eliminate the compiled driver  
and  
let Rails pick up the native Ruby version (which it will automatically).  
Try renaming /ruby/lib/ruby/site\_ruby/1.8/i386-msvcrt/mysql.so to  
something  
(like mysql.sob 😉 ) and see if that helps.

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![Cody\_Caughlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dec6dc/32.png) [@Cody\_Caughlan](https://www.ruby-forum.com/u/Cody_Caughlan)\
**Post date:** [May 20, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/segmentation-fault-on-page-requests/61133/3 "2006-05-20T19:25:47Z")

</div>

Bill-

Thanks for the advice. Unfortunately, it did not work. Same seg fault  
message after my 3rd page request 🙂

/Cody

---

<div class="post-metadata">

**Author:** ![Cody\_Caughlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dec6dc/32.png) [@Cody\_Caughlan](https://www.ruby-forum.com/u/Cody_Caughlan)\
**Post date:** [May 21, 2006, 3:40pm UTC](https://www.ruby-forum.com/t/segmentation-fault-on-page-requests/61133/4 "2006-05-21T15:40:02Z")

</div>

I had this same problem, and I’m still waiting for a fix. When’s that  
patch coming out?

---

<div class="post-metadata">

**Author:** ![Cody\_Caughlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dec6dc/32.png) [@Cody\_Caughlan](https://www.ruby-forum.com/u/Cody_Caughlan)\
**Post date:** [May 21, 2006, 7:12pm UTC](https://www.ruby-forum.com/t/segmentation-fault-on-page-requests/61133/5 "2006-05-21T19:12:42Z")

</div>

Hi Cody,

Cody Caughlan wrote:

> Thanks for the advice. Unfortunately, it did not work. Same seg fault  
> message after my 3rd page request 🙂

Sorry to hear that. I was hopeful but had my doubts given that you’re  
running MySQL on a seperate box. So…

I’m going to forward your initial posting to the developers who are  
working  
on the driver problem. With a little luck, they may see your problem as  
an  
opportunity 😉

As far as getting you going in the short term, if your situation allows,  
I’d  
recommend using a local version of MySQL for now. My earlier  
recommendation  
will definitely allow you to move forward with working through the AWD  
book.  
The least painful way to proceed, in my experience, is to use Instant  
Rails  
in the short term. It provides a standalone environment that’s there  
when  
you need it but not ‘integrated’ into the rest of your environment so  
there’s very little opportunity for conflict.

You can pick it up here: [http://instantrails.rubyforge.org/wiki/wiki.pl](http://instantrails.rubyforge.org/wiki/wiki.pl)

The 1.3a release uses the pure Ruby adapter which is what you’d want.

HTH,  
Bill
