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

Ouverte
#2,034 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
52/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
perl
Domaine
backend

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
Perl
Étoiles
67
Forks
8
Merge moyen
5 h 12 min
PR mergées (30 j)
131

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de fglock/PerlOnJava

Toutes les issues de fglock/PerlOnJava

Issues similaires

Plus d'issues Perl

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.