# Illegal instruction on FreeBSD 6.2 with Rails 2.0

**URL:** <https://www.ruby-forum.com/t/illegal-instruction-on-freebsd-6-2-with-rails-2-0/135427>\
**Category:** Rails\
**Created:** [April 22, 2008, 3:05am UTC](https://www.ruby-forum.com/t/illegal-instruction-on-freebsd-6-2-with-rails-2-0/135427 "2008-04-22T03:05:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjmadsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Post date:** [April 22, 2008, 3:05am UTC](https://www.ruby-forum.com/t/illegal-instruction-on-freebsd-6-2-with-rails-2-0/135427/1 "2008-04-22T03:05:47Z")

</div>

I’m upgrading an existing application from Rails 1.2 to 2.0. After  
deploying the new application to a production FreeBSD 6.2 server, I  
can’t do anything without an illegal instruction trap (SIGILL). Even  
a basic Model.find(:all) on a small table from script/console traps.  
Googling points to a stack overflow as the likely culprit (too many  
nested method calls).

The application works fine in development on another OS and no changes  
were made that would explain a deeper call stack.

Has anyone deployed a Rails 2.0 application on FreeBSD 6.2? Has  
anyone successfully upgraded a working application from 1.2 to 2.0?

–  
Steve M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Light Year Software, LLC [http://lightyearsoftware.com](http://lightyearsoftware.com)  
ZingLists: Stay organized, and share lists online. [http://zinglists.com](http://zinglists.com)

---

<div class="post-metadata">

**Author:** ![sjmadsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Post date:** [April 22, 2008, 4:25am UTC](https://www.ruby-forum.com/t/illegal-instruction-on-freebsd-6-2-with-rails-2-0/135427/2 "2008-04-22T04:25:33Z")

</div>

Steve M. wrote:

> I’m upgrading an existing application from Rails 1.2 to 2.0. After  
> deploying the new application to a production FreeBSD 6.2 server, I  
> can’t do anything without an illegal instruction trap (SIGILL). Even  
> a basic Model.find(:all) on a small table from script/console traps.  
> Googling points to a stack overflow as the likely culprit (too many  
> nested method calls).
> 
> The application works fine in development on another OS and no changes  
> were made that would explain a deeper call stack.
> 
> Has anyone deployed a Rails 2.0 application on FreeBSD 6.2? Has  
> anyone successfully upgraded a working application from 1.2 to 2.0?

Might we see the entire model code?

---

<div class="post-metadata">

**Author:** ![sjmadsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Post date:** [April 22, 2008, 8:38am UTC](https://www.ruby-forum.com/t/illegal-instruction-on-freebsd-6-2-with-rails-2-0/135427/3 "2008-04-22T08:38:44Z")

</div>

James B. wrote:

> > Has anyone deployed a Rails 2.0 application on FreeBSD 6.2? Has  
> > anyone successfully upgraded a working application from 1.2 to 2.0?

Just to reasure you, I’ve had rails 2.0 apps running for quite some time  
on FreeBSD 6.2, 6.3 and 7.0 (32 and 64 bit) with no problem whatsoever.

We would need to see the code you suspect is wrong to know anymore. A  
stack overflow _might_ give this error, but an illegal instruction may  
equally be a fault in a compiled library (or ruby itself). I assume you  
built everything from ports and you have them all up to date?

Either that or you have a hardware problem. Faulty memory would  
potentially give this error too. Running a memory checker (and HD check)  
wouldn’t do any harm…

Cheers,  
Gary.

---

<div class="post-metadata">

**Author:** ![sjmadsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@sjmadsen](https://www.ruby-forum.com/u/sjmadsen)\
**Post date:** [April 22, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/illegal-instruction-on-freebsd-6-2-with-rails-2-0/135427/4 "2008-04-22T16:57:48Z")

</div>

On Apr 22, 2:37 am, Gary D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Just to reasure you, I’ve had rails 2.0 apps running for quite some time  
> on FreeBSD 6.2, 6.3 and 7.0 (32 and 64 bit) with no problem whatsoever.

Thanks for the reassurance that FreeBSD is fine. I took another look  
at things and was able to fairly quickly find the problem. It was an  
infinite recursion corner case, which I now have a regression test for  
and have fixed. So it was a stack overflow and not a hardware issue.

Interestingly enough, while my production server is a less powerful  
machine than my development machine, it fails far quicker. My  
regression test will happily run for minutes, which is enough of a red  
flag that I’ll notice something is not right. Too bad Test::Unit  
doesn’t provide a “this block shouldn’t run for X seconds” assertion.

–  
Steve M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Light Year Software, LLC [http://lightyearsoftware.com](http://lightyearsoftware.com)  
ZingLists: Stay organized, and share lists online. [http://zinglists.com](http://zinglists.com)
