Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#15635 closed defect (fixed)

Ruby 1.8.7 dumps core on 10.5 ppc

Reported by: blair (Blair Zajac) Owned by: pguyot (Paul Guyot)
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: febeling@…
Port:

Description

I can compile and test ruby 1.8.7 fine on 10.5.3 i386, but it dumps core on 10.5.3 ppc:

/usr/bin/gcc-4.0 -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c string.c
/usr/bin/gcc-4.0 -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c struct.c
/usr/bin/gcc-4.0 -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c time.c
/usr/bin/gcc-4.0 -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c util.c
/usr/bin/gcc-4.0 -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c variable.c
/usr/bin/gcc-4.0 -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c version.c
/usr/bin/gcc-4.0 -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c ./missing/alloca.c
./missing/alloca.c:144: warning: conflicting types for built-in function 'alloca'
/usr/bin/gcc-4.0 -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c dmyext.c
ar rcu libruby-static.a array.o bignum.o class.o compar.o dir.o dln.o enum.o enumerator.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 alloca.o dmyext.o
/usr/bin/gcc-4.0 -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c main.c
/usr/bin/gcc-4.0 -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -I. -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c dmydln.c
/usr/bin/gcc-4.0  -O2  -fno-common -pipe -fno-common    -DRUBY_EXPORT  -L. -L/opt/local/lib  main.o dmydln.o libruby-static.a -lpthread -ldl -lobjc   -o miniruby
./ext/purelib.rb:5: [BUG] Segmentation fault
ruby 1.8.7 (2008-05-31 patchlevel 0) [powerpc-darwin9.3.0]

make: *** [.rbconfig.time] Abort trap (core dumped)

Warning: the following items did not execute (for ruby): org.macports.build
Error: Status 1 encountered during processing.

Change History (11)

comment:1 Changed 16 years ago by blair (Blair Zajac)

Some more information. This is the first command that fails from Makefile:

root# ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./mkconfig.rb -timestamp=.rbconfig.time -install_name=ruby -so_name=ruby rbconfig.rb
./ext/purelib.rb:5: [BUG] Segmentation fault
ruby 1.8.7 (2008-05-31 patchlevel 0) [powerpc-darwin9.3.0]

Abort trap (core dumped)

Running it in a debugger to get a stack trace:

# gdb ./miniruby 
GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct  2 04:11:19 UTC 2007)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-apple-darwin"...Reading symbols for shared libraries .... done

(gdb) run -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./mkconfig.rb -timestamp=.rbconfig.time -install_name=ruby -so_name=ruby rbconfig.rb
Starting program: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_ruby/work/ruby-1.8.7/miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./mkconfig.rb -timestamp=.rbconfig.time -install_name=ruby -so_name=ruby rbconfig.rb
Reading symbols for shared libraries +++... done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xc0003ff8
0x00025610 in rb_eval ()
(gdb) bt
#0  0x00025610 in rb_eval ()
#1  0x00034510 in rb_load ()
#2  0x00034ac0 in rb_require_safe ()
#3  0x0001b010 in rb_protect ()
#4  0x00089434 in require_libraries ()
#5  0x0008b1f8 in load_file ()
#6  0x0008aa6c in proc_options ()
#7  0x0008abd4 in ruby_process_options ()
#8  0x0002deb4 in ruby_options ()
#9  0x00001e20 in main ()
(gdb) 

comment:2 Changed 16 years ago by raimue (Rainer Müller)

Did you already report this upstream? I think this is out of range what we can fix easily, so upstream should have a look.

comment:3 Changed 16 years ago by blair (Blair Zajac)

Me, no, I didn't report it upstream.

It's the port maintainer's job to handle the MacPorts issue, doing whatever it takes to have a successful MacPorts build, such as reporting it upstream, finding a patch, etc.

comment:4 Changed 16 years ago by febeling@…

Cc: febeling@… added

Cc Me!

comment:5 in reply to:  description Changed 16 years ago by febeling@…

Hm, does still segfault on PPC/10.5.3 after update to p17, unfortunately.

comment:6 Changed 16 years ago by febeling@…

It does build and install without error when you remove the "--enable-pthread" line from the portfile.

comment:7 Changed 16 years ago by pguyot (Paul Guyot)

From what I understand, it will break tk support.

comment:8 in reply to:  7 ; Changed 16 years ago by febeling@…

Replying to pguyot@kallisys.net:

From what I understand, it will break tk support.

Yes, I've seen that note as well. I don't know what is best to do.

Maybe it's better to break only Tk than the entire PPC target, and do some dodgy if arch == powerpc thing.

I've filed a bug with the ruby project for this though, because it happens with a pure tar ball as well:

http://redmine.ruby-lang.org/issues/show/193

I mean there is no working ruby 1.8.7 for that machine right now, it seems. But I think most people want it for rails and such, where tk is quite secondary. I think have never invoked a single Tk widget in the 3 years I use ruby.

comment:9 in reply to:  8 Changed 16 years ago by kimuraw (kimura wataru)

The following change against ruby's Portfile disables "--enable-pthread" on 10.5 ppc Mac. I think this is not so bad to solve the problem temporally.

Index: lang/ruby/Portfile
===================================================================
--- lang/ruby/Portfile	(revision 783)
+++ lang/ruby/Portfile	(working copy)
@@ -74,6 +74,12 @@
 	configure.args-delete	--enable-pthread
 }
 
+platform darwin 9 powerpc {
+	# pthreads breaks ruby-1.8.7 on 10.5 ppc
+	# http://trac.macports.org/ticket/15635
+	configure.args-delete	--enable-pthread
+}
+
 variant tk conflicts mactk {
 	configure.args-delete	--without-tk
 	configure.args-append	--with-tk

comment:10 Changed 16 years ago by pguyot (Paul Guyot)

Resolution: fixed
Status: newclosed

Committed the workaround in r37694 where I also changed the maintainer to kimuraw@.

comment:11 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.