From: Yusuke ENDOH Date: 2007-07-17T22:33:59+09:00 Subject: [ruby-dev:31243] ruby -ne ! dumps core 遠藤と申します。 1.9 で以下のようにすると落ちます。 $ ./ruby -vne ! ruby 1.9.0 (2007-07-17 patchlevel 0) [i686-linux] -e:1: syntax error, unexpected $end -- control frame ---------- c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------ --------------------------- -- backtrace of native function call (Use addr2line) -- 0x80dad35 0x80f34a3 0x80f356b 0x80b2660 0xffffe420 0x80b12dc 0x80b1b8b 0x805c534 0x8056c2a 0xb7dd3ea8 0x8056b61 ------------------------------------------------------- [BUG] Segmentation fault ruby 1.9.0 (2007-07-17) [i686-linux] アボートしました (core dumped) -n や -p でパース失敗したら落ちるようです。 以下のパッチで落ちなくなりました。 Index: ruby.c =================================================================== --- ruby.c (revision 12809) +++ ruby.c (working copy) @@ -883,10 +883,10 @@ FL_UNSET(rb_load_path, FL_TAINT); } - if (do_print) { + if (tree && do_print) { tree = rb_parser_append_print(parser, tree); } - if (do_loop) { + if (tree && do_loop) { tree = rb_parser_while_loop(parser, tree, do_line, do_split); } -- Yusuke ENDOH