Segfault when installing Test::Unit

When i try to install Test::Unit 0.1.4 i get the following error:

…/…/…/lib/test/unit/assertions.rb:352: [BUG] Segmentation fault
ruby 1.6.7 (2002-03-01) [i686-linux-gnu]

This happens when running ‘ruby setup.rb install’. I’m guessing it has something to do with ruby being compiled with gcc 3.2. I didn’t have any trouble installing Test::Unit on a gcc 2.95 machine.

If this email was supposed to go somewhere else… sorry =/

···


To call me “awesome” is an understatement.

When i try to install Test::Unit 0.1.4 i get the following error:
..../../../lib/test/unit/assertions.rb:352: [BUG] Segmentation fault
ruby 1.6.7 (2002-03-01) [i686-linux-gnu]

I've no problem with

nasun% ruby -v
ruby 1.6.7 (2002-09-12) [sparc-solaris2.8]
nasun%

nasun% gcc -v
Reading specs from /opt/gcc/lib/gcc-lib/sparc-sun-solaris2.8/3.2/specs
Configured with: ../gcc-3.2/configure --prefix=/opt/gcc
Thread model: posix
gcc version 3.2
nasun%

Guy Decoux

Hi,

···

At Sun, 6 Oct 2002 07:26:10 +0900, nico wrote:

This happens when running ‘ruby setup.rb install’. I’m
guessing it has something to do with ruby being compiled with
gcc 3.2. I didn’t have any trouble installing Test::Unit on a
gcc 2.95 machine.

It’s known that 1.6 and 1.7 before 2002-10-03 have the problem
with gcc 3.2.

Try with this patch.

Index: eval.c

RCS file: /cvs/ruby/src/ruby/eval.c,v
retrieving revision 1.137.2.131
diff -u -2 -p -r1.137.2.131 eval.c
— eval.c 5 Oct 2002 21:07:24 -0000 1.137.2.131
+++ eval.c 6 Oct 2002 18:48:32 -0000
@@ -1033,5 +1033,5 @@ ruby_init()
#endif

  • Init_stack(0);
  • Init_stack(&state);
    Init_heap();
    PUSH_SCOPE();
    Index: gc.c
    ===================================================================
    RCS file: /cvs/ruby/src/ruby/gc.c,v
    retrieving revision 1.48.2.28
    diff -u -2 -p -r1.48.2.28 gc.c
    — gc.c 5 Sep 2002 20:08:48 -0000 1.48.2.28
    +++ gc.c 6 Oct 2002 18:48:54 -0000
    @@ -1090,7 +1090,5 @@ Init_stack(addr)
    rb_gc_stack_start = _SEND;
    #else
  • VALUE start;
  • if (!addr) addr = &start;
  • if (!addr) addr = &addr;
    rb_gc_stack_start = addr;
    #endif


Nobu Nakada

When i try to install Test::Unit 0.1.4 i get the following error:
…/…/…/lib/test/unit/assertions.rb:352: [BUG] Segmentation fault
ruby 1.6.7 (2002-03-01) [i686-linux-gnu]

I’ve no problem with

No problem with

mesange% ruby -v
ruby 1.6.7 (2002-09-12) [i686-linux]
mesange%

mesange% gcc -v
Reading specs from /home/ts/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: /home/ts/tmp/gcc-3.2/configure --prefix=/home/ts/local/gcc
Thread model: posix
gcc version 3.2
mesange%

Have you compiled ruby, or used a package ? If not try to compile ruby with
gcc-3.2

Guy Decoux

I compiled ruby myself, using the following optimizations: ‘-O3 -fomit-frame-pointer -march=athlon’

···

On Sun, 6 Oct 2002 17:27:38 +0900 ts decoux@moulon.inra.fr wrote:

Have you compiled ruby, or used a package ? If not try to compile ruby with
gcc-3.2

Guy Decoux


To call me “awesome” is an understatement.

I compiled ruby myself, using the following optimizations: '-O3
-fomit-frame-pointer -march=athlon'

Try to remove your optimization, and compile it with '-g -O2'

Guy Decoux

Have you compiled ruby, or used a package ? If not try to compile ruby with
gcc-3.2

I compiled ruby myself, using the following optimizations: ‘-O3
-fomit-frame-pointer -march=athlon’

-march=athlon is the culprit, iirc. GCC 3.2 is horribly broken when
it comes to CPU specific optimizations. There are some patches in the
FreeBSD source tree that solve this though I don’t think they’ve
trickled back to the GCC camp (they’re currently in a push to do a 3.2
final release and start working on 3.3). -sc

···


Sean Chittenden

OK, i tried that and it works now.

···

On Mon, 7 Oct 2002 00:26:31 +0900 ts decoux@moulon.inra.fr wrote:

I compiled ruby myself, using the following optimizations: ‘-O3
-fomit-frame-pointer -march=athlon’

Try to remove your optimization, and compile it with ‘-g -O2’

Guy Decoux


To call me “awesome” is an understatement.