bug: resolve qualified class method calls without subroutine recursion
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
- 30/100
Piste de recherche
Start with the minimal reproducer in the body: run it on both the JVM and interpreter backends to confirm the Deep recursion and StackOverflowError. The bug is in how a fully qualified Class::Name->method invocant is resolved when a subroutine of the same name exists, so the parser or call-resolution code for class-method invocants is the place to look. Done means the reproducer prints Probe::Thing on both backends and existing direct-call and indirect-object tests still pass.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
Data::ParseBinary v0.31 fails on PerlOnJava because its Struct helper recursively calls itself instead of invoking the Data::ParseBinary::Struct->create class method. The archived CPAN random-tester run 20261120-195805-13340 reports a StackOverflowError in t/01various.t; the system-Perl oracle passes all 275 tests.
The same reduced case fails on the current main launcher (build 2211d46023) on both the JVM and interpreter backends. System Perl passes it.
Root cause
A fully qualified class invocant is confused with a same-named fully qualified subroutine. In Data::ParseBinary, the helper Data::ParseBinary::Struct and the class package Data::ParseBinary::Struct share that name. Perl treats Data::ParseBinary::Struct->create(...) as a class method call. PerlOnJava routes the package token back to the existing Data::ParseBinary::Struct function, causing unbounded recursion.
The collision can be reduced without the CPAN distribution:
use strict;
use warnings;
package Probe;
sub Thing { return Probe::Thing->create(@_) }
package Probe::Thing;
sub create { return bless { name => $_[1] }, $_[0] }
package main;
my $thing = Probe::Thing();
print ref($thing), "\n";
Expected output under standard Perl:
Probe::Thing
PerlOnJava emits Deep recursion on subroutine "Probe::Thing" and then StackOverflowError on both backends. The stack repeats the Probe::Thing function at the Probe::Thing->create source line.
Control cases pass on PerlOnJava: using a scalar containing Probe::Thing as the method invocant, calling Probe::Thing::create(...) directly, and calling a static method on a package without a same-named subroutine. This isolates the failure to resolving the literal fully qualified class name when that name is also a callable subroutine.
CPAN evidence
- Distribution:
Data-ParseBinaryv0.31 (pure Perl) - Run:
20261120-195805-13340 - System Perl: all 275 tests pass
- PerlOnJava: 4 of 5 test programs fail after
t/01various.thitsStackOverflowError; the later parse errors are consequences of the missing TAP plans - Current main focused reproducer: JVM and interpreter both fail with the same recursion
Related issues
- #1166 covers valid fully qualified indirect-constructor forms such as
new HTTP::Response ...; it does not cover explicitClass::Name->method()syntax colliding with a same-named function. - #1222 tracks Perl-compatible deep-recursion warnings. This reproducer enters unintended recursion and overflows; it is a method-call resolution defect, not only a warning mismatch.
Acceptance criteria
- The minimal reproducer prints
Probe::Thingon both PerlOnJava backends without a recursion warning or stack overflow. - Existing direct subroutine and indirect-object parsing behavior remains intact.
Data-ParseBinaryv0.31 passes its upstream suite on both PerlOnJava backends.
- Langage dominant
- Perl
- Étoiles
- 67
- Forks
- 8
- Merge moyen
- 4 h 36 min
- PR mergées (30 j)
- 123
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
-
area:runtime bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
fglock/PerlOnJava#2164 ·
Les mainteneurs répondent en général sous 1 jour
-
area:cpan-port bug
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
fglock/PerlOnJava#2153 ·
Les mainteneurs répondent en général sous 1 jour
-
area:cpan-port area:parser bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
fglock/PerlOnJava#2137 ·
Les mainteneurs répondent en général sous 1 jour
-
area:backend area:cpan-port area:runtime bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
fglock/PerlOnJava#2071 ·
Les mainteneurs répondent en général sous 1 jour
-
area:runtime documentation enhancement
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
Toutes les issues de fglock/PerlOnJava
Issues similaires
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling linksOuverteteam-cli
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 93/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
inverse-inc/packetfence#9728 ·
Les mainteneurs répondent en général sous 1 jour
-
fix(char-create): show the real reason a character is refusedPeut-être pris @baphomello l’a pris il y a 1 jour. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour