More differential fuzzing bugs: 2
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
The report gives Ruby reproduction commands comparing parse.y and Prism for each discrepancy, but names no source files or tests. Start by running the listed commands with both parsers and identify which cases fail in Prism; then trace each failure to its parser code and regression tests. Done means Prism matches parse.y across all reported crash, semantic, syntax, and encoding cases.
索引モデルが issue の本文から書いたものです。
説明
New findings from differential (parse.y vs Prism) and invariant fuzzing against upstream Prism a5e01d818fa45f2cea9232754251a6855f82ab98 / CRuby ruby 4.1.0dev (2026-11-25T22:05:35Z HEAD f46d41a54c) +PRISM.
Crash
-
PRISM_ASSERTabort inparse_writeonself=&->.self=self=Reproduction
ruby --parser=parse.y -ce 'self=&->.self=self=' ruby --parser=prism -ce 'self=&->.self=self='parse.y: reportsSyntaxError(Can't change the value of self/syntax error, unexpected &)prism: aborts with assertion failure inparse_write:src/prism.c:13837: parse_write: Assertion `pm_parser_local_depth_constant_id(parser, name) == (int) depth' failed. [BUG] Aborted
Runtime / Semantic Discrepancies
-
Wrong operator precedence on
4-C::F!do end&.()Reproduction
ruby --parser=parse.y -e 'module C; def self.F!; ->{ 1 }; end; end; p(4-C::F!do end&.())' ruby --parser=prism -e 'module C; def self.F!; ->{ 1 }; end; end; p(4-C::F!do end&.())'parse.y:3— parses as4 - (C::F! do end&.())prism:TypeError: Proc can't be coerced into Integer— parses as(4 - C::F! do end)&.()
-
Heredoc followed by line continuation (
\\\n) misparses RHS of[]|=Reproduction
printf 'a = {}; def b(x = nil); [:b, x]; end\na[<<HEREDOC]|=b\\\nHEREDOC\n%%()\np a\n' | ruby --parser=parse.y printf 'a = {}; def b(x = nil); [:b, x]; end\na[<<HEREDOC]|=b\\\nHEREDOC\n%%()\np a\n' | ruby --parser=prismparse.y:{"" => true}— parses RHS asb("")(%()is an argument tob)prism:NoMethodError: undefined method '%' for an instance of Array— parses RHS asb % ()
-
Named regexp capture in
CESU-8creates a local variable in Prism but not inparse.yReproduction
printf '#coding:CESU-8\n/(?<\\ueee5>)/=~"a"\np local_variables\n' | ruby --parser=parse.y printf '#coding:CESU-8\n/(?<\\ueee5>)/=~"a"\np local_variables\n' | ruby --parser=prismparse.y:[](0locals)prism:[:"\uEEE5"](1local)
Syntax Acceptance / Rejection Discrepancies
-
`alias<<`` at EOF accepted by Prism
Reproduction
printf 'alias<<`' | ruby --parser=parse.y -c printf 'alias<<`' | ruby --parser=prism -cparse.y:SyntaxError: unterminated here document identifierprism:Syntax OK
-
Heredoc followed by line continuation (
\\\n) in modifierrescuehides unterminated heredocReproduction
printf 'if t\nend\n<<HEREDOC rescue a\\\nHEREDOC\n<<H' | ruby --parser=parse.y -c printf 'if t\nend\n<<HEREDOC rescue a\\\nHEREDOC\n<<H' | ruby --parser=prism -cparse.y:SyntaxError: can't find string "H" anywhere before EOFprism:Syntax OK
-
Literal
\u{\n}inside string inCP1257encoding accepted by PrismReproduction
printf '#coding:CP1257\nf"\\u{\\n}" ' | ruby --parser=parse.y -c printf '#coding:CP1257\nf"\\u{\\n}" ' | ruby --parser=prism -cparse.y:SyntaxError: invalid Unicode escapeprism:Syntax OK
-
def f(*)rescue*,();endrejected by PrismReproduction
ruby --parser=parse.y -ce 'def f(*)rescue*,();end' ruby --parser=prism -ce 'def f(*)rescue*,();end'parse.y:Syntax OKprism:SyntaxError: expected an expression after '*'
-
#coding:IBM850\na'\x8A':?\u3042rejected by Prism asinvalid_symbolReproduction
printf '#coding:IBM850\na\x27\x8a\x27:?\\u3042 ' | ruby --parser=parse.y -c printf '#coding:IBM850\na\x27\x8a\x27:?\\u3042 ' | ruby --parser=prism -cparse.y:Syntax OKprism:SyntaxError: invalid symbol
-
#coding:iso8859-1\nx=?\xa0^()accepted by PrismReproduction
printf '#coding:iso8859-1\nx=?\xa0^()' | ruby --parser=parse.y -c printf '#coding:iso8859-1\nx=?\xa0^()' | ruby --parser=prism -cparse.y:SyntaxError: syntax error, unexpected '?'prism:Syntax OK
Magic Comment / Encoding Discrepancy
-
Encoding mismatch on
#\x03:"coding:Windows-31J\\at EOFReproduction
printf '#\x03:"coding:Windows-31J\\' | ruby --parser=parse.y -e 'RubyVM.keep_script_lines = true; p RubyVM::InstructionSequence.compile(STDIN.read).script_lines.first.encoding' printf '#\x03:"coding:Windows-31J\\' | ruby --parser=prism -e 'RubyVM.keep_script_lines = true; p RubyVM::InstructionSequence.compile(STDIN.read).script_lines.first.encoding'parse.y:#<Encoding:Windows-31J>prism:#<Encoding:UTF-8>
- 主要言語
- C
- スター
- 1k
- フォーク
- 206
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 71
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ruby/prism のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Polprzewodnikowy/N64FlashcartMenu#486 · コメント 3 件 ·
-
category:port-update
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 2 日以内に返信
-
crash
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
tree-sitter/tree-sitter-c#338 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100