From: Minero Aoki Date: 2002-01-31T12:53:04+09:00 Subject: [ruby-dev:15819] Re: racc fails on alpha-freebsd あおきです。 In mail "[ruby-dev:15812] Re: racc fails on alpha-freebsd" matz@ruby-lang.org (Yukihiro Matsumoto) wrote: > まつもと ゆきひろです > |Racc が Alpha で落ちるという話の続きですが、完全なスタック > |トレースをいただけたので張り付けます。なにかわかるでしょうか? > > これ? パッチをあてたら落ちる場所が変わったそうです。手強い。 スタックトレース添付。 # 直接やりとりしてもらったほうがいいでしょうか? ------------------------------------------------------------------- 青木峰郎 Program received signal SIGSEGV, Segmentation fault. rb_gc_mark (ptr=0x2a73d7f02123540c) at gc.c:452 452 if (obj->as.basic.flags == 0) return; /* free cell */ (gdb) bt #0 rb_gc_mark (ptr=0x2a73d7f02123540c) at gc.c:452 #1 0x160275338 in rb_gc_mark (ptr=0x2a73d7f02123540c) at gc.c:602 #2 0x160274b14 in mark_locations_array (x=0x1fffdf6a0, n=16501) at gc.c:378 #3 0x160274b94 in rb_gc_mark_locations (start=0x2a73d7f02123540c, end=0x47) at gc.c:397 #4 0x160275ed8 in rb_gc () at gc.c:1009 #5 0x160274908 in rb_newobj () at gc.c:324 #6 0x1602c8e40 in rb_str_new3 (str=4833937384) at string.c:85 #7 0x16025bf30 in rb_eval (self=4833826384, n=0x47) at eval.c:2860 #8 0x16025aa40 in rb_eval (self=4833826384, n=0x47) at eval.c:2522 #9 0x16025a7a0 in rb_eval (self=4833826384, n=0x47) at eval.c:2509 #10 0x1602590a0 in rb_eval (self=4833826384, n=0x47) at eval.c:2011 #11 0x16025e710 in rb_yield_0 (val=163, self=4833826384, klass=0, acheck=0) at eval.c:3601 #12 0x16025e9e0 in rb_yield (val=3059025998262785036) at eval.c:3687 #13 0x160243c88 in rb_ary_each (ary=4833871704) at array.c:630 #14 0x160260624 in call_cfunc (func=0x160243c40 , recv=4833871704, len=537935872, argc=0, argv=0x0) at eval.c:4227 #15 0x160260e1c in rb_call0 (klass=4833268472, recv=4833871704, id=3569, argc=0, argv=0x0, body=0x12015cb50, nosuper=1) at eval.c:4361 #16 0x160261804 in rb_call (klass=4833268472, recv=4833871704, mid=3569, argc=0, argv=0x0, scope=0) at eval.c:4581 #17 0x16025acb4 in rb_eval (self=4833826384, n=0x47) at eval.c:2530 #18 0x160259b20 in rb_eval (self=4833826384, n=0x47) at eval.c:2262 #19 0x1602590a0 in rb_eval (self=4833826384, n=0x47) at eval.c:2011 #20 0x160261314 in rb_call0 (klass=4834391864, recv=4833826384, id=14545, argc=0, argv=0x1fffe4528, body=0x1202014e0, nosuper=0) at eval.c:4488 #21 0x160261804 in rb_call (klass=4834391864, recv=4833826384, mid=14545, argc=3, argv=0x1fffe4510, scope=1) at eval.c:4581 #22 0x16025acb4 in rb_eval (self=4833826384, n=0x47) at eval.c:2530 #23 0x160261314 in rb_call0 (klass=4834391864, recv=4833826384, id=14409, argc=0, argv=0x1fffe59c0, body=0x120203a88, nosuper=0) at eval.c:4488 #24 0x160261804 in rb_call (klass=4834391864, recv=4833826384, mid=14409, argc=3, argv=0x1fffe59a8, scope=1) at eval.c:4581 #25 0x16025acb4 in rb_eval (self=4833826384, n=0x47) at eval.c:2530 #26 0x1602590a0 in rb_eval (self=4833826384, n=0x47) at eval.c:2011 #27 0x160261314 in rb_call0 (klass=4834391864, recv=4833826384, id=14305, argc=0, argv=0x1fffe7e90, body=0x120235240, nosuper=0) at eval.c:4488 #28 0x160261804 in rb_call (klass=4834391864, recv=4833826384, mid=14305, argc=1, argv=0x1fffe7e88, scope=1) at eval.c:4581 #29 0x16025acb4 in rb_eval (self=4833826384, n=0x47) at eval.c:2530 #30 0x1602590a0 in rb_eval (self=4833826384, n=0x47) at eval.c:2011 #31 0x160261314 in rb_call0 (klass=4834391864, recv=4833826384, id=8801, argc=0, argv=0x1fffea308, body=0x1202410e0, nosuper=0) at eval.c:4488 #32 0x160261804 in rb_call (klass=4834391864, recv=4833826384, mid=8801, argc=1, argv=0x1fffea300, scope=0) at eval.c:4581 #33 0x16025acb4 in rb_eval (self=4834253504, n=0x47) at eval.c:2530 #34 0x160261314 in rb_call0 (klass=4834186104, recv=4834253504, id=6185, argc=0, argv=0x1fffeb780, body=0x120249290, nosuper=0) at eval.c:4488 #35 0x160261804 in rb_call (klass=4834186104, recv=4834253504, mid=6185, argc=1, argv=0x1fffeb778, scope=0) at eval.c:4581 #36 0x16025acb4 in rb_eval (self=4833311152, n=0x47) at eval.c:2530 #37 0x16025e710 in rb_yield_0 (val=4, self=4833311152, klass=0, acheck=0) at eval.c:3601 #38 0x16025a018 in rb_eval (self=4833866384, n=0x47) at eval.c:2344 #39 0x1602590a0 in rb_eval (self=4833866384, n=0x47) at eval.c:2011 #40 0x160261314 in rb_call0 (klass=4834383264, recv=4833866384, id=9257, argc=0, argv=0x1fffeefd8, body=0x12013a618, nosuper=0) at eval.c:4488 #41 0x160261804 in rb_call (klass=4834383264, recv=4833866384, mid=9257, argc=2, argv=0x1fffeefc8, scope=0) at eval.c:4581 #42 0x16025acb4 in rb_eval (self=4833311152, n=0x47) at eval.c:2530 #43 0x160259b20 in rb_eval (self=4833311152, n=0x47) at eval.c:2262 #44 0x1602590a0 in rb_eval (self=4833311152, n=0x47) at eval.c:2011 #45 0x16025e710 in rb_yield_0 (val=4833866384, self=4833311152, klass=0, acheck=0) at eval.c:3601 #46 0x16025a018 in rb_eval (self=4833866384, n=0x47) at eval.c:2344 #47 0x16025e710 in rb_yield_0 (val=4833865224, self=4833866384, klass=0, acheck=0) at eval.c:3601 #48 0x16025e9e0 in rb_yield (val=3059025998262785036) at eval.c:3687 #49 0x16025fcc0 in rb_ensure (b_proc=0x16025e9c0 , data1=4833865224, e_proc=0x16027e180 , data2=4833865224) at eval.c:4019 #50 0x16027f9a8 in rb_file_s_open (argc=540034144, argv=0x1ffff3f98, klass=4833865224) at io.c:1754 #51 0x160260660 in call_cfunc (func=0x16027f800 , recv=4833242072, len=537935872, argc=0, argv=0x0) at eval.c:4233 #52 0x160260e1c in rb_call0 (klass=4833242032, recv=4833242072, id=6369, argc=2, argv=0x1ffff3f98, body=0x120153d98, nosuper=1) at eval.c:4361 #53 0x160261804 in rb_call (klass=4833242032, recv=4833242072, mid=6369, argc=2, argv=0x1ffff3f98, scope=0) at eval.c:4581 #54 0x16025acb4 in rb_eval (self=4833866384, n=0x47) at eval.c:2530 #55 0x160259b20 in rb_eval (self=4833866384, n=0x47) at eval.c:2262 #56 0x160261314 in rb_call0 (klass=4834383264, recv=4833866384, id=2857, argc=0, argv=0x1ffff6970, body=0x12013cbe8, nosuper=0) at eval.c:4488 #57 0x160261804 in rb_call (klass=4834383264, recv=4833866384, mid=2857, argc=3, argv=0x1ffff6958, scope=1) at eval.c:4581 #58 0x160261cb8 in rb_funcall2 (recv=35, mid=0, argc=537935872, argv=0x1fffdd7b8) at eval.c:4665 #59 0x160264d84 in rb_obj_call_init (obj=4833866384, argc=3, argv=0x1ffff6958) at eval.c:5685 #60 0x160264e44 in rb_class_new_instance (argc=538899088, argv=0x1ffff6958, klass=0) at eval.c:5701 #61 0x160260660 in call_cfunc (func=0x160264dc0 , recv=4834383264, len=537935872, argc=0, argv=0x0) at eval.c:4233 #62 0x160260e1c in rb_call0 (klass=4833319392, recv=4834383264, id=3169, argc=3, argv=0x1ffff6958, body=0x120167bb8, nosuper=1) at eval.c:4361 #63 0x160261804 in rb_call (klass=4833319392, recv=4834383264, mid=3169, argc=3, argv=0x1ffff6958, scope=0) at eval.c:4581 #64 0x16025acb4 in rb_eval (self=4833311152, n=0x47) at eval.c:2530 #65 0x160259b20 in rb_eval (self=4833311152, n=0x47) at eval.c:2262 #66 0x1602590a0 in rb_eval (self=4833311152, n=0x47) at eval.c:2011 #67 0x160261314 in rb_call0 (klass=4833319472, recv=4833311152, id=8769, argc=0, argv=0x1ffff9e10, body=0x12013d6b0, nosuper=0) at eval.c:4488 #68 0x160261804 in rb_call (klass=4833319472, recv=4833311152, mid=8769, argc=3, argv=0x1ffff9df8, scope=1) at eval.c:4581 #69 0x16025acb4 in rb_eval (self=4833311152, n=0x47) at eval.c:2530 #70 0x1602590a0 in rb_eval (self=4833311152, n=0x47) at eval.c:2011 #71 0x160261314 in rb_call0 (klass=4833319472, recv=4833311152, id=8665, argc=0, argv=0x1ffffc2c0, body=0x12014d330, nosuper=0) at eval.c:4488 #72 0x160261804 in rb_call (klass=4833319472, recv=4833311152, mid=8665, argc=3, argv=0x1ffffc2a8, scope=1) at eval.c:4581 #73 0x16025acb4 in rb_eval (self=4833311152, n=0x47) at eval.c:2530 #74 0x16025a0a4 in rb_eval (self=4833311152, n=0x47) at eval.c:2354 #75 0x160261314 in rb_call0 (klass=4833319472, recv=4833311152, id=8609, argc=0, argv=0x0, body=0x12014e8e8, nosuper=0) at eval.c:4488 #76 0x160261804 in rb_call (klass=4833319472, recv=4833311152, mid=8609, argc=0, argv=0x0, scope=2) at eval.c:4581 #77 0x16025acb4 in rb_eval (self=4833311152, n=0x47) at eval.c:2530 #78 0x160256064 in eval_node (self=4833311152, node=0x12014b5f8) at eval.c:1060 #79 0x160256594 in ruby_run () at eval.c:1190 #80 0x120000e50 in main (argc=3, argv=0x1fffffad0, envp=0x0) at main.c:50 (gdb) frame #0 rb_gc_mark (ptr=0x2a73d7f02123540c) at gc.c:452 452 if (obj->as.basic.flags == 0) return; /* free cell */ (gdb) print obj $1 = (RVALUE *) 0x2a73d7f02123540c (gdb) print *obj $6 = {as = {free = {flag = 0, next = 0x0}, basic = {flags = 0, klass = 0}, object = {basic = {flags = 0, klass = 0}, iv_tbl = 0x0}, klass = {basic = { flags = 0, klass = 0}, iv_tbl = 0x0, m_tbl = 0x0, super = 0}, flonum = {basic = {flags = 0, klass = 0}, value = 0}, string = {basic = { flags = 0, klass = 0}, len = 0, ptr = 0x0, orig = 0}, array = { basic = {flags = 0, klass = 0}, len = 0, capa = 0, ptr = 0x0}, regexp = { basic = {flags = 0, klass = 0}, ptr = 0x0, len = 0, str = 0x0}, hash = { basic = {flags = 0, klass = 0}, tbl = 0x0, iter_lev = 0, ifnone = 0}, data = {basic = {flags = 0, klass = 0}, dmark = 0, dfree = 0, data = 0x0}, rstruct = {basic = {flags = 0, klass = 0}, len = 0, ptr = 0x0}, bignum = { basic = {flags = 0, klass = 0}, sign = 0 '\000', len = 0, digits = 0x0}, file = {basic = {flags = 0, klass = 0}, fptr = 0x0}, node = {flags = 0, nd_file = 0x0, u1 = {node = 0x0, id = 0, value = 0, cfunc = 0, tbl = 0x0}, u2 = {node = 0x0, id = 0, argc = 0, value = 0}, u3 = { node = 0x0, id = 0, state = 0, entry = 0x0, cnt = 0, value = 0}}, match = {basic = {flags = 0, klass = 0}, str = 0, regs = 0x0}, varmap = { super = {flags = 0, klass = 0}, id = 0, val = 0, next = 0x0}, scope = { super = {flags = 0, klass = 0}, local_tbl = 0x0, local_vars = 0x0, flag = 0}}} (gdb) print obj->as $2 = {free = {flag = 0, next = 0x0}, basic = {flags = 0, klass = 0}, object = { basic = {flags = 0, klass = 0}, iv_tbl = 0x0}, klass = {basic = { flags = 0, klass = 0}, iv_tbl = 0x0, m_tbl = 0x0, super = 0}, flonum = { basic = {flags = 0, klass = 0}, value = 0}, string = {basic = {flags = 0, klass = 0}, len = 0, ptr = 0x0, orig = 0}, array = {basic = {flags = 0, klass = 0}, len = 0, capa = 0, ptr = 0x0}, regexp = {basic = {flags = 0, klass = 0}, ptr = 0x0, len = 0, str = 0x0}, hash = {basic = {flags = 0, klass = 0}, tbl = 0x0, iter_lev = 0, ifnone = 0}, data = {basic = { flags = 0, klass = 0}, dmark = 0, dfree = 0, data = 0x0}, rstruct = { basic = {flags = 0, klass = 0}, len = 0, ptr = 0x0}, bignum = {basic = { flags = 0, klass = 0}, sign = 0 '\000', len = 0, digits = 0x0}, file = { basic = {flags = 0, klass = 0}, fptr = 0x0}, node = {flags = 0, nd_file = 0x0, u1 = {node = 0x0, id = 0, value = 0, cfunc = 0, tbl = 0x0}, u2 = {node = 0x0, id = 0, argc = 0, value = 0}, u3 = {node = 0x0, id = 0, state = 0, entry = 0x0, cnt = 0, value = 0}}, match = {basic = { flags = 0, klass = 0}, str = 0, regs = 0x0}, varmap = {super = { flags = 0, klass = 0}, id = 0, val = 0, next = 0x0}, scope = {super = { flags = 0, klass = 0}, local_tbl = 0x0, local_vars = 0x0, flag = 0}} (gdb) info registers v0 0x0 0 t0 0x0 0 t1 0x23 35 t2 0x0 0 t3 0x120104000 4832903168 t4 0x0 0 t5 0x2 2 t6 0xcccccccccccccccd -3689348814741910323 t7 0x160411e00 5909847552 s0 0x2a73d7f02123540c 3059025998262785036 s1 0x63 99 s2 0x1603ee9d4 5909703124 s3 0x2 2 s4 0x1fffdd7a8 8589793192 s5 0x14b 331 fp 0x1fffdc4b8 8589788344 a0 0x2a73d7f02123540c 3059025998262785036 a1 0x47 71 a2 0x0 0 a3 0x1 1 a4 0x1fffdd7b8 8589793208 a5 0x12015ed38 4833275192 t8 0x12015ed38 4833275192 t9 0x120200e28 4833938984 t10 0x2261 8801 t11 0x11a 282 ra 0x160275338 5908157240 t12 0x160274dc0 5908155840 at 0x160801b30 5913975600 gp 0x1603f9a50 5909748304 sp 0x1fffdc440 8589788224 zero 0x0 0 pc 0x160274e00 5908155904 vfp 0x1fffdc460 8589788256 (gdb) x/i 0x160274e00 0x160274e00 : ldq t1,0(s0) (gdb) disassemble rb_gc_mark Dump of assembler code for function rb_gc_mark: 0x160274dc0 : ldah gp,24(t12) 0x160274dc4 : lda gp,19600(gp) 0x160274dc8 : subq sp,0x20,sp 0x160274dcc : stq ra,0(sp) 0x160274dd0 : stq s0,8(sp) 0x160274dd4 : stq s1,16(sp) 0x160274dd8 : stq s2,24(sp) 0x160274ddc : mov a0,s0 0x160274de0 : and s0,0x3,t2 0x160274de4 : bne t2,0x160274df0 0x160274de8 : andnot s0,0x4,t0 0x160274dec : bne t0,0x160274df8 0x160274df0 : mov 0x2,t0 0x160274df4 : br 0x160274dfc 0x160274df8 : clr t0 0x160274dfc : bne t0,0x16027561c 0x160274e00 : ldq t1,0(s0) 0x160274e04 : beq t1,0x16027561c 0x160274e08 : and t1,0x40,t0 0x160274e0c : bne t0,0x16027561c 0x160274e10 : or t1,0x40,t1 0x160274e14 : stq t1,0(s0) 0x160274e18 : bne t2,0x160274e40 0x160274e1c : andnot s0,0x4,t0 0x160274e20 : beq t0,0x160274e40 0x160274e24 : srl t1,0x9,t0 0x160274e28 : blbc t0,0x160274e40 0x160274e2c : mov s0,a0 0x160274e30 : ldq t12,-28592(gp) 0x160274e34 : jsr ra,(t12),0x16027a400 0x160274e38 : ldah gp,24(ra) 0x160274e3c : lda gp,19480(gp) 0x160274e40 : ldq s1,0(s0) 0x160274e44 : and s1,0x3f,t1 0x160274e48 : cmpeq t1,0xa,t0 0x160274e4c : bne t0,0x160274e70 0x160274e50 : cmpule t1,0xa,t0 0x160274e54 : beq t0,0x160274e64 0x160274e58 : cmpeq t1,0x1,t0 0x160274e5c : bne t0,0x160274e70 0x160274e60 : br 0x160275330 0x160274e64 : cmpeq t1,0x3f,t0 0x160274e68 : bne t0,0x160274e84 0x160274e6c : br 0x160275330 0x160274e70 : ldq a0,-16600(gp)