[interpreter] Capture::Tiny fails when duplicating STDOUT during capture

Aperta
#2,015 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
53/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, perl
Ambito
backend, testing

Direzione di ricerca

Start with the interpreter’s filehandle duplication path used by Capture::Tiny::_capture_tee → _open_std → _open, where dup mode on STDOUT fails with Bad file descriptor; issue #1165 may provide related context. First run the minimal reproducer with system Perl, the JVM backend, and the interpreter, then locate the project-owned regression tests for filehandle duplication. Done means the reproducer and Duadua’s t/50_cli.t pass under both PerlOnJava backends, with the full upstream suite passing under the interpreter.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:backend area:io bug

Summary

Capture::Tiny output capture fails on the PerlOnJava interpreter. Duadua 0.36's t/50_cli.t uses Capture::Tiny and exits before completing its assertions when run with the interpreter. The same test passes under system Perl and the PerlOnJava JVM backend.

This was found while investigating CPAN random run 20261109-091152-39587. That run's archived default-backend log ends after t/15_reparse.t without a harness summary, so its Unknown test outcome is inconclusive and is not evidence for this interpreter failure. The full Duadua suite passes under system Perl and under the default PerlOnJava launcher/JVM backend (6 files, 490 tests).

Minimal reproducer

use Capture::Tiny qw(capture);
my ($stdout, $stderr) = capture { print "captured\n" };
die "unexpected capture: $stdout" unless $stdout eq "captured\n";
die "unexpected stderr: $stderr" if length $stderr;
print "capture ok\n";

Run the program with system Perl, the PerlOnJava JVM backend, and the PerlOnJava interpreter backend.

Results

  • System Perl 5.42.2: prints capture ok and exits 0.
  • PerlOnJava JVM backend: prints capture ok and exits 0.
  • PerlOnJava interpreter backend: fails before the capture callback completes with Bad file descriptor while Capture::Tiny duplicates STDOUT.
  • Duadua 0.36 t/50_cli.t: passes under system Perl and the JVM backend; under the interpreter it exits with status 255 after 9 assertions, before done_testing.

The failing call path is Capture::Tiny::_capture_tee -> _open_std -> _open. _open_std opens STDOUT in dup mode (>&); _open reports the bad descriptor. The reproducer uses the pure-Perl Capture::Tiny 0.50 module.

Environment

  • macOS 26.7.1
  • OpenJDK 24.0.2 (Temurin)
  • PerlOnJava launcher built from local master commit 13db7bd4a0 (2026-11-05)
  • Duadua 0.36; Capture::Tiny 0.50

Related issue

Issue #1165 fixed duplication of a tied filehandle. This reproducer is a separate interpreter failure in Capture::Tiny's ordinary capture path; the JVM backend succeeds.

Acceptance criteria

  • The minimal reproducer succeeds on both PerlOnJava backends and system Perl.
  • Duadua 0.36 t/50_cli.t and the full upstream suite pass under the interpreter.
  • Add a focused project-owned regression test validated with system Perl first.
Lingua principale
Perl
Stelle
67
Fork
8
Merge medio
5h 12m
PR unite (30g)
131

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fglock/PerlOnJava

Tutte le issue di fglock/PerlOnJava

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.