Diamond operator ignores tied *ARGV after import-time traversal
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Start with OpcodeHandlerExtended.executeReadline, DiamondIO.readline and openNextFile, and TieHandle.tiedReadline to trace how reads are dispatched after *ARGV is tied. Reproduce the failures with the upstream t/01_argv.t commands in the issue, then compare tied-handle reads with ordinary @ARGV iteration and EOF behavior. Done when both backends honor the tied handle’s READLINE after import-time traversal and regression coverage passes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
<> stops using *ARGV after ARGV::JSON consumes the command-line file during module import and then ties *ARGV. PerlOnJava returns undef for reads that should invoke the tied handle's READLINE method.
This was reported by CPAN random run 20261118-104825-43075 for ARGV-JSON-0.01, target ARGV::JSON. The failure is in t/01_argv.t (tests 2 and 3, lines 32 and 37); t/00_compile.t passes.
Reproduction and results
The upstream test sets @ARGV to t/data/01.json, then loads ARGV::JSON. Its import method reads the file using <> and ties *ARGV. The test then expects scalar and list-context <> reads to return the decoded JSON values.
From the extracted ARGV-JSON-0.01 distribution directory:
PERL5LIB=blib/lib jperl t/01_argv.t
PERL5LIB=blib/lib jperl --interpreter t/01_argv.t
Both PerlOnJava backends reproduce the two failures. For the first read, the actual value is undef; the expected value is the first decoded hash. The list read is empty instead of returning the remaining array and hash values. The final EOF assertion passes.
The archived system-Perl oracle ran the same distribution and passed all 5 tests (t/00_compile.t and t/01_argv.t) under Perl 5.42.2. The archived PerlOnJava run failed 2 of 5 tests. A local follow-up reproduced the result on both backends; its executable reports build 543f9dfef, on Temurin Java 24.0.2 / macOS 15.6 ARM64.
Root cause
The import-time <> loop starts DiamondIO traversal while @ARGV contains the fixture filename. It consumes that filename and reaches EOF before ARGV::JSON ties *ARGV. The later <> operations are still routed by OpcodeHandlerExtended.executeReadline to DiamondIO.readline. That code continues the existing diamond traversal; when it needs another input, openNextFile shifts from the now-empty @ARGV and reports EOF. It does not dispatch those reads to the newly tied ARGV handle's READLINE method.
Relevant code paths are OpcodeHandlerExtended.executeReadline, DiamondIO.readline / openNextFile, and TieHandle.tiedReadline. The behavior to fix is the interaction between the diamond operator's traversal state and a tied *ARGV: reads after tying must honor the handle's READLINE, while ordinary @ARGV file iteration and EOF behavior remain intact.
Related coverage
The repository has adjacent diamond-state and tied-handle coverage, including the changes in PR #1463, but that coverage does not exercise tying *ARGV after an import-time diamond traversal has consumed its input. The upstream ARGV-JSON-0.01 test is a focused reproducer suitable for project regression coverage.
No XS or native dependency is involved. Searches of existing issues for ARGV::JSON, tied ARGV, and DiamondIO found no issue covering this behavior.
- Ngôn ngữ chính
- Perl
- Star
- 67
- Fork
- 8
- Merge trung bình
- 5 giờ 12 phút
- Pull request đã merge (30 ngày)
- 131
Chuẩn bị môi trường
- Có Dockerfile hoặc 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 fglock/PerlOnJava
-
area:cpan-port bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
fglock/PerlOnJava#2153 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port area:parser bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
fglock/PerlOnJava#2137 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:backend area:cpan-port area:runtime bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
fglock/PerlOnJava#2071 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:runtime documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#1579 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
fglock/PerlOnJava#2157 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fglock/PerlOnJava
Issue tương tự
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling linksĐang mởteam-cli
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 93/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
inverse-inc/packetfence#9728 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(char-create): show the real reason a character is refusedCó thể đã có người làm @baphomello đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày