Issue #633 has been updated by Ed Borasky.

File ruby-configure.log added
File R-make.log added
File ruby-install.log added
File ruby-test.log added

I'm trying to reproduce this on my system. This machine is an Athlon64 X2 (dual-core x86_64). OS is openSUSE 11.1, 2.6.27 kernel, and gcc is "gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291]". I downloaded the Ruby source via subversion from trunk. The "autoconf", "configure", "make" and "make install" all ran fine, as did "make test". So I tried the test above. No segfaults, but I did get an interesting error message:

znmeb@DreamScape:~/Packages> export PATH=~/test/bin/:$PATH
znmeb@DreamScape:~/Packages> cd ruby/ext/dl/test/
znmeb@DreamScape:~/Packages/ruby/ext/dl/test> which ruby
/home/znmeb/test/bin/ruby
znmeb@DreamScape:~/Packages/ruby/ext/dl/test> ruby --version
ruby 1.9.1 (2008-12-26 patchlevel-5000 trunk 21067) [x86_64-linux]
znmeb@DreamScape:~/Packages/ruby/ext/dl/test> ruby test_all.rb 
nil
Loaded suite test_all
Started
EEEEEEEEEEEEEEEEEE
Finished in 0.002599 seconds.

  1) Error:
test_empty(DL::TestBase):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

  2) Error:
test_call_double(DL::TestDL):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

  3) Error:
test_call_int(DL::TestDL):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

  4) Error:
test_call_long(DL::TestDL):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

  5) Error:
test_callback(DL::TestDL):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

  6) Error:
test_cptr(DL::TestDL):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

  7) Error:
test_dlwrap(DL::TestDL):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

  8) Error:
test_empty(DL::TestDL):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

  9) Error:
test_sin(DL::TestDL):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

 10) Error:
test_strcpy(DL::TestDL):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

 11) Error:
test_strlen(DL::TestDL):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

 12) Error:
test_atof(DL::TestFunc):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

 13) Error:
test_empty(DL::TestFunc):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

 14) Error:
test_isdigit(DL::TestFunc):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

 15) Error:
test_qsort1(DL::TestFunc):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

 16) Error:
test_qsort2(DL::TestFunc):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

 17) Error:
test_strcpy(DL::TestFunc):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

 18) Error:
test_strtod(DL::TestFunc):
DL::DLError: /lib/libc.so.6: wrong ELF class: ELFCLASS32
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `initialize'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `dlopen'
    /home/znmeb/Packages/ruby/ext/dl/test/test_base.rb:29:in `setup'

18 tests, 0 assertions, 0 failures, 18 errors, 0 skips
/home/znmeb/test/lib/ruby/1.9.1/dl/import.rb:52:in `rescue in block in dlload': can't load /lib/libc.so.6 (DL::DLError)
	from /home/znmeb/test/lib/ruby/1.9.1/dl/import.rb:49:in `block in dlload'
	from /home/znmeb/test/lib/ruby/1.9.1/dl/import.rb:40:in `collect'
	from /home/znmeb/test/lib/ruby/1.9.1/dl/import.rb:40:in `dlload'
	from /home/znmeb/Packages/ruby/ext/dl/test/test_import.rb:7:in `<module:LIBC>'
	from /home/znmeb/Packages/ruby/ext/dl/test/test_import.rb:5:in `<module:DL>'
	from /home/znmeb/Packages/ruby/ext/dl/test/test_import.rb:4:in `<top (required)>'
	from test_all.rb:6:in `require'
	from test_all.rb:6:in `<main>'
znmeb@DreamScape:~/Packages/ruby/ext/dl/test> 

In other words, it looks like I have linked against the wrong "libc" -- a 32-bit one! Could that be what's happening on the 64-bit Red Hat systems too? I think the "libc" should be "/lib64/libc.so.6":

znmeb@DreamScape:~/Packages> locate libc.so
/lib/libc.so.6
/lib64/libc.so.6
/usr/lib64/libc.so
znmeb@DreamScape:~/Packages> file /lib/libc.so.6
/lib/libc.so.6: symbolic link to `libc-2.9.so'
znmeb@DreamScape:~/Packages> file /lib64/libc.so.6
/lib64/libc.so.6: symbolic link to `libc-2.9.so'
znmeb@DreamScape:~/Packages> file /usr/lib64/libc.so
/usr/lib64/libc.so: ASCII C program text
znmeb@DreamScape:~/Packages> file /lib/libc-2.9.so 
/lib/libc-2.9.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), stripped
znmeb@DreamScape:~/Packages> file /lib64/libc-2.9.so 
/lib64/libc-2.9.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), stripped
znmeb@DreamScape:~/Packages> 


I'm attaching the output of the "make" step if that's any help. Incidentally, the default installed Ruby on openSUSE 11.1 is 1.8.7:

znmeb@DreamScape:~/Packages> which ruby
/usr/bin/ruby
znmeb@DreamScape:~/Packages> ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
znmeb@DreamScape:~/Packages> 




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

----------------------------------------
http://redmine.ruby-lang.org