[JVM/interpreter] local STDERR to IO::Scalar does not capture output

Offen
#2,034 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
52/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
perl
Bereich
backend

Rechercherichtung

Start by tracing how localized typeglob assignments route writes to standard handles in both the JVM and interpreter backends; the issue names no source files or tests in the repository. Reproduce the supplied IO::Scalar case on each backend, then check whether Grep::Query 1.011's t/11-invalid.t passes. Done means both backends capture the diagnostic and pass those acceptance checks.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area:backend area:io bug

Summary

Localizing STDERR to an IO::Scalar handle does not capture output on either PerlOnJava backend.

Reproducer

use strict;
use warnings;
use IO::Scalar;
my $capture = IO::Scalar->new();
{
    local *STDERR = $capture;
    print STDERR "diagnostic\n";
}
die "diagnostic was not captured" unless "$capture" eq "diagnostic\n";

System Perl captures the diagnostic. PerlOnJava's JVM and interpreter backends leave the buffer empty.

CPAN evidence

  • Grep::Query 1.011, CPAN random run 20261111-090841-71684.
  • System Perl 5.42.2 passes all 490 tests.
  • PerlOnJava reports 468/490 passing. t/11-invalid.t fails 14/21 assertions because Grep::Query::Parser localizes STDERR to IO::Scalar while collecting Parse::RecDescent diagnostics; the buffer stays empty and the test sees UNKNOWN ERROR.
  • The reproducer passes on system Perl and fails on both PerlOnJava backends.

Root cause

The localized STDERR glob does not route writes to the replacement IO::Scalar handle. This prevents callers from retrieving output written through STDERR during the localized scope.

Related work

Issue #2015 covers Capture::Tiny's interpreter failure while duplicating STDOUT. This reproducer exercises direct STDERR localization to IO::Scalar and fails on both backends.

Acceptance criteria

  • local *STDERR = $capture routes print STDERR to the replacement handle on both PerlOnJava backends.
  • The reproducer and Grep::Query 1.011 t/11-invalid.t pass on system Perl and both PerlOnJava backends.
Vorherrschende Sprache
Perl
Sterne
67
Forks
8
Ø Merge
5 Std. 12 Min.
Gemergte PRs (30 T.)
131

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus fglock/PerlOnJava

Alle Issues in fglock/PerlOnJava

Ähnliche Issues

Weitere Issues zu Perl

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.