# Segmentation fault while compiling ruby 1.9.3p392 with OpenSSL 1.0.1e installed

**URL:** <https://rubytalk.org/t/segmentation-fault-while-compiling-ruby-1-9-3p392-with-openssl-1-0-1e-installed/67476>\
**Category:** ruby-talk\
**Created:** [9 March 2013 16:33 UTC](https://rubytalk.org/t/segmentation-fault-while-compiling-ruby-1-9-3p392-with-openssl-1-0-1e-installed/67476 "2013-03-09T16:33:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [9 March 2013 16:33 UTC](https://rubytalk.org/t/segmentation-fault-while-compiling-ruby-1-9-3p392-with-openssl-1-0-1e-installed/67476/1 "2013-03-09T16:33:59Z")

</div>

I'm trying to have my Rails website running on my fresh installation of  
Mountain Lion Server. Not using RVM, because I don't need many rails or  
ruby installations. Configuring ruby and rails to run smoothly is a pain  
in the ass.

Compiled the newest version of OpenSSL with these commands:

&nbsp;&nbsp;&nbsp;&nbsp;sudo ./configure --prefix=/usr/local/ darwin64-x86\_64-cc  
&nbsp;&nbsp;&nbsp;&nbsp;sudo make  
&nbsp;&nbsp;&nbsp;&nbsp;sudo make install

Now when I type I get this:

&nbsp;&nbsp;&nbsp;&nbsp;grid:ruby-1.9.3-p392 Clu$ openssl version  
&nbsp;&nbsp;&nbsp;&nbsp;OpenSSL 1.0.1e 11 Feb 2013

When I try to configure Ruby from source, I get to Segmentation Fault:

&nbsp;&nbsp;&nbsp;&nbsp;compiling md5init.c  
&nbsp;&nbsp;&nbsp;&nbsp;compiling md5ossl.c  
&nbsp;&nbsp;&nbsp;&nbsp;linking shared-object digest/md5.bundle  
&nbsp;&nbsp;&nbsp;&nbsp;installing default md5 libraries  
&nbsp;&nbsp;&nbsp;&nbsp;compiling rmd160init.c  
&nbsp;&nbsp;&nbsp;&nbsp;compiling rmd160ossl.c  
&nbsp;&nbsp;&nbsp;&nbsp;linking shared-object digest/rmd160.bundle  
&nbsp;&nbsp;&nbsp;&nbsp;installing default rmd160 libraries  
&nbsp;&nbsp;&nbsp;&nbsp;compiling sha1init.c  
&nbsp;&nbsp;&nbsp;&nbsp;compiling sha1ossl.c  
&nbsp;&nbsp;&nbsp;&nbsp;linking shared-object digest/sha1.bundle  
&nbsp;&nbsp;&nbsp;&nbsp;collect2: ld terminated with signal 11 [Segmentation fault: 11]  
&nbsp;&nbsp;&nbsp;&nbsp;make[2]: \*\*\* [../../../.ext/x86\_64-darwin12.2.1/digest/sha1.bundle]  
Error 1  
&nbsp;&nbsp;&nbsp;&nbsp;make[1]: \*\*\* [ext/digest/sha1/all] Error 2  
&nbsp;&nbsp;&nbsp;&nbsp;make: \*\*\* [build-ext] Error 2

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Miroslaw\_Niegowski](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@Miroslaw\_Niegowski](https://rubytalk.org/u/Miroslaw_Niegowski)\
**Post date:** [9 March 2013 17:35 UTC](https://rubytalk.org/t/segmentation-fault-while-compiling-ruby-1-9-3p392-with-openssl-1-0-1e-installed/67476/2 "2013-03-09T17:35:55Z")

</div>

Hi,  
signal 11 suggests a hardware error and is not related to software. I would  
check ram first.

> **···**
>
> 09-03-2013 17:35, "Piotr P." \<lists@ruby-forum.com\> napisał(a):
> 
> > I'm trying to have my Rails website running on my fresh installation of  
> > Mountain Lion Server. Not using RVM, because I don't need many rails or  
> > ruby installations. Configuring ruby and rails to run smoothly is a pain  
> > in the ass.
> > 
> > Compiled the newest version of OpenSSL with these commands:
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;sudo ./configure --prefix=/usr/local/ darwin64-x86\_64-cc  
> > &nbsp;&nbsp;&nbsp;&nbsp;sudo make  
> > &nbsp;&nbsp;&nbsp;&nbsp;sudo make install
> > 
> > Now when I type I get this:
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;grid:ruby-1.9.3-p392 Clu$ openssl version  
> > &nbsp;&nbsp;&nbsp;&nbsp;OpenSSL 1.0.1e 11 Feb 2013
> > 
> > When I try to configure Ruby from source, I get to Segmentation Fault:
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;compiling md5init.c  
> > &nbsp;&nbsp;&nbsp;&nbsp;compiling md5ossl.c  
> > &nbsp;&nbsp;&nbsp;&nbsp;linking shared-object digest/md5.bundle  
> > &nbsp;&nbsp;&nbsp;&nbsp;installing default md5 libraries  
> > &nbsp;&nbsp;&nbsp;&nbsp;compiling rmd160init.c  
> > &nbsp;&nbsp;&nbsp;&nbsp;compiling rmd160ossl.c  
> > &nbsp;&nbsp;&nbsp;&nbsp;linking shared-object digest/rmd160.bundle  
> > &nbsp;&nbsp;&nbsp;&nbsp;installing default rmd160 libraries  
> > &nbsp;&nbsp;&nbsp;&nbsp;compiling sha1init.c  
> > &nbsp;&nbsp;&nbsp;&nbsp;compiling sha1ossl.c  
> > &nbsp;&nbsp;&nbsp;&nbsp;linking shared-object digest/sha1.bundle  
> > &nbsp;&nbsp;&nbsp;&nbsp;collect2: ld terminated with signal 11 [Segmentation fault: 11]  
> > &nbsp;&nbsp;&nbsp;&nbsp;make[2]: \*\*\* [../../../.ext/x86\_64-darwin12.2.1/digest/sha1.bundle]  
> > Error 1  
> > &nbsp;&nbsp;&nbsp;&nbsp;make[1]: \*\*\* [ext/digest/sha1/all] Error 2  
> > &nbsp;&nbsp;&nbsp;&nbsp;make: \*\*\* [build-ext] Error 2
> > 
> > --  
> > Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![7stud2](https://avatars.discourse-cdn.com/v4/letter/7/9de053/32.png) [@7stud2](https://rubytalk.org/u/7stud2)\
**Post date:** [9 March 2013 19:30 UTC](https://rubytalk.org/t/segmentation-fault-while-compiling-ruby-1-9-3p392-with-openssl-1-0-1e-installed/67476/3 "2013-03-09T19:30:47Z")

</div>

I don't think it's a hardware failure, checked and everything is all  
right.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Robert\_K1](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/robert_k1/32/1830_2.png) [@Robert\_K1](https://rubytalk.org/u/Robert_K1)\
**Post date:** [11 March 2013 19:58 UTC](https://rubytalk.org/t/segmentation-fault-while-compiling-ruby-1-9-3p392-with-openssl-1-0-1e-installed/67476/4 "2013-03-11T19:58:05Z")

</div>

Signal 11 is SIGSEGV (segmentation fault). That has nothing to do  
with hardware - unless you want to suggest that the MMU is involved in  
the process. This typically happens when dereferencing null pointers.

Piotr, I'd start with simpler options - typically you do not need the  
sudo's for configuring and compiling. Also I'd omit the architecture  
unless you are cross compiling.

./configure --prefix=/usr/local/  
make  
sudo make install

Kind regards

robert

> **···**
>
> On Sat, Mar 9, 2013 at 6:35 PM, Miroslaw Niegowski \<trednu@gmail.com\> wrote:
> 
> > signal 11 suggests a hardware error and is not related to software. I would  
> > check ram first.
> 
> --  
> remember.guy do |as, often| as.you\_can - without end  
> [http://blog.rubybestpractices.com/](http://blog.rubybestpractices.com/)

---

<div class="post-metadata">

**Author:** ![D\_Deryl\_Downey](https://avatars.discourse-cdn.com/v4/letter/d/8baadc/32.png) [@D\_Deryl\_Downey](https://rubytalk.org/u/D_Deryl_Downey)\
**Post date:** [11 March 2013 20:30 UTC](https://rubytalk.org/t/segmentation-fault-while-compiling-ruby-1-9-3p392-with-openssl-1-0-1e-installed/67476/5 "2013-03-11T20:30:07Z")

</div>

SIG11 is not \_usually\_ a hardware error, though it can be related to memory issues. A SIG11 can be thrown when something tries to read or write to a memory area it doesn't have permissions on OR when it does and the area is corrupt. (Usually caused when memory cells have gone bad on individual sticks). Also happens when the addresses on the stack have become corrupt, again usually due to bad cells on the/a memory stick. The main issue though is that the pointer to a memory location is invalid.

Run up against this so many times over the last 15+ years of computing, its not funny. In \*some\* cases, swapping out memory sticks has solved the issue.

\*That being said\*, the most common issue that raises SIG11s are bugs in programs. (Bad pointer math, etc) There is no real way, short of testing your individual memory sticks in a hardware based memory tester (not something like mem86+ or Microscope), to determine if its specifically your memory or a bug in the software. There are subsystems that can throw this, hardware based, like overclocking memory and/or CPUs.

However, the vast majority of SIG11s thrown are due to bugs in programs, not hardware. Just don't totally discount hardware, is the point.

![](https://canada1.discourse-cdn.com/flex029/uploads/rubytalk/original/2X/8/88da4cbb20ddccdc9671058f519e0755880922f0.jpg)

![](https://canada1.discourse-cdn.com/flex029/uploads/rubytalk/original/2X/0/02fa11a3de1fe32605e858d84f3b1dcef2045483.jpg)

> **···**
>
> > Robert Klemme \<mailto:shortcutter@googlemail.com\>  
> > March 11, 2013 3:58 PM
> > 
> > Signal 11 is SIGSEGV (segmentation fault). That has nothing to do  
> > with hardware - unless you want to suggest that the MMU is involved in  
> > the process. This typically happens when dereferencing null pointers.
> > 
> > Piotr, I'd start with simpler options - typically you do not need the  
> > sudo's for configuring and compiling. Also I'd omit the architecture  
> > unless you are cross compiling.
> > 
> > ./configure --prefix=/usr/local/  
> > make  
> > sudo make install
> > 
> > Kind regards
> > 
> > robert
> > 
> > Miroslaw Niegowski \<mailto:trednu@gmail.com\>  
> > March 9, 2013 12:35 PM
> > 
> > Hi,  
> > signal 11 suggests a hardware error and is not related to software. I would check ram first.
> 
> --  
> D. Deryl Downey
> 
> &nbsp;&nbsp;"The bug which you would fright me with I seek" - William Shakespeare - The Winter's Tale, Act III, Scene II - A court of Justice.
