POSIX module omits LONG_MAX limit constant

Aperta
#2,091 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, perl
Ambito
backend, testing

Direzione di ricerca

Read src/main/perl/lib/POSIX.pm and src/main/java/org/perlonjava/runtime/perlmodule/POSIX.java to trace how limit constants are exported and bound. Check the existing POSIX module tests and how the project handles platform-width constants. Add regression coverage for direct POSIX::LONG_MAX() calls and the limits export tag; done means supported limit constants work with the correct platform value.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:runtime bug

Summary

The bundled POSIX module does not define or expose POSIX::LONG_MAX, although its Perl façade advertises that constant in the limits export group. Code that successfully loads POSIX and then calls the constant dies with Undefined subroutine &POSIX::LONG_MAX.

In src/main/perl/lib/POSIX.pm, LONG_MAX appears in the limits constant/export lists, but the constant-generation loop only creates wrappers for a smaller set of names. Those wrappers call POSIX::_const_NAME(). src/main/java/org/perlonjava/runtime/perlmodule/POSIX.java does not register _const_LONG_MAX (or the POSIX limits constants), so the façade cannot provide this function through its current binding path.

Reproducer

require POSIX;
print POSIX::LONG_MAX(), "\n";

Expected on this 64-bit macOS host: 9223372036854775807
Actual on PerlOnJava: Undefined subroutine &POSIX::LONG_MAX called

System Perl 5.42.2 returns the expected value. PerlOnJava's require POSIX succeeds, then the call fails.

CPAN evidence

This aborts Number-Range-Regex-0.20 in t/02-regex_range.t at line 330 during CPAN tester run 20261117-153921-75160. The test has a fallback only when require POSIX fails; because the bundled module loads but omits LONG_MAX, the call is made and exits before the remaining 15 planned assertions. The system-Perl oracle passed this file and the complete suite (11 files, 4,973 tests).

Local environment: macOS ARM64, Java 24.0.2, system Perl 5.42.2; local PerlOnJava source was c832739ecc1888eb5038491ecfe369849fc2057c and ./jperl -v reports 5.44.1.

Proposed scope

Provide the POSIX limit constants supported by the project on this platform through the Perl façade and Java module bindings, with regression coverage for direct calls and the relevant export tag. Confirm platform-width behavior rather than hard-coding a value that is wrong on other architectures.

Lingua principale
Perl
Stelle
67
Fork
8
Merge medio
5h 12m
PR unite (30g)
131

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fglock/PerlOnJava

Tutte le issue di fglock/PerlOnJava

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.