From: Kazuhiko Date: 2003-12-26T10:46:18+09:00 Subject: [ruby-list:38999] Re: RubyEB が ruby-1.8.1 で SEGV かずひこです。 At Fri, 26 Dec 2003 10:01:15 +0900, Yukihiro Matsumoto wrote: > valgrind ruby > > の出力を見せてください。 # 環境についてさらにいい忘れていましたが、eb library (4.0beta3) も、- # -enable-pthreads つきでビルドしています。 valgrind-2.0.0 を使って、test.rb のケース (止まってしまう) では以下のよ うな出力になりました。 ==2544== Invalid write of size 4 ==2544== at 0x40227A99: __pthread_mutex_init (vg_libpthread.c:934) ==2544== by 0x41790F5F: eb_initialize_lock (in /usr/lib/libeb.so.8.0.0) ==2544== by 0x8066855: call_cfunc (eval.c:4929) ==2544== by 0x805BA8C: rb_call0 (eval.c:5066) ==2544== Address 0x415EFA04 is 4 bytes after a block of size 3372 alloc'd ==2544== at 0x40027BCE: malloc (vg_replace_malloc.c:153) ==2544== by 0x806AC81: ruby_xmalloc (gc.c:116) ==2544== by 0x4083D7CE: reb_initialize (eb.c:140) ==2544== by 0x8066855: call_cfunc (eval.c:4929) ==2544== ==2544== Invalid write of size 4 ==2544== at 0x40227AA0: __pthread_mutex_init (vg_libpthread.c:935) ==2544== by 0x41790F5F: eb_initialize_lock (in /usr/lib/libeb.so.8.0.0) ==2544== by 0x8066855: call_cfunc (eval.c:4929) ==2544== by 0x805BA8C: rb_call0 (eval.c:5066) ==2544== Address 0x415EFA08 is 8 bytes after a block of size 3372 alloc'd ==2544== at 0x40027BCE: malloc (vg_replace_malloc.c:153) ==2544== by 0x806AC81: ruby_xmalloc (gc.c:116) ==2544== by 0x4083D7CE: reb_initialize (eb.c:140) ==2544== by 0x8066855: call_cfunc (eval.c:4929) ==2544== ==2544== Invalid write of size 4 ==2544== at 0x40227AA7: __pthread_mutex_init (vg_libpthread.c:936) ==2544== by 0x41790F5F: eb_initialize_lock (in /usr/lib/libeb.so.8.0.0) ==2544== by 0x8066855: call_cfunc (eval.c:4929) ==2544== by 0x805BA8C: rb_call0 (eval.c:5066) ==2544== Address 0x415EFA0C is 12 bytes after a block of size 3372 alloc'd ==2544== at 0x40027BCE: malloc (vg_replace_malloc.c:153) ==2544== by 0x806AC81: ruby_xmalloc (gc.c:116) ==2544== by 0x4083D7CE: reb_initialize (eb.c:140) ==2544== by 0x8066855: call_cfunc (eval.c:4929) ==2544== ==2544== Invalid write of size 4 ==2544== at 0x40227A99: __pthread_mutex_init (vg_libpthread.c:934) ==2544== by 0x41790F6C: eb_initialize_lock (in /usr/lib/libeb.so.8.0.0) ==2544== by 0x8066855: call_cfunc (eval.c:4929) ==2544== by 0x805BA8C: rb_call0 (eval.c:5066) ==2544== Address 0x415EFA1C is not stack'd, malloc'd or free'd ==2544== ==2544== Invalid write of size 4 ==2544== at 0x40227AA0: __pthread_mutex_init (vg_libpthread.c:935) ==2544== by 0x41790F6C: eb_initialize_lock (in /usr/lib/libeb.so.8.0.0) ==2544== by 0x8066855: call_cfunc (eval.c:4929) ==2544== by 0x805BA8C: rb_call0 (eval.c:5066) ==2544== Address 0x415EFA20 is not stack'd, malloc'd or free'd ==2544== ==2544== Invalid write of size 4 ==2544== at 0x40227AA7: __pthread_mutex_init (vg_libpthread.c:936) ==2544== by 0x41790F6C: eb_initialize_lock (in /usr/lib/libeb.so.8.0.0) ==2544== by 0x8066855: call_cfunc (eval.c:4929) ==2544== by 0x805BA8C: rb_call0 (eval.c:5066) ==2544== Address 0x415EFA24 is not stack'd, malloc'd or free'd valgrind: vg_malloc2.c:632 (unlinkBlock): Assertion `get_next_p(b) == b' failed. sched status: Thread 1: status = Runnable, associated_mx = 0x0, associated_cv = 0x0 ==2544== at 0x40027BCE: malloc (vg_replace_malloc.c:153) ==2544== by 0x806AC81: ruby_xmalloc (gc.c:116) ==2544== by 0x4083D80D: reb_initialize (eb.c:143) ==2544== by 0x8066855: call_cfunc (eval.c:4929) ちなみに、--enable-pthreads なしの ruby-1.8.1 (止まらずにちゃんと動作す る) ではこんな感じの出力でした。 ==2592== Invalid write of size 4 ==2592== at 0x417160E3: eb_initialize_alt_caches (in /usr/lib/libeb.so.8.0.0) ==2592== by 0x40277143: call_cfunc (in /usr/lib/libruby.so.1.8.1) ==2592== by 0x40269DE5: rb_call0 (in /usr/lib/libruby.so.1.8.1) ==2592== by 0x4026A7D9: rb_call (in /usr/lib/libruby.so.1.8.1) ==2592== Address 0x41587C98 is not stack'd, malloc'd or free'd valgrind: vg_malloc2.c:466 (bszW_to_pszW): Assertion `pszW >= 0' failed. sched status: Thread 1: status = Runnable, associated_mx = 0x0, associated_cv = 0x0 ==2592== at 0x40027BCE: malloc (vg_replace_malloc.c:153) ==2592== by 0x4027C144: ruby_xmalloc (in /usr/lib/libruby.so.1.8.1) ==2592== by 0x402D4C58: ruby_strdup (in /usr/lib/libruby.so.1.8.1) ==2592== by 0x402A5B06: rb_intern (in /usr/lib/libruby.so.1.8.1) なお、SEGV になる方での出力はもっと長くなりますが、そちらもお送りするほ うがよろしいでしょうか? よろしくお願いします。 -- かずひこ ★シャア「名字が付いてない」 ☆一兵卒「あんなの飾りです。偉い人にはそれが分からんのです」