Geo::Coordinates::OSGB 2.20 fails on constant hash-reference dereferences
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- compilers, testing-qa
Línea de trabajo
Comienza con jperl t/02-known.t y jperl --interpreter t/02-known.t, y después inspecciona Geo::Coordinates::OSGB.pm y el manejo en la JVM y el intérprete de las desreferencias de referencias constantes a hashes. Utiliza las pruebas afectadas, incluidas t/02-known.t, t/03-format.t, t/05-random.t, t/06-osgb-grid-to-ll.t, t/06-osgb-ll-to-grid.t, t/08-out_of_range.t y t/13-edge-and-at-sea.t. Se considera terminado cuando una prueba de regresión específica cubra las desreferencias de exists y de arrays, ambos backends superen las 360 pruebas upstream y las variables ordinarias y los tipos de retorno constantes permanezcan intactos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Geo::Coordinates::OSGB v2.20 fails most of its upstream test suite under PerlOnJava when code dereferences the hash reference returned by a use constant declaration:
use constant ELLIPSOIDS => { ... };
my $shape = ...;
my ($a, $b, $f, $e2) = @{ ELLIPSOIDS->{$shape} };
This was observed in CPAN random tester run 20260914-160652-26153.
Reproduction
The upstream suite passes completely under system Perl:
- 10 test programs
- 360 tests
- all tests successful
Under PerlOnJava, the failure reproduces on both execution backends. Focused reproductions are:
jperl t/02-known.t
jperl --interpreter t/02-known.t
Observed failures
JVM backend:
Global symbol "@ELLIPSOIDS" requires explicit package name (did you forget to declare "my @ELLIPSOIDS"?)
The error is reported from Geo::Coordinates::OSGB.pm at the ELLIPSOIDS->{$shape} dereference.
Interpreter backend:
Can't use string ("0") as a HASH ref while "strict refs" in use
The affected upstream programs include:
t/02-known.tt/03-format.tt/05-random.tt/06-osgb-grid-to-ll.tt/06-osgb-ll-to-grid.tt/08-out_of_range.tt/13-edge-and-at-sea.t
Some tests that do not exercise the affected coordinate-conversion paths pass, including t/01-load.t, t/04-parsing.t, and t/07-maps.t.
Expected behavior
Perl treats the value declared by use constant ELLIPSOIDS => { ... } as a hash reference. The expression ELLIPSOIDS->{$shape} must resolve the constant value and perform a normal hash lookup under both PerlOnJava backends, matching system Perl.
Technical evidence and diagnosis
The distribution is pure Perl and has no XS, native-library, network, display, or platform-specific prerequisite involved in the failing tests. System Perl passes all 360 upstream tests, while PerlOnJava fails deterministically during compilation/execution on both backends.
The relevant source contains:
use constant ELLIPSOIDS => {
WGS84 => [ ... ],
ETRS89 => [ ... ],
GRS80 => [ ... ],
OSGB36 => [ ... ],
};
and repeatedly uses expressions such as:
exists ELLIPSOIDS->{$shape}
@{ ELLIPSOIDS->{$shape} }
The JVM frontend appears to parse the bareword constant as a package variable and performs strict-vars validation against an array symbol named @ELLIPSOIDS. The interpreter instead evaluates the constant call incorrectly and attempts to dereference the string value "0" as a hash reference. This suggests a shared semantic gap in constant subroutine resolution or bareword/hash-dereference handling, with backend-specific failure paths.
Acceptance criteria
- All 10 upstream test programs and 360 tests pass on the JVM backend.
- The same suite passes on the interpreter backend.
- Add a project-owned focused regression test for hash-reference constants used through bareword dereference syntax, including
exists CONSTANT->{key}and@{ CONSTANT->{key} }cases. - Preserve behavior for ordinary package variables and other constant return types.
Environment
- PerlOnJava CPAN run:
20260914-160652-26153 - Distribution:
Geo-Coordinates-OSGB-2.20 - System Perl: full upstream suite passes
- Affected backends: JVM and interpreter
- Lenguaje dominante
- Perl
- Estrellas
- 64
- Forks
- 6
- Merge medio
- 5 h 18 min
- PR fusionados (30 d)
- 162
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:cpan-port area:parser area:runtime bug
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
fglock/PerlOnJava#1477 ·
-
area:cpan-port area:parser area:unicode bug
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
fglock/PerlOnJava#1476 ·
-
area:backend area:cpan-port area:runtime bug
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
fglock/PerlOnJava#1475 ·
-
area:parser area:warnings bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
fglock/PerlOnJava#1473 ·
Todos los issues de fglock/PerlOnJava
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
corazawaf/coraza-nginx#140 ·
-
1.severity: security
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
api7/lua-resty-saml#63 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100