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

**URL:** <https://www.ruby-forum.com/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/118987>\
**Category:** Ruby\
**Created:** [November 1, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/118987 "2007-11-01T23:08:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [November 1, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/118987/1 "2007-11-01T23:08:23Z")

</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:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [November 1, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/118987/2 "2007-11-01T23:48:48Z")

</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

---

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [November 2, 2007, 1:47am UTC](https://www.ruby-forum.com/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/118987/3 "2007-11-02T01:47:59Z")

</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

---

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [November 2, 2007, 3:10am UTC](https://www.ruby-forum.com/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/118987/4 "2007-11-02T03:10:24Z")

</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)

---

<div class="post-metadata">

**Author:** ![mslagell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Post date:** [November 2, 2007, 2:06am UTC](https://www.ruby-forum.com/t/seg-fault-when-building-ruby-1-8-6-p111-on-macos-x-10-5/118987/5 "2007-11-02T02:06:42Z")

</div>

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

-Ron
