From: Tanaka Akira Date: 2003-12-05T12:49:17+09:00 Subject: [ruby-dev:22144] core dump with ObjectSpace.each_object. 次のように core を吐くことがあります。 % cat x.rb at_exit { ObjectSpace.each_object(Object) {|o| } } require 'test/unit' require 'tempfile' class T < Test::Unit::TestCase def test_eof_0 f = Tempfile.new("test1") f = Tempfile.new("test2") end end % ruby x.rb Loaded suite x Started . Finished in 0.035467 seconds. 1 tests, 0 assertions, 0 failures, 0 errors zsh: segmentation fault (core dumped) ruby x.rb % gdb =ruby core GNU gdb 5.3-debian Copyright 2002 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 "i386-linux"... Core was generated by `ruby x.rb'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/libcrypt.so.1...done. Loaded symbols for /lib/libcrypt.so.1 Reading symbols from /lib/libm.so.6...done. Loaded symbols for /lib/libm.so.6 Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 #0 0x080aa5eb in st_lookup (table=0xa, key=2889, value=0xbffff388) at st.c:258 258 hash_val = do_hash(key, table); (gdb) p key $1 = 2889 (gdb) p table $2 = (st_table *) 0xa (gdb) where #0 0x080aa5eb in st_lookup (table=0xa, key=2889, value=0xbffff388) at st.c:258 #1 0x080b5bb4 in classname (klass=1075568216) at variable.c:152 #2 0x080b5cf1 in rb_class_path (klass=1075568216) at variable.c:184 #3 0x080b6021 in rb_class2name (klass=1075568216) at variable.c:281 #4 0x080b6089 in rb_obj_classname (obj=1075568296) at variable.c:288 #5 0x080c3cb9 in rb_check_type (x=1075568296, t=34) at error.c:258 #6 0x080601b8 in proc_invoke (proc=1075568296, args=1075764540, self=6, klass=0) at eval.c:7126 #7 0x0805ee2e in call_end_proc (data=1075568296) at eval.c:6574 #8 0x0805f08d in rb_exec_end_proc () at eval.c:6634 #9 0x0805370d in ruby_finalize_0 () at eval.c:1343 #10 0x0805377f in ruby_cleanup (ex=0) at eval.c:1371 #11 0x08053974 in ruby_stop (ex=0) at eval.c:1418 #12 0x080539ba in ruby_run () at eval.c:1430 #13 0x08051e66 in main (argc=2, argv=0xbffff9a4, envp=0xbffff9b0) at main.c:50 #14 0x40084e3e in __libc_start_main () from /lib/libc.so.6 (gdb) -- [田中 哲][たなか あきら][Tanaka Akira]