POSIX module omits LONG_MAX limit constant

Aberta
#2,091 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
56/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
java, perl
Domínio
backend, testing

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Perl
Estrelas
67
Forks
8
Merge médio
5h 12min
PRs com merge (30d)
131

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de fglock/PerlOnJava

Todas as issues de fglock/PerlOnJava

Issues semelhantes

Mais issues de Perl

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.