Diamond operator ignores tied *ARGV after import-time traversal
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Perl
- Stelle
- 67
- Fork
- 8
- Merge medio
- 5h 12m
- PR unite (30g)
- 131
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fglock/PerlOnJava
-
area:cpan-port bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
fglock/PerlOnJava#2153 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port area:parser bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
fglock/PerlOnJava#2137 ·
I maintainer di solito rispondono entro 1 giorno
-
area:backend area:cpan-port area:runtime bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
fglock/PerlOnJava#2071 ·
I maintainer di solito rispondono entro 1 giorno
-
area:runtime documentation enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fglock/PerlOnJava#1579 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
fglock/PerlOnJava#2157 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fglock/PerlOnJava
Issue simili
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling linksApertateam-cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 93/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
inverse-inc/packetfence#9728 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(char-create): show the real reason a character is refusedForse già presa @baphomello l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno