>>>>> In [ruby-dev : No.22396] 
>>>>>	matz / ruby-lang.org (Yukihiro Matsumoto) wrote:
> ところでこの問題に遭遇した人はpthreadライブラリにバージョン
> など関する情報を教えてください。私は
>
>   glibc-2.3.2.ds1-10
>
> に含まれるLinuxThreadで遭遇しました。

Tcl/Tk 8.0.5、8.2.3、8.3.5、8.4.5で試してみました。

linux kernel 2.6.0、glibc 2.3.2.ds1-10です。
configure時に--enable-pthreadを指定しています。

参考になるかどうかわかりませんがbacktraceを以下に。
tk-test.rbは[ruby-dev:22400]のスクリプトです。


Tcl/Tk 8.0.5 (gdb) run tk-test.rb Starting program: /tmp/r18-8.0/bin/ruby tk-test.rb [New Thread 1075581056 (LWP 17387)] "8.0" Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1075581056 (LWP 17387)] 0x080acd64 in st_lookup (table=0x814f378, key=9545, value=0x0) at st.c:258 258 hash_val = do_hash(key, table); (gdb) bt #0 0x080acd64 in st_lookup (table=0x814f378, key=9545, value=0x0) at st.c:258 #1 0x080bb2ec in rb_ivar_defined (obj=0, id=9545) at variable.c:1014 #2 0x080caad9 in exc_backtrace (exc=1076200380) at error.c:475 #3 0x08068031 in call_cfunc (func=0x80caab0 <exc_backtrace>, recv=1076200380, len=135590776, argc=9545, argv=0x0) at eval.c:4935 #4 0x0805c267 in rb_call0 (klass=1075771252, recv=1076200380, id=4785, oid=0, argc=0, argv=0x0, body=0x401ef634, nosuper=0) at eval.c:5066 #5 0x0805caa8 in rb_call (klass=1075771252, recv=1076200380, mid=4785, argc=0, argv=0x0, scope=1) at eval.c:5287 #6 0x0805cdd1 in rb_funcall (recv=1076200380, mid=0, n=0) at ruby.h:631 #7 0x080532c4 in get_backtrace (info=1076200380) at eval.c:1062 #8 0x08059d74 in rb_longjmp (tag=6, mesg=1076200380) at eval.c:3990 #9 0x08059fe9 in rb_exc_raise (mesg=0) at eval.c:4041 #10 0x0805d68c in eval (self=1075780112, src=0, scope=4, file=0x81bbf21 "(eval)", line=762) at eval.c:5649 #11 0x080540c9 in rb_eval_string (str=0x0) at eval.c:1490 #12 0x0805b669 in rb_rescue2 (b_proc=0x8054070 <rb_eval_string>, data1=0, r_proc=0x402ee5b0 <ip_ruby_eval_rescue>, data2=0) at eval.c:4629 #13 0x402ee642 in ip_ruby_eval_body (arg=0x814f378) at tcltklib.c:772 #14 0x0805b87c in rb_ensure (b_proc=0x402ee5d0 <ip_ruby_eval_body>, data1=0, e_proc=0x402ee650 <ip_ruby_eval_ensure>, data2=0) at eval.c:4717 #15 0x402ee715 in ip_ruby (clientData=0x0, interp=0x817ea58, argc=0, argv=0x0) at tcltklib.c:822 #16 0x403ef614 in TclExecuteByteCode () from /usr/lib/libtcl8.0.so.1 #17 0x403d19da in Tcl_EvalObj () from /usr/lib/libtcl8.0.so.1 #18 0x404139ae in TclObjInterpProc () from /usr/lib/libtcl8.0.so.1 #19 0x403ef614 in TclExecuteByteCode () from /usr/lib/libtcl8.0.so.1 #20 0x403d19da in Tcl_EvalObj () from /usr/lib/libtcl8.0.so.1 #21 0x403d184f in Tcl_Eval () from /usr/lib/libtcl8.0.so.1 #22 0x403d33d6 in Tcl_GlobalEval () from /usr/lib/libtcl8.0.so.1 #23 0x40317d63 in Tk_BindEvent () from /usr/lib/libtk8.0.so.1 #24 0x4031cdee in TkBindEventProc () from /usr/lib/libtk8.0.so.1 #25 0x40321099 in Tk_HandleEvent () from /usr/lib/libtk8.0.so.1 #26 0x40321695 in TkQueueEventForAllChildren () from /usr/lib/libtk8.0.so.1 #27 0x4040cc98 in Tcl_ServiceEvent () from /usr/lib/libtcl8.0.so.1 #28 0x4040cf26 in Tcl_DoOneEvent () from /usr/lib/libtcl8.0.so.1 #29 0x402edae8 in lib_eventloop_core (check_root=1, check_var=0x0) at tcltklib.c:426 #30 0x402ede14 in lib_eventloop_main (check_rootwidget=2) at tcltklib.c:520 #31 0x0805b87c in rb_ensure (b_proc=0x402edde0 <lib_eventloop_main>, data1=0, e_proc=0x402ede30 <lib_eventloop_ensure>, data2=0) at eval.c:4717 #32 0x402ee019 in lib_eventloop_launcher (check_rootwidget=0) at tcltklib.c:555 #33 0x402ee09d in lib_mainloop (argc=0, argv=0x0, self=1076620980) at tcltklib.c:576 #34 0x0806802a in call_cfunc (func=0x402ee050 <lib_mainloop>, recv=1076620980, len=135590776, argc=9545, argv=0xbfffc7e8) at eval.c:4932 #35 0x0805c267 in rb_call0 (klass=1076620740, recv=1076620980, id=10361, oid=0, argc=1, argv=0xbfffc7e8, body=0x402bedb0, nosuper=0) at eval.c:5066 #36 0x0805caa8 in rb_call (klass=1076620740, recv=1076620980, mid=10361, argc=1, argv=0xbfffc7e8, scope=0) at eval.c:5287 #37 0x08057a9e in rb_eval (self=1076611900, n=0x0) at ruby.h:631 #38 0x0805c422 in rb_call0 (klass=1076618260, recv=1076611900, id=10361, oid=0, argc=0, argv=0x0, body=0x401c75a8, nosuper=0) at eval.c:5194 #39 0x0805caa8 in rb_call (klass=1076618260, recv=1076611900, mid=10361, argc=0, argv=0x0, scope=0) at eval.c:5287 #40 0x08057a9e in rb_eval (self=1075780112, n=0x0) at ruby.h:631 #41 0x08053f56 in ruby_exec () at eval.c:1436 #42 0x08053fa0 in ruby_run () at eval.c:1457 #43 0x080520f5 in main (argc=0, argv=0x0, envp=0xbfffe2b0) at main.c:50
Tcl/Tk 8.2.3 入力の仕方やタイミングによって(?) segvする場合とハングアップする場合がある。 (gdb) run tk-test.rb Starting program: /tmp/r18-8.2/bin/ruby tk-test.rb [New Thread 1075581056 (LWP 17452)] "8.2" Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1075581056 (LWP 17452)] 0x4040a686 in Tcl_HashStats () from /usr/lib/libtcl8.2.so.1 (gdb) bt #0 0x4040a686 in Tcl_HashStats () from /usr/lib/libtcl8.2.so.1 #1 0x4032ab71 in Tk_GetGC () from /usr/lib/libtk8.2.so.1 #2 0x40391cad in TkTextFreeDInfo () from /usr/lib/libtk8.2.so.1 #3 0x40392041 in TkTextFreeDInfo () from /usr/lib/libtk8.2.so.1 #4 0x403926ea in TkTextFreeDInfo () from /usr/lib/libtk8.2.so.1 #5 0x40395927 in TkTextPixelIndex () from /usr/lib/libtk8.2.so.1 #6 0x4039af02 in TkTextPickCurrent () from /usr/lib/libtk8.2.so.1 #7 0x403936d6 in TkTextFreeDInfo () from /usr/lib/libtk8.2.so.1 #8 0x4042a34b in TclServiceIdle () from /usr/lib/libtcl8.2.so.1 #9 0x4041bf5d in Tcl_DoOneEvent () from /usr/lib/libtcl8.2.so.1 #10 0x402edca8 in lib_eventloop_core (check_root=1, check_var=0x0) at tcltklib.c:426 #11 0x402edfd4 in lib_eventloop_main (check_rootwidget=2) at tcltklib.c:520 #12 0x0805b87c in rb_ensure (b_proc=0x402edfa0 <lib_eventloop_main>, data1=135918908, e_proc=0x402edff0 <lib_eventloop_ensure>, data2=135918908) at eval.c:4717 #13 0x402ee1d9 in lib_eventloop_launcher (check_rootwidget=135918908) at tcltklib.c:555 #14 0x402ee25d in lib_mainloop (argc=135918908, argv=0x819f53c, self=1076620980) at tcltklib.c:576 #15 0x0806802a in call_cfunc (func=0x402ee210 <lib_mainloop>, recv=1076620980, len=-1073759012, argc=136928448, argv=0xbfffc748) at eval.c:4932 #16 0x0805c267 in rb_call0 (klass=1076620740, recv=1076620980, id=10361, oid=135918908, argc=1, argv=0xbfffc748, body=0x402bedb0, nosuper=0) at eval.c:5066 #17 0x0805caa8 in rb_call (klass=1076620740, recv=1076620980, mid=10361, argc=1, argv=0xbfffc748, scope=0) at eval.c:5287 #18 0x08057a9e in rb_eval (self=1076611900, n=0x819f53c) at ruby.h:631 #19 0x0805c422 in rb_call0 (klass=1076618260, recv=1076611900, id=10361, oid=135918908, argc=0, argv=0x0, body=0x401c75a8, nosuper=0) at eval.c:5194 #20 0x0805caa8 in rb_call (klass=1076618260, recv=1076611900, mid=10361, argc=0, argv=0x0, scope=0) at eval.c:5287 #21 0x08057a9e in rb_eval (self=1075780112, n=0x819f53c) at ruby.h:631 #22 0x08053f56 in ruby_exec () at eval.c:1436 #23 0x08053fa0 in ruby_run () at eval.c:1457 #24 0x080520f5 in main (argc=135918908, argv=0x819f53c, envp=0xbfffe210) at main.c:50
Tcl/Tk 8.3.5 入力の仕方やタイミングによって(?) segv、ハングアップ、X Error of failed request: BadValue (integer parameter out of range for operation) のいずれかになる。 (gdb) run tk-test.rb The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /tmp/r18-8.3/bin/ruby tk-test.rb [New Thread 1075581056 (LWP 17606)] "8.3" Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1075581056 (LWP 17606)] 0xffffffff in ?? () (gdb) bt #0 0xffffffff in ?? () #1 0x403927c2 in TkTextFreeDInfo () from /usr/lib/libtk8.3.so.1 #2 0x403929c3 in TkTextFreeDInfo () from /usr/lib/libtk8.3.so.1 #3 0x40395f00 in TkTextPixelIndex () from /usr/lib/libtk8.3.so.1 #4 0x4039b5ae in TkTextPickCurrent () from /usr/lib/libtk8.3.so.1 #5 0x40393ba1 in TkTextFreeDInfo () from /usr/lib/libtk8.3.so.1 #6 0x40416e8d in TclServiceIdle () from /usr/lib/libtcl8.3.so.1 #7 0x404093b6 in Tcl_DoOneEvent () from /usr/lib/libtcl8.3.so.1 #8 0x402edca8 in lib_eventloop_core (check_root=1, check_var=0x0) at tcltklib.c:426 #9 0x402edfd4 in lib_eventloop_main (check_rootwidget=2) at tcltklib.c:520 #10 0x0805b87c in rb_ensure (b_proc=0x402edfa0 <lib_eventloop_main>, data1=350, e_proc=0x402edff0 <lib_eventloop_ensure>, data2=350) at eval.c:4717 #11 0x402ee1d9 in lib_eventloop_launcher (check_rootwidget=350) at tcltklib.c:555 #12 0x402ee25d in lib_mainloop (argc=350, argv=0x15e, self=1076620980) at tcltklib.c:576 #13 0x0806802a in call_cfunc (func=0x402ee210 <lib_mainloop>, recv=1076620980, len=137090016, argc=0, argv=0xbfffda48) at eval.c:4932 #14 0x0805c267 in rb_call0 (klass=1076620740, recv=1076620980, id=10361, oid=350, argc=1, argv=0xbfffda48, body=0x402bedb0, nosuper=0) at eval.c:5066 #15 0x0805caa8 in rb_call (klass=1076620740, recv=1076620980, mid=10361, argc=1, argv=0xbfffda48, scope=0) at eval.c:5287 #16 0x08057a9e in rb_eval (self=1076611900, n=0x15e) at ruby.h:631 #17 0x0805c422 in rb_call0 (klass=1076618260, recv=1076611900, id=10361, oid=350, argc=0, argv=0x0, body=0x401c75a8, nosuper=0) at eval.c:5194 #18 0x0805caa8 in rb_call (klass=1076618260, recv=1076611900, mid=10361, argc=0, argv=0x0, scope=0) at eval.c:5287 #19 0x08057a9e in rb_eval (self=1075780112, n=0x15e) at ruby.h:631 #20 0x08053f56 in ruby_exec () at eval.c:1436 #21 0x08053fa0 in ruby_run () at eval.c:1457 #22 0x080520f5 in main (argc=350, argv=0x15e, envp=0xbffff510) at main.c:50
Tcl/Tk 8.4.5 (gdb) run ~/tk-test.rb Starting program: /tmp/r18-8.4/bin/ruby ~/tk-test.rb [New Thread 16384 (LWP 18020)] [New Thread 32769 (LWP 18024)] [New Thread 16386 (LWP 18025)] "8.4" Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 18020)] _int_malloc (av=0x401ebd00, bytes=12) at malloc.c:3774 3774 malloc.c: そのようなファイルやディレクトリはありません. in malloc.c (gdb) bt #0 _int_malloc (av=0x401ebd00, bytes=12) at malloc.c:3774 #1 0x4012cd33 in __libc_malloc (bytes=16) at malloc.c:3293 #2 0x0806d0b5 in ruby_xmalloc (size=16) at gc.c:116 #3 0x080ace99 in st_insert (table=0x83650c8, key=11482, value=1076827724) at st.c:301 #4 0x080bb216 in rb_ivar_set (obj=1076824764, id=11482, val=1076827724) at variable.c:996 #5 0x08057449 in rb_eval (self=1076824764, n=0xc) at eval.c:3280 #6 0x0805c422 in rb_call0 (klass=1076796884, recv=1076824764, id=2961, oid=12, argc=0, argv=0xbfff4edc, body=0x402006a4, nosuper=0) at eval.c:5194 #7 0x0805caa8 in rb_call (klass=1076796884, recv=1076824764, mid=2961, argc=29, argv=0xbfff4e68, scope=1) at eval.c:5287 #8 0x0805ce5e in rb_funcall2 (recv=1075756300, mid=12, argc=12, argv=0xc) at ruby.h:631 #9 0x0805f458 in rb_obj_call_init (obj=12, argc=12, argv=0xc) at eval.c:6429 #10 0x08083c6c in rb_class_new_instance (argc=12, argv=0xc, klass=12) at object.c:849 #11 0x0806802a in call_cfunc (func=0x8083c40 <rb_class_new_instance>, recv=1076796884, len=1075756300, argc=72, argv=0xbfff4e68) at eval.c:4932 #12 0x0805c267 in rb_call0 (klass=1075965176, recv=1076796884, id=3369, oid=12, argc=29, argv=0xbfff4e68, body=0x4021db3c, nosuper=0) at eval.c:5066 #13 0x0805caa8 in rb_call (klass=1075965176, recv=1076796884, mid=3369, argc=29, argv=0xbfff4e68, scope=0) at eval.c:5287 #14 0x08057a9e in rb_eval (self=1076792124, n=0xc) at ruby.h:631 #15 0x08057b4d in rb_eval (self=1076792124, n=0xc) at ruby.h:636 #16 0x0805a5ab in rb_yield_0 (val=1076825184, self=1076792124, klass=0, flags=1, avalue=2) at eval.c:4293 #17 0x08061432 in proc_invoke (proc=1076389524, args=1076825184, self=6, klass=3221186264) at ruby.h:631 #18 0x080614c7 in proc_call (proc=12, args=12) at eval.c:7232 #19 0x08068002 in call_cfunc (func=0x80614a0 <proc_call>, recv=1076389524, len=1075756300, argc=72, argv=0x83799f0) at eval.c:4929 #20 0x0805c267 in rb_call0 (klass=1075902356, recv=1076389524, id=5193, oid=12, argc=29, argv=0x83799f0, body=0x4020f708, nosuper=0) at eval.c:5066 #21 0x0805caa8 in rb_call (klass=1075902356, recv=1076389524, mid=5193, argc=29, argv=0x83799f0, scope=1) at eval.c:5287 #22 0x0805ce5e in rb_funcall2 (recv=1075756300, mid=12, argc=12, argv=0xc) at ruby.h:631 #23 0x08054664 in rb_eval_cmd (cmd=1076389524, arg=1076825304, tcheck=0) at eval.c:1643 #24 0x407d79b6 in tk_eval_cmd (argc=12, argv=0xc) at tkutil.c:21 #25 0x0806802a in call_cfunc (func=0x407d7960 <tk_eval_cmd>, recv=1076798684, len=1075756300, argc=72, argv=0xbfff7198) at eval.c:4932 #26 0x0805c267 in rb_call0 (klass=1076798624, recv=1076798684, id=11817, oid=12, argc=30, argv=0xbfff7198, body=0x402ea48c, nosuper=0) at eval.c:5066 #27 0x0805caa8 in rb_call (klass=1076798624, recv=1076798684, mid=11817, argc=30, argv=0xbfff7198, scope=0) at eval.c:5287 #28 0x08057a9e in rb_eval (self=1076794604, n=0xc) at ruby.h:631 #29 0x08057b4d in rb_eval (self=1076794604, n=0xc) at ruby.h:636 #30 0x0805c422 in rb_call0 (klass=1076794584, recv=1076794604, id=12177, oid=12, argc=29, argv=0xbfff8a6c, body=0x401f8e7c, nosuper=0) at eval.c:5194 #31 0x0805caa8 in rb_call (klass=1076794584, recv=1076794604, mid=12177, argc=30, argv=0xbfff8a68, scope=0) at eval.c:5287 #32 0x08057a9e in rb_eval (self=1076389384, n=0xc) at ruby.h:631 #33 0x0805c422 in rb_call0 (klass=1076794404, recv=1076389384, id=5193, oid=12, argc=29, argv=0xbfff9848, body=0x401f9b10, nosuper=0) at eval.c:5194 #34 0x0805caa8 in rb_call (klass=1076794404, recv=1076389384, mid=5193, argc=29, argv=0xbfff9848, scope=0) at eval.c:5287 #35 0x08057a9e in rb_eval (self=1076798484, n=0xc) at ruby.h:631 #36 0x0805c422 in rb_call0 (klass=1076794664, recv=1076798484, id=12305, oid=12, argc=0, argv=0xbfffa63c, body=0x401f7c20, nosuper=0) at eval.c:5194 #37 0x0805caa8 in rb_call (klass=1076794664, recv=1076798484, mid=12305, argc=1, argv=0xbfffa638, scope=0) at eval.c:5287 #38 0x08057a9e in rb_eval (self=1075960336, n=0xc) at ruby.h:631 #39 0x0805d811 in eval (self=1075960336, src=12, scope=4, file=0x819d6e1 "(eval)", line=762) at eval.c:5603 #40 0x080540c9 in rb_eval_string (str=0xc <Address 0xc out of bounds>) at eval.c:1490 #41 0x0805b669 in rb_rescue2 (b_proc=0x8054070 <rb_eval_string>, data1=12, r_proc=0x4031a790 <ip_ruby_eval_rescue>, data2=12) at eval.c:4629 #42 0x4031a822 in ip_ruby_eval_body (arg=0x401ebd0c) at tcltklib.c:772 #43 0x0805b87c in rb_ensure (b_proc=0x4031a7b0 <ip_ruby_eval_body>, data1=12, e_proc=0x4031a830 <ip_ruby_eval_ensure>, data2=12) at eval.c:4717 #44 0x4031a8f5 in ip_ruby (clientData=0x0, interp=0x81bb430, argc=12, argv=0xc) at tcltklib.c:822 #45 0x4042a464 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so.0 #46 0x40451115 in TclCompEvalObj () from /usr/lib/libtcl8.4.so.0 #47 0x40450733 in TclCompEvalObj () from /usr/lib/libtcl8.4.so.0 #48 0x40482fdf in TclObjInterpProc () from /usr/lib/libtcl8.4.so.0 #49 0x4042a464 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so.0 #50 0x4042b004 in Tcl_EvalEx () from /usr/lib/libtcl8.4.so.0 #51 0x4042b48b in Tcl_Eval () from /usr/lib/libtcl8.4.so.0 #52 0xbfffc34c in ?? () #53 0x00000084 in ?? ()
以上です。 -- やまだあきら / akira yamada <URL:http://arika.org> Vine Caves, Ltd. <URL:http://vinecaves.com> (akira / arika.org, akira / debian.org or akira / vinecaves.com)