POSIX module omits LONG_MAX limit constant

未关闭
#2,091 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
56/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java, perl
领域
backend, testing

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Perl
星标
67
派生
8
平均合并
5 小时 12 分钟
30 天内合并 PR
131

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。