From: Tanaka Akira Date: 2004-11-08T00:00:06+09:00 Subject: [ruby-dev:24738] Dir.glob dumps core again 次のようにすると core を吐きます。 % ./ruby -w -d -e ' o = Object.new def o.write(s) $pat.clear callcc {|k| $k = k } STDERR.puts s.inspect end $stderr = o $pat = "/tmp/**/*" + "\0" * 0x20000 Dir.glob($pat, File::FNM_CASEFOLD) {|f| p f }' "-e:10: warning: Dir.glob() ignores File::FNM_CASEFOLD\n" -e:10: [BUG] Segmentation fault ruby 1.9.0 (2004-11-06) [i686-linux] zsh: abort (core dumped) ./ruby -w -d -e % gdb ruby core GNU gdb 6.1-debian 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 "i386-linux"...Using host libthread_db library "/lib/libthread_db.so.1". Core was generated by `./ruby -w -d -e o = Object.new def o.write(s) $pat.clear callcc {|k| $k ='. Program terminated with signal 6, Aborted. 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 0x4009e6b1 in kill () from /lib/libc.so.6 (gdb) bt #0 0x4009e6b1 in kill () from /lib/libc.so.6 #1 0x4009e435 in raise () from /lib/libc.so.6 #2 0x4009f978 in abort () from /lib/libc.so.6 #3 0x080d4e96 in rb_bug (fmt=0x0) at error.c:214 #4 0x080b1fa2 in sigsegv (sig=11) at signal.c:446 #5 #6 rb_glob2 (path=0x401fa008
, flags=0, func=0x4, arg=4) at dir.c:1374 #7 0x080d2ac2 in push_glob (ary=1075607576, s=0x401fa008
, flags=8) at dir.c:1460 #8 0x080d2b83 in rb_push_glob (str=1075945489, flags=8) at dir.c:1482 #9 0x080d2c05 in dir_s_glob (argc=4, argv=0x4, obj=1075626216) at dir.c:1588 #10 0x0806a81a in call_cfunc (func=0x80d2bc0 , recv=1075626216, len=1075609336, argc=0, argv=0xbfffeaa8) at eval.c:5365 #11 0x0805e767 in rb_call0 (klass=1075626196, recv=1075626216, id=8625, oid=4, argc=2, argv=0xbfffeaa8, body=0x401cbd14, nosuper=0) at eval.c:5506 #12 0x0805ea18 in rb_call (klass=1075626196, recv=1075626216, mid=8625, argc=2, argv=0xbfffeaa8, scope=0) at eval.c:5727 #13 0x08059888 in rb_eval (self=1075673536, n=0x4) at ruby.h:633 #14 0x08058c38 in rb_eval (self=1075673536, n=0x4) at eval.c:2920 #15 0x08055dbd in ruby_exec_internal () at eval.c:1456 #16 0x08055dd6 in ruby_exec () at eval.c:1474 #17 0x08055e20 in ruby_run () at eval.c:1491 #18 0x08053e45 in main (argc=4, argv=0x4, envp=0xbffff8dc) at main.c:38 (gdb) -- [田中 哲][たなか あきら][Tanaka Akira]