From: Yasuhiro Fukuma Date: 1999-05-28T00:57:11+09:00 Subject: [ruby-dev:7009] [BUG?] Segmentation fault 福間@福岡 です。 以下のようにすると落ちます(1.3のほうはきのうcvsupしてきたもの): $ cat bug1.rb Thread.new { sleep } $ ruby-1.3 -v -rbug1 -e 0 ruby 1.3.3 (1999-05-25) [i386-freebsd4.0] /tmp/rbQv3868:1: warning: useless use of a literal in void context /tmp/rbQv3868:1: [BUG] Segmentation fault $ ruby -v -rbug1 -e 0 ruby 1.2.5(99/04/13) [i386-freebsd4.0] /tmp/rbbl3869:1: [BUG] Segmentation fault ちなみに $ ruby-1.3 bug1.rb $ ruby-1.3 -e 'load "bug1.rb"' $ ruby-1.3 -e 'require "bug1"' とかは大丈夫のようです。 使い方のよくわからないgdbでいろいろいじくってみて | (gdb) bt | #0 rb_thread_restore_context (th=0x80c8400, exit=1) at eval.c:6115 | #1 0x805cd9c in stack_extend (th=0x80c8400, exit=1) at eval.c:6056 | #2 0x805ce00 in rb_thread_restore_context (th=0x80c8400, exit=1) | at eval.c:6091 | #3 0x805d71b in rb_thread_schedule () at eval.c:6391 | #4 0x805e7b1 in rb_thread_wait_other_threads () at eval.c:6996 | #5 0x8051311 in ruby_run () at eval.c:1014 | #6 0x804fccd in main (argc=4, argv=0xbfbfd780, envp=0xbfbfd794) at main.c:39 | #7 0x804fc41 in _start () | (gdb) s | 6117 rb_lastline_set(tmp->last_line); | (gdb) bt | #0 rb_thread_restore_context (th=0x80c8400, exit=1) at eval.c:6117 | #1 0x805cd9c in stack_extend (th=0x80b8984, exit=-1077947036) at eval.c:6056 | #2 0x8059ca9 in rb_load (fname=98, wrap=0) at eval.c:4571 | #3 0x722e3167 in ?? () | Error accessing memory address 0x75622f2e: Bad address. | (gdb) p tmp | $1 = 0x80c8400 | (gdb) p *tmp | $2 = {next = 0x80c8100, prev = 0x80c8100, context = {{_jb = {134600437, | 134973828, -1077949780, -1077949560, 135037952, -1077949688, 0, 4735, | 0}}}, result = 0, stk_len = 787, stk_max = 787, stk_ptr = 0x811a000, | stk_pos = 0xbfbfca8c, frame = 0xbfbfcc5c, scope = 0x80ed928, | dyna_vars = 0x80ed84c, block = 0x0, iter = 0xbfbfcc08, tag = 0xbfbfcf08, | klass = 135240984, wrapper = 0, trace = 0, misc = 1, | file = 0x8117d30 "./bug1.rb", line = 1, errinfo = 4, last_status = 4, | last_line = 4, last_match = 4, safe = 0, status = THREAD_TO_KILL, | wait_for = 0, fd = 0, delay = 1e+30, join = 0x0, abort = 0, locals = 0x0, | thread = 135190624} | (gdb) l | 6112 tmp = th; | 6113 ex = exit; | 6114 FLUSH_REGISTER_WINDOWS; | 6115 MEMCPY(tmp->stk_pos, tmp->stk_ptr, VALUE, tmp->stk_len); | 6116 | 6117 rb_lastline_set(tmp->last_line); | 6118 rb_backref_set(tmp->last_match); | 6119 | 6120 switch (ex) { | 6121 case RESTORE_FATAL: あたりが怪しい? というところまでで息切れしています…。 --- Yasuhiro Fukuma (福間 康弘) as Yasu.F @ Kitakyushu.Fukuoka.Japan Web site: http://www8.big.or.jp/~yasuf/ “InterNIC is NOT NSI!”