Whole-glob aliases follow localized replacements instead of retaining the original GV
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
Piste de recherche
Start with RuntimeGlob.set, RuntimeGlob.dynamicSaveState, and GlobalVariable.setGlobAlias to trace how whole-glob aliases and localized global IO bindings are represented. Add the project-owned regression for alias identity, nested localization, and scope restoration, then run the focused upstream test and the Smart-Comments-Log4perl 1.002 suite on both JVM and interpreter backends.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
Whole-glob aliases incorrectly follow a dynamically localized replacement glob instead of retaining the original glob identity. This breaks code that saves a glob alias and later localizes the original name, including Smart::Comments::Log4perl's saved STDERR handle.
Minimal reproducer
package Capture;
use Tie::Handle;
sub TIEHANDLE { bless {}, shift }
sub TELL { 123 }
sub PRINT { }
package main;
*ORIGINAL = *STDERR;
close *STDERR;
my $buffer = q{};
open *STDERR, '>', \$buffer;
tie *CAPTURE, 'Capture';
{
local *STDERR = *CAPTURE;
print STDOUT "saved tell=", tell ORIGINAL, "\n";
}
System Perl prints saved tell=0. PerlOnJava prints saved tell=123 on both JVM and interpreter backends: ORIGINAL has incorrectly started resolving to the newly localized tied glob and dispatches to Capture::TELL.
CPAN evidence
- Distribution:
Smart-Comments-Log4perl1.002 - CPAN random tester run:
20261002-182937-4648 - Upstream system Perl 5.42.2: all 10 test files pass (7 tests).
- PerlOnJava 5.44.1, Java 24.0.2, macOS arm64: six test programs exit 255 before assertions. The JVM failure includes a
StackOverflowErrorrepeatedly enteringSmart::Comments::Log4perl::IO::TELL, which delegatestellthrough its savedL4P_ORIGINAL_STDERRglob. The interpreter also fails the focused upstream test. The isolated glob/tie reproducer exhibits the wrong alias target on both backends. - The distribution and its dependencies are pure Perl; no XS or native prerequisite is involved.
Root cause
RuntimeGlob.set(RuntimeGlob) represents whole-glob assignment by recording a name alias through GlobalVariable.setGlobAlias. During local *STDERR, RuntimeGlob.dynamicSaveState installs a fresh RuntimeGlob in the global IO table for main::STDERR. Alias lookup remains name-based, so ORIGINAL resolves through main::STDERR to that new localized glob. Perl keeps the saved alias attached to the outer glob while the localized name refers to a temporary glob.
The alias relationship must preserve the original glob identity across dynamic localization and restore the named binding when the scope exits.
Acceptance criteria
- Add a project-owned regression covering a whole-glob alias, localized replacement of its source name, and IO-slot access through the saved alias.
- Match system Perl on both JVM and interpreter backends, including nested localization and scope restoration.
- Verify the
Smart-Comments-Log4perl1.002 upstream suite passes on both backends.
Related issue
Related tied-filehandle work: #1338. That report covers a different tied-output dispatch failure; this report isolates the typeglob alias/localization defect.
- Langage dominant
- Perl
- Étoiles
- 64
- Forks
- 7
- Merge moyen
- 5 h 39 min
- PR mergées (30 j)
- 213
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de fglock/PerlOnJava
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
fglock/PerlOnJava#1579 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
fglock/PerlOnJava#1835 ·
Les mainteneurs répondent en général sous 1 jour
-
area:cpan-port bug
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
fglock/PerlOnJava#1820 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 Une demi-journée Accessibilité débutants 45/100
fglock/PerlOnJava#1808 ·
Les mainteneurs répondent en général sous 1 jour
-
area:cpan-port area:runtime bug
Difficulté 4/5 3-5 jours Accessibilité débutants 28/100
fglock/PerlOnJava#1802 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de fglock/PerlOnJava
Issues similaires
-
Type: Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
inverse-inc/packetfence#9549 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
jimsalterjrs/sanoid#1116 · 1 réaction ·
-
Add .gitattributes so share/skel keeps LF on a Windows git checkoutPeut-être pris @sadhana-s-codez l’a pris il y a 3 jours. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
PerlDancer/Dancer2#1854 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
major/MySQLTuner-perl#1007 ·
Les mainteneurs répondent en général sous 1 jour