From: "KISHIMOTO, Makoto" Date: 2010-05-27T19:05:53+09:00 Subject: [ruby-dev:41434] エンコードを指定してread中にCtrl-Cで落ちる きしもとです 大きなファイルを、エンコードを指定してread中に、Ctrl-Cで止めると、コアを吐きます。 バックトレースを添付します。手元の環境で再現性は必ずしもありません。(3回に2回ぐらい?) $ cat foo.rb #!/usr/local/bin/ruby19 txt = open("foo.txt", "r:EUC-JP").read $ ./foo.rb ^C./foo.rb:3: [BUG] pthread_mutex_lock: Resource deadlock avoided (EDEADLK) ruby 1.9.3dev (2010-05-27 trunk 28032) [x86_64-freebsd8.0] -- control frame ---------- c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :read c:0003 p:0019 s:0007 b:0007 l:0026e8 d:001560 EVAL ./foo.rb:3 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:0026e8 d:0026e8 TOP --------------------------- -- Ruby level backtrace information ---------------------------------------- ./foo.rb:3:in `
' ./foo.rb:3:in `read' [NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html Abort trap: 6 (core dumped) $ gdb ruby19 ruby19.core GNU gdb 6.1.1 [FreeBSD] 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 "amd64-marcel-freebsd"... Core was generated by `ruby19'. Program terminated with signal 6, Aborted. Reading symbols from /usr/local/lib/libruby.so.19...done. Loaded symbols for /usr/local/lib/libruby.so.19 Reading symbols from /lib/libthr.so.3...done. Loaded symbols for /lib/libthr.so.3 Reading symbols from /usr/lib/librt.so.1...done. Loaded symbols for /usr/lib/librt.so.1 Reading symbols from /lib/libcrypt.so.5...done. Loaded symbols for /lib/libcrypt.so.5 Reading symbols from /lib/libm.so.5...done. Loaded symbols for /lib/libm.so.5 Reading symbols from /lib/libc.so.7...done. Loaded symbols for /lib/libc.so.7 Reading symbols from /usr/local/lib/ruby/1.9.1/x86_64-freebsd8.0/enc/encdb.so...done. Loaded symbols for /usr/local/lib/ruby/1.9.1/x86_64-freebsd8.0/enc/encdb.so Reading symbols from /usr/local/lib/ruby/1.9.1/x86_64-freebsd8.0/enc/trans/transdb.so...done. Loaded symbols for /usr/local/lib/ruby/1.9.1/x86_64-freebsd8.0/enc/trans/transdb.so Reading symbols from /usr/local/lib/ruby/1.9.1/x86_64-freebsd8.0/enc/euc_jp.so...done. Loaded symbols for /usr/local/lib/ruby/1.9.1/x86_64-freebsd8.0/enc/euc_jp.so Reading symbols from /libexec/ld-elf.so.1...done. Loaded symbols for /libexec/ld-elf.so.1 #0 0x0000000800dff1ec in thr_kill () from /lib/libc.so.7 [New Thread 80100ae40 (LWP 100268)] [New Thread 8010041c0 (LWP 100264)] (gdb) bt #0 0x0000000800dff1ec in thr_kill () from /lib/libc.so.7 #1 0x0000000800e9aa7b in abort () from /lib/libc.so.7 #2 0x00000008006a1eb8 in rb_bug (fmt=Variable "fmt" is not available. ) at ../error.c:249 #3 0x00000008006a2982 in rb_bug_errno (mesg=0x8007edab3 "pthread_mutex_lock", errno_arg=6) at ../error.c:260 #4 0x00000008007c3e0a in rb_thread_call_with_gvl (func=0x8006bbc50 , data1=0x801014000) at thread_pthread.c:37 #5 0x00000008006bb85c in garbage_collect_with_gvl (objspace=0x801014000) at ../gc.c:627 #6 0x00000008006bb925 in vm_xmalloc (objspace=0x801014000, size=129) at ../gc.c:655 #7 0x0000000800761d56 in rb_str_buf_new (capa=128) at ../string.c:749 #8 0x0000000800754f24 in rb_enc_vsprintf (enc=0x0, fmt=0x8007e2b7e "%s", ap=0x7fffffffe070) at ../sprintf.c:1155 #9 0x00000008006a0f1f in rb_raise (exc=34378188680, fmt=Variable "fmt" is not available. ) at ../error.c:1461 #10 0x00000008006a55b3 in rb_interrupt () at ../eval.c:479 #11 0x00000008007c1c39 in rb_threadptr_execute_interrupts_rec (th=0x80100b600, sched_depth=0) at ../thread.c:1275 #12 0x00000008007c4094 in rb_thread_blocking_region (func=0x8006c1c20 , data1=0x7fffffffe210, ubf=0x8007c0e60 , data2=0x80100b600) at ../thread.c:271 #13 0x00000008006c2b77 in io_fread (str=34377967520, offset=228557400, fptr=0x8012eed00) at ../io.c:589 #14 0x00000008006cc153 in read_all (fptr=0x8012eed00, siz=228558424, str=34377967520) at ../io.c:1789 #15 0x00000008006cc585 in io_read (argc=Variable "argc" is not available. ) at ../io.c:2171 #16 0x00000008007b22c2 in vm_call_method (th=0x80100b600, cfp=0x801143ef8, num=Variable "num" is not available. ) at vm_insnhelper.c:401 #17 0x00000008007b48c1 in vm_exec_core (th=0x80100b600, initial=Variable "initial" is not available. ) at insns.def:999 #18 0x00000008007ba7f0 in vm_exec (th=0x80100b600) at ../vm.c:1139 #19 0x00000008007baaab in rb_iseq_eval_main (iseqval=34377970960) at ../vm.c:1380 #20 0x00000008006a644f in ruby_exec_internal (n=0x801163510) at ../eval.c:214 #21 0x00000008006a6479 in ruby_exec_node (n=0x801163510) at ../eval.c:261 #22 0x00000008006a86cf in ruby_run_node (n=0x801163510) at ../eval.c:254 #23 0x0000000000400922 in main (argc=2, argv=0x7fffffffe938) at ../main.c:35 (gdb) q