Fix Perl-compatible scalar filehandle and truncate failure semantics
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start by reproducing the six failures in t/recordstore.t on both the JVM and interpreter backends, then trace the shared runtime paths for scalar filehandles and truncate. Done means Perl-compatible undefined and failure values, correct error propagation, passing t/recordstore.t on both backends, and green filehandle, chmod, truncate, and error-propagation tests.
Written by the indexing model from the issue text.
Description
Data::RecordStore exposes two PerlOnJava I/O semantic differences
Summary
The CPAN compatibility run for Data::RecordStore v5.03 reports 6 failures in t/recordstore.t. The complete upstream suite passes under system Perl, while both the JVM backend and the interpreter backend reproduce the same failures.
CPAN run: 20260916-111623-23683
Results
- System Perl: 1,339/1,339 tests pass.
- PerlOnJava JVM backend: 6/328 assertions fail in
t/recordstore.t; the other three test programs pass. - PerlOnJava interpreter backend: the same 6 assertions fail.
- The failure is not a dependency or native-code problem;
Data::RecordStoreis pure Perl.
The six failures are two behaviors repeated once for each store mode:
t/recordstore.texpects a localized scalar filehandle opened with
open STDERR, ">>", \$outto leave$outundefined when nothing is
written. PerlOnJava initializes it to a defined empty string instead.- The test changes a record file to mode
0444and calls the module’s
emptymethod. The implementation uses
truncate($first, 0) // die "Unable to empty silo ...". Under system
Perl,truncatereturnsundefwith a permission error and the expected
exception is raised. Under PerlOnJava,truncatereturns a defined false
value with aTruncate failed: ...error, so the defined-or die path is
skipped and the test incorrectly sees the operation as successful.
Minimal behavior comparison:
system Perl: scalar STDERR target remains undef
PerlOnJava: scalar STDERR target becomes defined ""
system Perl: truncate(0444-file, 0) returns undef
PerlOnJava: truncate(0444-file, 0) returns defined false
Both PerlOnJava backends show the same results, so this is shared runtime I/O behavior rather than a backend-specific compiler issue.
Impact and priority
MetaCPAN reports 2 released runtime dependants of Data::RecordStore:
Data::ObjectStore and Yote. Neither has released within the last three
years. This distribution-level footprint does not support the high-impact
label, although the underlying scalar-filehandle and file-operation semantics
may affect other Perl code beyond this CPAN consumer.
Suggested acceptance criteria
- A localized scalar filehandle opened for append preserves Perl’s undefined
value until data is written. - Failed
truncateoperations return Perl-compatible failure values and set
the appropriate error state so// dieerror paths execute. Data::RecordStoret/recordstore.tpasses on both JVM and interpreter
backends.- Existing filehandle,
chmod,truncate, and error-propagation tests remain
green.
- Dominant language
- Perl
- Stars
- 64
- Forks
- 6
- Avg merge
- 5h 25m
- Merged PRs (30d)
- 157
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fglock/PerlOnJava#1341 ·
-
area:cpan-port bug
Difficulty 4/5 3-5 days Newbie friendliness 44/100
fglock/PerlOnJava#1459 ·
-
area:cpan-port bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
fglock/PerlOnJava#1457 ·
-
bug high-impact
Difficulty 3/5 1-2 days Newbie friendliness 67/100
fglock/PerlOnJava#1456 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 72/100
fglock/PerlOnJava#1455 ·
All issues in fglock/PerlOnJava
Similar issues
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
api7/lua-resty-saml#63 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100