From: Inaba Hiroto Date: 1998-05-28T23:52:20+09:00 Subject: [ruby-dev:2778] Re: convert Perl's t/regexp.t to ruby From: matz@netlab.co.jp (Yukihiro Matsumoto) Subject: [ruby-dev:2773] Re: convert Perl's t/regexp.t to ruby Date: Thu, 28 May 1998 16:02:02 +0900 > In message "[ruby-dev:2769] Re: convert Perl's t/regexp.t to ruby" > on 98/05/28, Inaba Hiroto writes: > > |残念ですがまだSEGVします。前よりかなり先まで進むんですが。 > |今回は、backtraceだけを見るとGCのルーチンは通ってないです。 > |以下ログです。途中を省略しました > > むむむ,以下のパッチではどうでしょう. > > 挙動はまだPerlと違うのですが,落ちなくはなると思います. > 単なる希望ですが. えっと、まだ落ちます。前のもそうですが、GCは関係なくて、1つのテストだ けでも落ちますね。今回落ちるテストケースは ^(?:b|a(?=(.)))*\1 abc y $& ab です。backtraceは最後に付けます。 > # カッコが閉じる前にその中でbackrefがあるのは反則だと思う…. はい、1.1b9_22の時、not okだったので調べて「こんな機能、何に使うんだろ う」と思いました。個人的には挙動を合わせる必要はないと思います。 # 他の方の為に書きますと、perl5.004_6Xでは # "aaaaaaaaaa" =~ /^(a\1?){4}$/ が マッチするというのがテストケースに # 入っていて、前回はこれがSEGVしてたのです。 ------------------------------------------------------------------ % ./ruby /sola3/inaba/ruby/perl_regexp_t0.rb /usr/local/src/lang/perl5.004_65/t/op/re_tests 1..442 ok 1 ok 2 : ok 338 Program received signal SIGSEGV, Segmentation fault. 0xef6d679c in memcmp () (gdb) where #0 0xef6d679c in memcmp () #1 0x4960c in re_match (bufp=0xfd710, string_arg=0xfd713 "", size=3, pos=0, regs=0xfef78) at regex.c:3103 #2 0x48b8c in re_search (bufp=0xf3548, string=0xfd710 "abc", size=3, startpos=0, range=3, regs=0xfef78) at regex.c:2533 #3 0x41774 in reg_search (reg=646568, str=648104, start=0, reverse=0) at re.c:434 #4 0x41fbc in reg_match (re=646568, str=648104) at re.c:723 #5 0x1ded8 in rb_call0 (klass=757520, recv=646568, id=328, argc=1, argv=0xefffdc98, body=0xb8dd8, nosuper=1) at eval.c:3301 #6 0x1ea34 in rb_call (klass=757520, recv=646568, mid=328, argc=1, argv=0xefffdc98, scope=1) at eval.c:3571 #7 0x1eb98 in rb_funcall (recv=646568, mid=328, n=1) at eval.c:3645 #8 0x1b86c in rb_eval (self=792032, node=0x9dd78) at eval.c:2289 #9 0x1b1a0 in rb_eval (self=792032, node=0x9dd48) at eval.c:2069 #10 0x198a0 in rb_eval (self=792032, node=0x9dbf8) at eval.c:1580 #11 0x181dc in eval_node (self=792032) at eval.c:913 #12 0x1f144 in eval (self=792032, src=646640, scope=4, file=0x631f0 "(eval)", line=0) at eval.c:3828 #13 0x1f380 in f_eval (argc=0, argv=0xefffe768, self=792032) at eval.c:3892 #14 0x1df04 in rb_call0 (klass=795608, recv=792032, id=3577, argc=1, argv=0xefffe768, body=0xc0e90, nosuper=1) at eval.c:3304 #15 0x1ea34 in rb_call (klass=795608, recv=792032, mid=3577, argc=1, ---Type to continue, or q to quit--- argv=0xefffe768, scope=1) at eval.c:3571 #16 0x1aa78 in rb_eval (self=792032, node=0xb2280) at eval.c:1969 #17 0x198a0 in rb_eval (self=792032, node=0xb2238) at eval.c:1580 #18 0x1a270 in rb_eval (self=792032, node=0xb10c8) at eval.c:1830 #19 0x198a0 in rb_eval (self=792032, node=0xb1098) at eval.c:1580 #20 0x19c6c in rb_eval (self=792032, node=0xb0f30) at eval.c:1689 #21 0x198a0 in rb_eval (self=792032, node=0xb0f00) at eval.c:1580 #22 0x181dc in eval_node (self=792032) at eval.c:913 #23 0x18298 in ruby_run () at eval.c:943 #24 0x170f0 in main (argc=3, argv=0xeffff564, envp=0xeffff574) at main.c:32 (gdb) quit The program is running. Quit anyway (and kill it)? (y or n) y -- 稲葉 浩人 (inaba@st.rim.or.jp)