More differential fuzzing bugs: 2
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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>
- Ngôn ngữ chính
- C
- Star
- 1k
- Fork
- 206
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 71
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ruby/prism
-
More differential fuzzing bugsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
ruby/prism#4379 · 9 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Polprzewodnikowy/N64FlashcartMenu#486 · 3 bình luận ·
-
[raygui] update to 5.0Đang mởcategory:port-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 2 ngày
-
crash
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
tree-sitter/tree-sitter-c#338 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100