This is 100% repeatable, but a big program, so no 'small snippet of code which 
exhibits the problem' I'm afraid.

$ sudo gdb /bin/ruby
GNU gdb 6.3
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 "x86_64-unknown-linux-gnu"...Using host 
libthread_db library "/pkg/glibc/lib/libthread_db.so.1".

(gdb) set args -- sbin/heretix --cf ruby version=stable --ec
(gdb) run
Starting program: /bin/ruby -- sbin/heretix --cf ruby version=stable --ec
No config directory found for kernel version 2.6.14
Build settings:  cpu=x86_64  build-jobs=5  make-jobs=4
Building symlink database...
Processing......
  +S ruby                 (version='20051027' cpu='x86_64')
    [ruby]

Elapsed time: 0h 2m 4s

Program received signal SIGSEGV, Segmentation fault.
0x00002aaaab258a09 in __do_global_dtors_aux () 
from /pkg/ruby/lib/ruby/1.8/x86_64-linux/stringio.so
(gdb) bt
#0  0x00002aaaab258a09 in __do_global_dtors_aux () 
from /pkg/ruby/lib/ruby/1.8/x86_64-linux/stringio.so
#1  0x00007fffffdd6da0 in ?? ()
#2  0x00002aaaab25a751 in _fini () 
from /pkg/ruby/lib/ruby/1.8/x86_64-linux/stringio.so
#3  0x0000000000000008 in ?? ()
#4  0x00002aaaaaab5bea in _dl_fini () at dl-fini.c:238
Previous frame inner to this frame (corrupt stack?)
(gdb) l
238     dl-fini.c: No such file or directory.
        in dl-fini.c
(gdb) c
Continuing.
sbin/heretix:452: [BUG] Segmentation fault
ruby 1.8.3 (2005-10-26) [x86_64-linux]

The code is basically

	begin
		[big program]
		exit 0
	end

Replacing exit 0 with Kernel.exit! 0 and all is well. Line 452 (see gdb output 
above) is the exit command.

I can reliably reproduce this on both x86 and x86_64 (64bit kernel/ruby) 
machines.

Let me know if I can do anything else to help locate this problem. Code 
available on request, or ssh access which might be easier.

Andrew Walrond