# Seg fault when building ruby 1.8.6-p111 on MacOS X 10.5

**URL:** <https://rubytalk.org/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/41854>\
**Category:** ruby-talk\
**Created:** [1 November 2007 21:43 UTC](https://rubytalk.org/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/41854 "2007-11-01T21:43:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Slater](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@Mark\_Slater](https://rubytalk.org/u/Mark_Slater)\
**Post date:** [1 November 2007 21:43 UTC](https://rubytalk.org/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/41854/1 "2007-11-01T21:43:13Z")

</div>

I'm getting a segmentation fault when building ruby 1.8.6-p111 (from source and by itself, not as part of a larger distribution). I'm running on a clean version of MacOS X 10.5 and a new build of readline 5.2 installed in /usr/local.

My configure line is: ./configure --prefix=/usr/local/ruby --with-readline-dir=/usr/local/readline --enable-pthread

There weren't any issues that I could see during the configure process and the make process looked fine right up until the segmentation fault. Here's where it ended:

gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c time.c  
gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c util.c  
gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c variable.c  
gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c version.c  
gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c dmyext.c  
ar rcu libruby-static.a array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o dmyext.o  
gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c main.c  
gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c dmydln.c  
gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -L. main.o dmydln.o libruby-static.a -lpthread -ldl -lobjc -o miniruby  
ruby: [BUG] Segmentation fault  
ruby 1.8.6 (2007-09-24) [i686-darwin9.0.0]

make: \*\*\* [.rbconfig.time] Abort trap

Has anyone else run into this and maybe found a solution?

Thanks!

Mark

---

<div class="post-metadata">

**Author:** ![Mark\_Slater](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@Mark\_Slater](https://rubytalk.org/u/Mark_Slater)\
**Post date:** [1 November 2007 22:45 UTC](https://rubytalk.org/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/41854/2 "2007-11-01T22:45:27Z")

</div>

Interestingly, I'm getting the same problem when building ruby 1.8.6-p110 and ruby 1.8.6-p36... the latter being the same version that is include in the shipping OS!

I've found many references to this issue, but never any explanation for what causes it, let alone a solution to fixing it.

Mark

> **···**
>
> On Nov 1, 2007, at 2:43 PM, Mark Slater wrote:
> 
> > I'm getting a segmentation fault when building ruby 1.8.6-p111 (from source and by itself, not as part of a larger distribution). I'm running on a clean version of MacOS X 10.5 and a new build of readline 5.2 installed in /usr/local.
> > 
> > My configure line is: ./configure --prefix=/usr/local/ruby --with-readline-dir=/usr/local/readline --enable-pthread
> > 
> > There weren't any issues that I could see during the configure process and the make process looked fine right up until the segmentation fault. Here's where it ended:
> > 
> > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c time.c  
> > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c util.c  
> > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c variable.c  
> > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c version.c  
> > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c dmyext.c  
> > ar rcu libruby-static.a array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o dmyext.o  
> > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c main.c  
> > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c dmydln.c  
> > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -L. main.o dmydln.o libruby-static.a -lpthread -ldl -lobjc -o miniruby  
> > ruby: [BUG] Segmentation fault  
> > ruby 1.8.6 (2007-09-24) [i686-darwin9.0.0]
> > 
> > make: \*\*\* [.rbconfig.time] Abort trap
> > 
> > Has anyone else run into this and maybe found a solution?
> > 
> > Thanks!
> > 
> > Mark

---

<div class="post-metadata">

**Author:** ![Mark\_Slater](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@Mark\_Slater](https://rubytalk.org/u/Mark_Slater)\
**Post date:** [2 November 2007 00:46 UTC](https://rubytalk.org/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/41854/3 "2007-11-02T00:46:35Z")

</div>

So I was able to get ruby to compile by removing the --enable-pthread option. I'm not sure why that was needed though, since I've always used it before. I did see a reference to ruby not liking pthread enabled if tcl/tk's pthread was disabled, but that there was a warning mechanism in place to handle that.

I'm going to try building my own version of tcl/tk and seeing if I can get things to be happy again with pthread, but if anyone knows a different way of fixing things up, I'd really appreciate it.

Mark

> **···**
>
> On Nov 1, 2007, at 3:45 PM, Mark Slater wrote:
> 
> > Interestingly, I'm getting the same problem when building ruby 1.8.6-p110 and ruby 1.8.6-p36... the latter being the same version that is include in the shipping OS!
> > 
> > I've found many references to this issue, but never any explanation for what causes it, let alone a solution to fixing it.
> > 
> > Mark
> > 
> > On Nov 1, 2007, at 2:43 PM, Mark Slater wrote:
> > 
> > > I'm getting a segmentation fault when building ruby 1.8.6-p111 (from source and by itself, not as part of a larger distribution). I'm running on a clean version of MacOS X 10.5 and a new build of readline 5.2 installed in /usr/local.
> > > 
> > > My configure line is: ./configure --prefix=/usr/local/ruby --with-readline-dir=/usr/local/readline --enable-pthread
> > > 
> > > There weren't any issues that I could see during the configure process and the make process looked fine right up until the segmentation fault. Here's where it ended:
> > > 
> > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c time.c  
> > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c util.c  
> > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c variable.c  
> > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c version.c  
> > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c dmyext.c  
> > > ar rcu libruby-static.a array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o dmyext.o  
> > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c main.c  
> > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c dmydln.c  
> > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -L. main.o dmydln.o libruby-static.a -lpthread -ldl -lobjc -o miniruby  
> > > ruby: [BUG] Segmentation fault  
> > > ruby 1.8.6 (2007-09-24) [i686-darwin9.0.0]
> > > 
> > > make: \*\*\* [.rbconfig.time] Abort trap
> > > 
> > > Has anyone else run into this and maybe found a solution?
> > > 
> > > Thanks!
> > > 
> > > Mark

---

<div class="post-metadata">

**Author:** ![Rawn027](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@Rawn027](https://rubytalk.org/u/Rawn027)\
**Post date:** [2 November 2007 01:05 UTC](https://rubytalk.org/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/41854/4 "2007-11-02T01:05:19Z")

</div>

What type of performance does pthread offer when it is enabled?

-Ron

> **···**
>
> On Nov 1, 2007, at 8:46 PM, Mark Slater wrote:
> 
> > So I was able to get ruby to compile by removing the --enable-pthread option. I'm not sure why that was needed though, since I've always used it before. I did see a reference to ruby not liking pthread enabled if tcl/tk's pthread was disabled, but that there was a warning mechanism in place to handle that.
> > 
> > I'm going to try building my own version of tcl/tk and seeing if I can get things to be happy again with pthread, but if anyone knows a different way of fixing things up, I'd really appreciate it.
> > 
> > Mark
> > 
> > On Nov 1, 2007, at 3:45 PM, Mark Slater wrote:
> > 
> > > Interestingly, I'm getting the same problem when building ruby 1.8.6-p110 and ruby 1.8.6-p36... the latter being the same version that is include in the shipping OS!
> > > 
> > > I've found many references to this issue, but never any explanation for what causes it, let alone a solution to fixing it.
> > > 
> > > Mark
> > > 
> > > On Nov 1, 2007, at 2:43 PM, Mark Slater wrote:
> > > 
> > > > I'm getting a segmentation fault when building ruby 1.8.6-p111 (from source and by itself, not as part of a larger distribution). I'm running on a clean version of MacOS X 10.5 and a new build of readline 5.2 installed in /usr/local.
> > > > 
> > > > My configure line is: ./configure --prefix=/usr/local/ruby --with-readline-dir=/usr/local/readline --enable-pthread
> > > > 
> > > > There weren't any issues that I could see during the configure process and the make process looked fine right up until the segmentation fault. Here's where it ended:
> > > > 
> > > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c time.c  
> > > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c util.c  
> > > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c variable.c  
> > > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c version.c  
> > > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c dmyext.c  
> > > > ar rcu libruby-static.a array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o dmyext.o  
> > > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c main.c  
> > > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c dmydln.c  
> > > > gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -L. main.o dmydln.o libruby-static.a -lpthread -ldl -lobjc -o miniruby  
> > > > ruby: [BUG] Segmentation fault  
> > > > ruby 1.8.6 (2007-09-24) [i686-darwin9.0.0]
> > > > 
> > > > make: \*\*\* [.rbconfig.time] Abort trap
> > > > 
> > > > Has anyone else run into this and maybe found a solution?
> > > > 
> > > > Thanks!
> > > > 
> > > > Mark

---

<div class="post-metadata">

**Author:** ![Michael\_Steinfeld](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@Michael\_Steinfeld](https://rubytalk.org/u/Michael_Steinfeld)\
**Post date:** [2 November 2007 02:09 UTC](https://rubytalk.org/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/41854/5 "2007-11-02T02:09:32Z")

</div>

Laurent has already explained why this is and provides patches. Which  
already have been committed to macports.

FMI see ...

[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/12895](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/12895)

> **···**
>
> On 11/1/07, Ronald Valente \<rawn027@gmail.com\> wrote:
> 
> > What type of performance does pthread offer when it is enabled?
> > 
> > -Ron
> > 
> > On Nov 1, 2007, at 8:46 PM, Mark Slater wrote:
> > 
> > \> So I was able to get ruby to compile by removing the --enable-  
> > \> pthread option. I'm not sure why that was needed though, since I've  
> > \> always used it before. I did see a reference to ruby not liking  
> > \> pthread enabled if tcl/tk's pthread was disabled, but that there was  
> > \> a warning mechanism in place to handle that.  
> > \>  
> > \> I'm going to try building my own version of tcl/tk and seeing if I  
> > \> can get things to be happy again with pthread, but if anyone knows a  
> > \> different way of fixing things up, I'd really appreciate it.  
> > \>  
> > \> Mark  
> > \>  
> > \> On Nov 1, 2007, at 3:45 PM, Mark Slater wrote:  
> > \>  
> > \>\> Interestingly, I'm getting the same problem when building ruby  
> > \>\> 1.8.6-p110 and ruby 1.8.6-p36... the latter being the same version  
> > \>\> that is include in the shipping OS!  
> > \>\>  
> > \>\> I've found many references to this issue, but never any explanation  
> > \>\> for what causes it, let alone a solution to fixing it.  
> > \>\>  
> > \>\> Mark  
> > \>\>  
> > \>\> On Nov 1, 2007, at 2:43 PM, Mark Slater wrote:  
> > \>\>  
> > \>\>\> I'm getting a segmentation fault when building ruby 1.8.6-p111  
> > \>\>\> (from source and by itself, not as part of a larger distribution).  
> > \>\>\> I'm running on a clean version of MacOS X 10.5 and a new build of  
> > \>\>\> readline 5.2 installed in /usr/local.  
> > \>\>\>  
> > \>\>\> My configure line is: ./configure --prefix=/usr/local/ruby --with-  
> > \>\>\> readline-dir=/usr/local/readline --enable-pthread  
> > \>\>\>  
> > \>\>\> There weren't any issues that I could see during the configure  
> > \>\>\> process and the make process looked fine right up until the  
> > \>\>\> segmentation fault. Here's where it ended:  
> > \>\>\>  
> > \>\>\> gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c time.c  
> > \>\>\> gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c util.c  
> > \>\>\> gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c variable.c  
> > \>\>\> gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c version.c  
> > \>\>\> gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c dmyext.c  
> > \>\>\> ar rcu libruby-static.a array.o bignum.o class.o compar.o dir.o  
> > \>\>\> dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o  
> > \>\>\> marshal.o math.o numeric.o object.o pack.o parse.o process.o  
> > \>\>\> prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o  
> > \>\>\> st.o string.o struct.o time.o util.o variable.o version.o dmyext.o  
> > \>\>\> gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c main.c  
> > \>\>\> gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -I. -I. -c dmydln.c  
> > \>\>\> gcc -g -O2 -pipe -fno-common -DRUBY\_EXPORT -L. main.o  
> > \>\>\> dmydln.o libruby-static.a -lpthread -ldl -lobjc -o miniruby  
> > \>\>\> ruby: [BUG] Segmentation fault  
> > \>\>\> ruby 1.8.6 (2007-09-24) [i686-darwin9.0.0]  
> > \>\>\>  
> > \>\>\> make: \*\*\* [.rbconfig.time] Abort trap  
> > \>\>\>  
> > \>\>\> Has anyone else run into this and maybe found a solution?  
> > \>\>\>  
> > \>\>\> Thanks!  
> > \>\>\>  
> > \>\>\> Mark  
> > \>\>\>  
> > \>\>  
> > \>\>  
> > \>  
> > \>
> 
> --  
> Michael Steinfeld  
> Linux Admin/Developer  
> AIM: mikesteinfeld  
> GTALK: mikeisgreat@gmail.com
