./lib/ftools.rb:204: [BUG] Segmentation fault

I need some pointers on compiling on a IA64 system
(a 512-processor SGI Altix).

For the 03-18-2004 stable snapshot, I am getting:

gcc -g -O2 -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 -I. -I. -c main.c
gcc -g -O2 -rdynamic main.o dmyext.o libruby-static.a -ldl -lcrypt -lm -o miniruby
./lib/ftools.rb:204: [BUG] Segmentation fault
ruby 1.8.1 (2004-03-15) [ia64-linux]

make: *** [rbconfig.rb] Aborted (core dumped)

Where lib/ftools.rb has:

 198   def makedirs(*dirs)
 199     verbose = if dirs[-1].is_a? String then false else dirs.pop end
 200 #    mode = if dirs[-1].is_a? Fixnum then dirs.pop else 0755 end
 201     mode = 0755
 202     for dir in dirs
 203       parent = dirname(dir)
 204       next if parent == dir or FileTest.directory? dir
 205       makedirs parent unless FileTest.directory? parent
 206       $deferr.print "mkdir ", dir, "\n" if verbose

The machine is using a special SGI Linux kernel:

% uname -r
2.4.21-sgi240rp04021313_10046

and apparently a 2.96 glibc:

% gcc -v
Reading specs from /usr/lib/gcc-lib/ia64-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-118.7.2)

Thanks,

···


Bil Kleb, Hampton, Virginia

Bil Kleb wrote:

I need some pointers on compiling on a IA64 system
(a 512-processor SGI Altix).

For the 03-18-2004 stable snapshot, I am getting:

gcc -g -O2 -rdynamic main.o dmyext.o libruby-static.a -ldl -lcrypt
-lm -o miniruby
./lib/ftools.rb:204: [BUG] Segmentation fault
ruby 1.8.1 (2004-03-15) [ia64-linux]

[more data]

For the 03-18-2004 snapshot I am getting:

gcc -g -O2 -rdynamic main.o libruby-static.a -ldl -lcrypt -lm -o miniruby
./lib/fileutils.rb:837: [BUG] Segmentation fault
ruby 1.9.0 (2004-03-17) [ia64-linux]

where lib/fileutils.rb has,

 836     FileUtils::OPT_TABLE.each do |name, opts|
 837       next unless opts.include?('verbose')
 838       module_eval(<<-EOS, __FILE__, __LINE__ + 1)
 839         def #{name}(*args)

The 03-18.2004 1.6 snapshot works!

Later,

···


Bil Kleb, Hampton, Virginia

Bil Kleb wrote:

I need some pointers on compiling on a IA64 system
(a 512-processor SGI Altix).

Keep a fire extinguisher handy.

Hal

  ./lib/fileutils.rb:837: [BUG] Segmentation fault

For such problems, it's best to give a backtrace of all stack frames and
to have an knowledge of the ia64 implementation

  ruby 1.9.0 (2004-03-17) [ia64-linux]

Guy Decoux

ts wrote:

./lib/fileutils.rb:837: [BUG] Segmentation fault

For such problems, it’s best to give a backtrace of all stack frames and
to have an knowledge of the ia64 implementation

Please expand. I do not understand what you wrote or how to comply.
(I code test-first and so I have no idea how to run debuggers or how
to produce stack frames.)

Did you see the previous message (95256) that had more system details?

My apologies,

···


Bil Kleb, Hampton, Virginia

Did you see the previous message (95256) that had more system details?

Yes, and this is why I've given this response.

make: *** [rbconfig.rb] Aborted (core dumped)

This message just say that the problem is probably in miniruby (or gcc)
and not in lib/ftools.rb.

Perhaps the best thing to do is to try to update your version of gcc (2.96
is old)

Guy Decoux

ts wrote:

make: *** [rbconfig.rb] Aborted (core dumped)

This message just say that the problem is probably in miniruby (or gcc)
and not in lib/ftools.rb.

OK, so how do I tease more information out of miniruby (or gcc)?

