Preserve scalar slots assigned through localized glob aliases
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the reproducer in the issue: a localized whole-glob alias (local *SYM = *{...}) followed by *SYM = \$value. The issue points to RuntimeGlob.set and getGlobAliasGroup(this.globName) as the place where the scalar slot is written to the wrong glob. Run the snippet on both the JVM and interpreter backends. Done when it prints /tmp/example-state on both, and a permanent regression test covers scalar-slot assignment through a localized glob alias.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
PerlOnJava loses the destination scalar slot when a scalar reference is assigned through a localized whole-glob alias. Text::Template 1.61 uses this pattern to expose HASH values to template fragments; those variables become undefined in the template.
Minimal reproducer
use strict;
use warnings;
my $package = 'Probe';
my $name = 'state_dir';
my $value = '/tmp/example-state';
{
no strict 'refs';
local *SYM = *{"${package}::$name"};
*SYM = \$value;
print defined ${"${package}::$name"}
? ${"${package}::$name"} : '<undef>', "\n";
}
System Perl prints /tmp/example-state. PerlOnJava 5.44.1 prints an empty value (with an uninitialized-value warning) on both JVM and interpreter backends.
CPAN evidence
In CPAN random-tester run 20261030-095654-34969, App-Milter-Limit 0.54 fails t/limit-from.t and t/smoke.t on PerlOnJava. Both tests provide a temporary state_dir in their generated config, but Text::Template expands it to an empty string. App-Milter-Limit then applies its /var/run/milter-limit default and fails to create that directory due to permissions.
The archived system-Perl oracle passes the complete App-Milter-Limit suite: 6 test files and 21 tests. The PerlOnJava suite reports 2/6 test programs failed. The relevant environment was macOS 26.7.1 arm64, Java 24.0.2, PerlOnJava 5.44.1 (4dc1a6f4d), and system Perl 5.42.2.
Root cause
Text::Template's _install_hash uses local *SYM = *{"${dest}::$name"} and then assigns *SYM = \$val. PerlOnJava handles the reference assignment in RuntimeGlob.set by updating the scalar slot for getGlobAliasGroup(this.globName). In this localized alias case, the alias group associated with SYM does not carry the destination glob identity, so the destination package scalar remains undefined. The failure is reproducible without Text::Template using the snippet above.
Related, but distinct, reports: #1258 covers direct dynamic package-scalar aliasing; #1630 covered whole-glob aliases and localized IO replacements.
Acceptance criteria
- The reproducer prints
/tmp/example-stateon system Perl and both PerlOnJava backends. - Add permanent project-owned regression coverage for scalar-slot assignment through a localized whole-glob alias.
- App-Milter-Limit 0.54 passes all tests on both PerlOnJava backends.
- Lingua principale
- Perl
- Stelle
- 65
- Fork
- 8
- Merge medio
- 6h 33m
- PR unite (30g)
- 178
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fglock/PerlOnJava
-
area:runtime documentation enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fglock/PerlOnJava#1579 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
fglock/PerlOnJava#1885 ·
I maintainer di solito rispondono entro 1 giorno
-
area:performance enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
fglock/PerlOnJava#1863 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area:memory area:performance area:runtime bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
fglock/PerlOnJava#1860 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Mojolicious controller and WebSocket lifetimes regress with #1642 integrationForse già presa @fglock l’ha presa 9 giorni fa. Apertaarea:backend area:memory area:runtime bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 12/100
fglock/PerlOnJava#1794 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fglock/PerlOnJava
Issue simili
-
easy first-contributor first-contributors good first issue help wanted perl shell up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
fork-commit-merge/fork-commit-merge#8461 ·
I maintainer di solito rispondono entro 1 giorno
-
PostgreSQL::Version rejects documented full psql version outputForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
1.severity: security
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
gugod/App-perlbrew#880 · 2 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
beyondgrep/ack3#413 · 1 commento ·