# Segmentation fault with Ruby 1.8.6-p111 on 64bit Linux

**URL:** <https://www.ruby-forum.com/t/segmentation-fault-with-ruby-1-8-6-p111-on-64bit-linux/126994>\
**Category:** Rails\
**Created:** [January 23, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/segmentation-fault-with-ruby-1-8-6-p111-on-64bit-linux/126994 "2008-01-23T23:56:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 23, 2008, 11:56pm UTC](https://www.ruby-forum.com/t/segmentation-fault-with-ruby-1-8-6-p111-on-64bit-linux/126994/1 "2008-01-23T23:56:17Z")

</div>

I apologize to anyone who just caught me cross-posting, it’s urgent.

I’m having issues getting a Rails app to run on a new 64bit Linux box.  
The app has been working fine for some time on an older 32bit machine  
that’s being decommissioned soon.

Here’s the error:

/usr/local/lib/ruby/1.8/pstore.rb:354: [BUG] Segmentation fault  
ruby 1.8.6 (2007-09-24) [x86\_64-linux]

It occurs on the first request to the Rails app, every time.

The Linux distro is RedHat 5. It came with Ruby 1.8.5. I compiled a  
new 1.8.6-p111, reinstalled all the gems, but I’m still getting the  
same error.

Anyone know how to fix this? Ruby 1.9?

Thanks,

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 25, 2008, 10:00am UTC](https://www.ruby-forum.com/t/segmentation-fault-with-ruby-1-8-6-p111-on-64bit-linux/126994/2 "2008-01-25T10:00:51Z")

</div>

Not an expert on this at al, but I have fought with other things  
crashing over the years

Can you start the Rails console? Can you run Ruby on a simple script  
(create an empty file and just try running it)?

If you can, try and find out what command is giving you the error and  
look at the ‘C’ code surrounding it. Maybe even start up a gdb session  
and do some digging.

The other thing it _may_ be is that you are linking to a 32-bit shared  
library somewhere. I don’t know enough about your environment to  
comment but try looking on groups for segmentation faults on your  
distro, not just Ruby, it might point you in the right direction.

HTH

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 25, 2008, 11:16pm UTC](https://www.ruby-forum.com/t/segmentation-fault-with-ruby-1-8-6-p111-on-64bit-linux/126994/3 "2008-01-25T23:16:27Z")

</div>

On 1/25/08, ghoti [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Not an expert on this at al, but I have fought with other things  
> crashing over the years
> 
> Can you start the Rails console? Can you run Ruby on a simple script  
> (create an empty file and just try running it)?

I finally found a work-around last night. The problem turned out be  
my least favourite chunk of code on the planet, the ruby-oci8 driver.

I was doing a bunch of collection inserts at once, stuff that I was  
previously letting build up in a session because I didn’t want to  
insert it until after I had it’s connecting data inserted. I reworked  
my code to do the inserts one at a time and that seems to work with no  
segfaults:

The bad code:

@foo.bars = session[:bars]

became something like

session[:bars].each do |b|  
bar = Bar.find(b)  
@foo.bars \<\< bar  
end

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)