Perhaps the best thing to do is to try to update your version of gcc (2.96
is old)

Other than trying to compile a local version, I have no means to comply
with this request. (This is a large production machine for which I have
no root access.)

Thanks,

···


Bil Kleb, Hampton, Virginia

OK, so how do I tease more information out of miniruby (or gcc)?

Well, ruby is trying to do

  miniruby mkconfig.rb rbconfig.rb

if you have gdb

xxx% gdb miniruby
> r mkconfig.rb rbconfig.rb
> bt # when it crash

Other than trying to compile a local version, I have no means to comply
with this request. (This is a large production machine for which I have
no root access.)

Why, nobody want to update its C compiler : they never trust me when I say
that the problem is in the compiler :-))

Guy Decoux

ts wrote:

xxx% gdb miniruby

r mkconfig.rb rbconfig.rb
bt # when it crash

Perfect. Thanks.

% gdb miniruby

(gdb) r mkconfig.rb rbconfig.rb
Starting program: /home/kleb/local/pkgs/ruby/miniruby mkconfig.rb rbconfig.rb

Program received signal SIGSEGV, Segmentation fault.
rb_yield_0 (val=2305843009218536184, self=2305843009218656024, klass=0, flags=-67224, avalue=0) at eval.c:4707
4707 if ((state = EXEC_TAG()) == 0) {
(gdb) bt
#0 rb_yield_0 (val=2305843009218536184, self=2305843009218656024, klass=0, flags=-67224, avalue=0) at eval.c:4707
#1 0x40000000000263f0 in rb_yield (val=2305843009218536184) at eval.c:4807
#2 0x400000000011bd00 in rb_ary_each (ary=2305843009218534784) at array.c:1114
#3 0x400000000002abc0 in rb_call0 (klass=2305843009218685824, recv=2305843009218534784, id=3825, oid=0, argc=0, argv=0x0,
body=0x20000000004c2338, nosuper=56920) at eval.c:5385
#4 0x400000000002ca70 in rb_call (klass=2305843009218685824, recv=2305843009218534784, mid=3825, argc=0, argv=0x0, scope=0)
at eval.c:5737
#5 0x400000000001bcd0 in rb_eval (self=2305843009218656024, n=0x6000000000004d20) at eval.c:2983
#6 0x400000000002c000 in rb_call0 (klass=2305843009218655984, recv=2305843009218656024, id=10233, oid=0, argc=2,
argv=0x60000fffffff6890, body=0x20000000004a0e40, nosuper=-44504) at eval.c:5644
#7 0x400000000002ca70 in rb_call (klass=2305843009218655984, recv=2305843009218656024, mid=10233, argc=2, argv=0x60000fffffff6890,
scope=0) at eval.c:5737
#8 0x400000000001deb0 in rb_eval (self=2305843009218737184, n=0x6000000000004d20) at eval.c:3252
#9 0x40000000000132c0 in eval_node (self=2305843009218737184, node=0x20000000004b0340) at eval.c:1285
#10 0x4000000000014030 in ruby_exec () at eval.c:1454
#11 0x4000000000014110 in ruby_run () at eval.c:1475
#12 0x400000000000f310 in Init_ext () at main.c:50
#13 0x4000000000025950 in rb_yield_0 (val=Cannot access memory at address 0x60000fff7fffbfa0
) at eval.c:4707
#14 0x400000000000f140 in _start ()
#15 0x4000000000025950 in rb_yield_0 (val=Cannot access memory at address 0x60000fff7fffbef8
) at eval.c:4707
Cannot access memory at address 0x60000fff7fffbf98

where for stable-snapshot 03-18-2004, eval.c has:

4705     PUSH_ITER(block->iter);
4706     PUSH_TAG(lambda ? PROT_NONE : PROT_YIELD);
4707     if ((state = EXEC_TAG()) == 0) {
4708       redo:
4709         if (nd_type(node) == NODE_CFUNC || nd_type(node) == NODE_IFUNC) {

Thanks,

···


Bil Kleb, Hampton, Virginia