# Lots of seg faults

**URL:** <https://www.ruby-forum.com/t/lots-of-seg-faults/126052>\
**Category:** Ruby\
**Created:** [January 15, 2008, 3:09am UTC](https://www.ruby-forum.com/t/lots-of-seg-faults/126052 "2008-01-15T03:09:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottbrisko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scottbrisko](https://www.ruby-forum.com/u/scottbrisko)\
**Post date:** [January 15, 2008, 3:09am UTC](https://www.ruby-forum.com/t/lots-of-seg-faults/126052/1 "2008-01-15T03:09:46Z")

</div>

Anyone care go guess what’s going on here?

This started happening out of the blue. I’ve since updated Ruby but  
still get “[BUG] Segmentation fault” on most operations involving ruby,  
gem, rake, etc.

This is just an example, most every usage of gem or rake will do this.  
They fail repeatedly until they work:

* * *

[xserve:/var/www/rails] admin% sudo gem install chronic  
Password:  
Updating metadata for 80 gems from [http://gems.rubyforge.org](http://gems.rubyforge.org)  
…  
complete  
Successfully installed rubyforge-0.4.4  
Successfully installed hoe-1.4.0  
Successfully installed chronic-0.2.3  
3 gems installed  
Installing ri documentation for rubyforge-0.4.4…  
/usr/local/lib/ruby/1.8/rdoc/parsers/parse\_rb.rb:489: [BUG] Segmentation  
fault  
ruby 1.8.6 (2007-09-24) [powerpc-darwin8.11.0]

Abort  
[xserve:/var/www/rails] admin% sudo gem install chronic  
Successfully installed chronic-0.2.3  
1 gem installed  
Installing ri documentation for chronic-0.2.3…  
/usr/local/lib/ruby/1.8/irb/slex.rb:72: [BUG] Segmentation fault  
ruby 1.8.6 (2007-09-24) [powerpc-darwin8.11.0]

Abort  
[xserve:/var/www/rails] admin% sudo gem install chronic  
Successfully installed chronic-0.2.3  
1 gem installed  
Installing ri documentation for chronic-0.2.3…  
/usr/local/lib/ruby/1.8/irb/slex.rb:76: [BUG] Segmentation fault  
ruby 1.8.6 (2007-09-24) [powerpc-darwin8.11.0]

Abort  
[xserve:/var/www/rails] admin% sudo gem install chronic  
Successfully installed chronic-0.2.3  
1 gem installed  
Installing ri documentation for chronic-0.2.3…  
/usr/local/lib/ruby/1.8/rdoc/parsers/parse\_rb.rb:1477: [BUG]  
Segmentation fault  
ruby 1.8.6 (2007-09-24) [powerpc-darwin8.11.0]

Abort  
[xserve:/var/www/rails] admin% sudo gem install chronic  
Successfully installed chronic-0.2.3  
1 gem installed  
Installing ri documentation for chronic-0.2.3…  
/usr/local/lib/ruby/1.8/rdoc/parsers/parse\_rb.rb:384: [BUG] Segmentation  
fault  
ruby 1.8.6 (2007-09-24) [powerpc-darwin8.11.0]

Abort  
[xserve:/var/www/rails] admin% sudo gem install chronic  
Successfully installed chronic-0.2.3  
1 gem installed  
Installing ri documentation for chronic-0.2.3…  
Installing RDoc documentation for chronic-0.2.3…  
/usr/local/lib/ruby/1.8/rdoc/parsers/parse\_rb.rb:122: [BUG] Segmentation  
fault  
ruby 1.8.6 (2007-09-24) [powerpc-darwin8.11.0]

Abort  
[xserve:/var/www/rails] admin% sudo gem install chronic  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/source\_index.rb:228: [BUG]  
Segmentation fault  
ruby 1.8.6 (2007-09-24) [powerpc-darwin8.11.0]

Abort  
[xserve:/var/www/rails] admin% sudo gem install chronic  
Successfully installed chronic-0.2.3  
1 gem installed  
Installing ri documentation for chronic-0.2.3…  
Installing RDoc documentation for chronic-0.2.3…  
[xserve:/var/www/rails] admin%

* * *

Thanks in advance

---

<div class="post-metadata">

**Author:** ![scottbrisko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scottbrisko](https://www.ruby-forum.com/u/scottbrisko)\
**Post date:** [January 15, 2008, 3:17am UTC](https://www.ruby-forum.com/t/lots-of-seg-faults/126052/2 "2008-01-15T03:17:13Z")

</div>

Hello –

On 15/01/2008, Scott B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Anyone care go guess what’s going on here?
> 
> This started happening out of the blue. I’ve since updated Ruby but  
> still get “[BUG] Segmentation fault” on most operations involving ruby,  
> gem, rake, etc.
> 
> This is just an example, most every usage of gem or rake will do this.  
> They fail repeatedly until they work:

Anything else segfaulting? Might be faulty memory – see memtest86  
and friends. If you set:

ulimit -c unlimited

Can you get a backtrace from the resulting corefile created via gdb?

– Thomas A.

---

<div class="post-metadata">

**Author:** ![scottbrisko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scottbrisko](https://www.ruby-forum.com/u/scottbrisko)\
**Post date:** [January 15, 2008, 4:33am UTC](https://www.ruby-forum.com/t/lots-of-seg-faults/126052/3 "2008-01-15T04:33:13Z")

</div>

- Scott B. (removed\_email\_address@domain.invalid) wrote:

> “Cannot access memory” looks suspiciously like bad RAM…

No, that just means the value on the stack isn’t a valid memory address  
for the process; that, plus the NULLs and the duplicated values in the  
backtrace suggest, as gdb says, corrupt stack. The behavior does look  
like bad RAM, though.

> Unfortunately I don’t have memtest on this box.

[Memtest86+ on Intel Mac](http://matt.ucc.asn.au/memtest/) any use?

---

<div class="post-metadata">

**Author:** ![scottbrisko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scottbrisko](https://www.ruby-forum.com/u/scottbrisko)\
**Post date:** [February 23, 2008, 2:07am UTC](https://www.ruby-forum.com/t/lots-of-seg-faults/126052/4 "2008-02-23T02:07:07Z")

</div>

i am having the same problem. was a solution found? did it turn out to  
be faulty memory?

---

<div class="post-metadata">

**Author:** ![scottbrisko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scottbrisko](https://www.ruby-forum.com/u/scottbrisko)\
**Post date:** [January 15, 2008, 3:37am UTC](https://www.ruby-forum.com/t/lots-of-seg-faults/126052/5 "2008-01-15T03:37:40Z")

</div>

Thomas A. wrote:

> Hello –
> 
> On 15/01/2008, Scott B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Anyone care go guess what’s going on here?
> > 
> > This started happening out of the blue. I’ve since updated Ruby but  
> > still get “[BUG] Segmentation fault” on most operations involving ruby,  
> > gem, rake, etc.
> > 
> > This is just an example, most every usage of gem or rake will do this.  
> > They fail repeatedly until they work:
> 
> Anything else segfaulting? Might be faulty memory – see memtest86  
> and friends. If you set:
> 
> ulimit -c unlimited
> 
> Can you get a backtrace from the resulting corefile created via gdb?
> 
> – Thomas A.

Thanks Thomas,

Here are two backtraces:

* * *

## This GDB was configured as “powerpc-apple-darwin”. #0 0x900481ac in ?? () (gdb) bt #0 0x900481ac in ?? () #1 0x9012d7b4 in ?? () warning: Previous frame identical to this frame (corrupt stack?) #2 0x0003aaf4 in ?? () #3 0x0006c1ac in ?? () #4 0x90130f54 in ?? () #5 0x0000e3d8 in ?? () #6 0x00000000 in ?? () Cannot access memory at address 0x42000226 #7 0x00000000 in ?? () Cannot access memory at address 0x42000226 Previous frame inner to this frame (corrupt stack?)

* * *

## This GDB was configured as “powerpc-apple-darwin”. #0 0x900481ac in ?? () (gdb) bt #0 0x900481ac in ?? () #1 0x9012d7b4 in ?? () warning: Previous frame identical to this frame (corrupt stack?) #2 0x0003aaf4 in ?? () #3 0x0006c1ac in ?? () #4 0x90130f54 in ?? ()

“Cannot access memory” looks suspiciously like bad RAM…

Unfortunately I don’t have memtest on this box.

---

<div class="post-metadata">

**Author:** ![scottbrisko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scottbrisko](https://www.ruby-forum.com/u/scottbrisko)\
**Post date:** [February 23, 2008, 2:40am UTC](https://www.ruby-forum.com/t/lots-of-seg-faults/126052/6 "2008-02-23T02:40:28Z")

</div>

Micah G. wrote:

> i am having the same problem. was a solution found? did it turn out to  
> be faulty memory?

I’ll let you know in a few days when I get my RAM

I ran a memtest on it and came back with no faults, but I’m getting  
other failures now in Ruby and related processes. Darwin’s CrashReporter  
core dumps look a whole lot like the one I described above. I can’t  
prove it but I’m suspicious of the memory, and it’s cheap enough to  
replace and test it out.

I’ll let you know.
