PerlIO::via FILENO callback is omitted on open
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
- 35/100
Direção de pesquisa
Start where a :via handle is opened and layers are pushed: inspect ViaLayer and LayeredIOHandle.fileno() to find the open/layer-setup path, then compare it with the callback-order probe in the issue. Run the gzip reproducer and t/001_roundtrip.t to confirm current behavior. Done means FILENO runs during open before the first WRITE with the expected layer and handle arguments, plus regression tests for ordering and initialization passing on JVM and interpreter backends.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
PerlOnJava does not invoke a PerlIO::via layer's FILENO callback when opening a :via(...) handle. Perl invokes this callback before the first WRITE. A layer that initializes its underlying stream in FILENO therefore reaches WRITE with no initialized state.
This breaks PerlIO-via-gzip 0.03 on both PerlOnJava execution backends. Its FILENO callback initializes IO::Compress::Gzip or IO::Uncompress::Gunzip, and its write/read callbacks require that initialization.
Reproducer
With PerlIO-via-gzip 0.03 available in @INC:
use PerlIO::via::gzip;
my $path = "/tmp/perlio-via-gzip-$$.gz";
open(my $fh, ">:via(gzip)", $path) or die "open: $!";
print {$fh} "hello\n";
close $fh or die "close: $!";
unlink $path;
System Perl completes this successfully. PerlOnJava emits an uninitialized-value warning from PerlIO::via::gzip::FLUSH, then dies from PerlIO::via::gzip::WRITE with handle not initialized.
A callback-order probe gives the minimal behavior difference. For a layer implementing PUSHED, FILENO, WRITE, and FLUSH, system Perl calls:
PUSHED,FILENO,WRITE,FLUSH
PerlOnJava calls:
PUSHED,WRITE,FLUSH,FLUSH,FLUSH
The FILENO callback is omitted on both JVM and interpreter backends.
CPAN and verification evidence
- Distribution:
PerlIO-via-gzip0.03; upstream test:t/001_roundtrip.t. - PerlOnJava CPAN run:
20261120-195805-13340; the test exits after 5 of 10 planned tests with the uninitializedFLUSHwarning andWRITEerror described above. - At PerlOnJava source commit
506371c134837d026687b1958c856edb3c6f70e4,t/001_roundtrip.tpasses all 10 tests on system Perl 5.34.1 and fails after test 5 with the same error on both the JVM and interpreter backends. - The repository
nice -n 19 makegate passed at that commit. - The distribution is pure Perl; its runtime prerequisites are
IO::Compress::GzipandIO::Uncompress::Gunzip.
Environment and implementation notes
Reproduced on macOS 26.7.3 arm64 with OpenJDK 24.0.2.
ViaLayer discovers and implements onFileno(), and LayeredIOHandle.fileno() forwards to it when called. The observed difference is that opening a :via handle does not cause this callback to run before writes, as system Perl does. Please check where FILENO must be triggered during open/layer setup and preserve the callback's return/error semantics.
Acceptance criteria
- A
:vialayer'sFILENOcallback runs during open, before its first read or write callback, matching system Perl. - The callback receives the same layer object and underlying handle arguments expected by PerlIO::via.
- Add focused regression coverage for callback ordering and for a layer that depends on
FILENOinitialization. t/001_roundtrip.tpasses on system Perl, the PerlOnJava JVM backend, and the interpreter backend.
- Linguagem predominante
- Perl
- Estrelas
- 67
- Forks
- 8
- Merge médio
- 4h 36min
- PRs com merge (30d)
- 123
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:runtime bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
fglock/PerlOnJava#2164 ·
Mantenedores costumam responder em até 1 dia
-
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
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