Diamond operator ignores tied *ARGV after import-time traversal
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 52/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Perl
- Estrelas
- 67
- Forks
- 8
- Merge médio
- 5h 12min
- PRs com merge (30d)
- 131
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de fglock/PerlOnJava
-
area:cpan-port bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
fglock/PerlOnJava#2153 ·
Mantenedores costumam responder em até 1 dia
-
area:cpan-port area:parser bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
fglock/PerlOnJava#2137 ·
Mantenedores costumam responder em até 1 dia
-
area:backend area:cpan-port area:runtime bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
fglock/PerlOnJava#2071 ·
Mantenedores costumam responder em até 1 dia
-
area:runtime documentation enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
fglock/PerlOnJava#1579 ·
Mantenedores costumam responder em até 1 dia
-
area:cpan-port bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 62/100
fglock/PerlOnJava#2157 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de fglock/PerlOnJava
Issues semelhantes
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling linksAbertateam-cli
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 93/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
inverse-inc/packetfence#9728 ·
Mantenedores costumam responder em até 1 dia
-
fix(char-create): show the real reason a character is refusedTalvez já em andamento @baphomello assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia