Repository navigation
Description
Summary
Capture::Tiny output capture fails on the PerlOnJava interpreter. Duadua 0.36's t/50_cli.t uses Capture::Tiny and exits before completing its assertions when run with the interpreter. The same test passes under system Perl and the PerlOnJava JVM backend.
This was found while investigating CPAN random run 20261109-091152-39587. That run's archived default-backend log ends after t/15_reparse.t without a harness summary, so its Unknown test outcome is inconclusive and is not evidence for this interpreter failure. The full Duadua suite passes under system Perl and under the default PerlOnJava launcher/JVM backend (6 files, 490 tests).
Minimal reproducer
use Capture::Tiny qw(capture);
my ($stdout, $stderr) = capture { print "captured\n" };
die "unexpected capture: $stdout" unless $stdout eq "captured\n";
die "unexpected stderr: $stderr" if length $stderr;
print "capture ok\n";Run the program with system Perl, the PerlOnJava JVM backend, and the PerlOnJava interpreter backend.
Results
- System Perl 5.42.2: prints
capture okand exits 0. - PerlOnJava JVM backend: prints
capture okand exits 0. - PerlOnJava interpreter backend: fails before the capture callback completes with
Bad file descriptorwhileCapture::TinyduplicatesSTDOUT. - Duadua 0.36
t/50_cli.t: passes under system Perl and the JVM backend; under the interpreter it exits with status 255 after 9 assertions, beforedone_testing.
The failing call path is Capture::Tiny::_capture_tee -> _open_std -> _open. _open_std opens STDOUT in dup mode (>&); _open reports the bad descriptor. The reproducer uses the pure-Perl Capture::Tiny 0.50 module.
Environment
- macOS 26.7.1
- OpenJDK 24.0.2 (Temurin)
- PerlOnJava launcher built from local master commit
13db7bd4a0(2026-11-05) - Duadua 0.36;
Capture::Tiny0.50
Related issue
Issue #1165 fixed duplication of a tied filehandle. This reproducer is a separate interpreter failure in Capture::Tiny's ordinary capture path; the JVM backend succeeds.
Acceptance criteria
- The minimal reproducer succeeds on both PerlOnJava backends and system Perl.
- Duadua 0.36
t/50_cli.tand the full upstream suite pass under the interpreter. - Add a focused project-owned regression test validated with system Perl first.
Activity
fglock commentedon Nov 11, 2026
State: active
Agent/session: codex-root-io-2024-2023-2015-2018-20261111
Scope: #2024, #2023, #2015, #2018; bundled IO::Handle load warnings, File::Temp IPC::Run3 spooling, interpreter STDOUT duplication, and shebang trailing semicolon launch behavior, with project regression tests.
Work: fix/io-handles-script-launch-2015-2024, source 0c06151; no PR yet.
Checkpoint: 2026-11-11; reports are open and current issue bodies contain no comments or claims. No linked issue-specific PR found in the initial title search. Investigating code paths and independent acceptance tests.
Evidence: issue reports #2024/#2023/#2015/#2018; source checkout 0c06151.
Blocked by: none known. #2023 notes possible relation to #1649 but no prerequisite is established.
Next: reproduce on the current source, implement focused fixes and tests, validate against system Perl and both PerlOnJava backends.
fglock commentedon Nov 11, 2026
Related to #2023 within CPAN run
20261109-091152-39587: both affect subprocess I/O, but by distinct mechanisms. #2023 fails while spooling scalar input throughFile::TempandIPC::Run3; this issue fails when the interpreter duplicatesSTDOUTforCapture::Tiny. The #2023 resource-lifetime path is also an acceptance case for #1649, but this descriptor-duplication issue is not dependent on that broader ownership project. #2024 and #2018 are separate module-load warning and shebang parsing findings from the same run.fglock commentedon Nov 11, 2026
Update from the focused reproducer: the interpreter failure occurs when
File::Temp->newis stored through a nested||=hash assignment; the resulting handle'sfilenobecomes undef before Capture::Tiny redirects STDOUT. This is a concrete hash-slot/resource-lifetime case related to #1649's ownership work, superseding the earlier note that this descriptor-duplication issue was not dependent on that project. #2023 also exercises File::Temp handles, but its current IPC::Run3 scalar-spooling reproducer passes on both backends after stdin forwarding, so a shared root cause with this issue remains unproven.fix: correct IO and script launch compatibility
fglock commentedon Nov 11, 2026
Current status (2026-11-11)
The independent fixes for #2018, #2023, and #2024 are in PR #2035, rebased on current
masterand locally validated withmakeandmake check-links.The #2015 reproducer still fails on the interpreter when a
File::Tempobject is stored through nested||=hash assignment: itsfilenobecomes undefined before Capture::Tiny redirects STDOUT. This is the hash-slot/resource lifetime behavior tracked in #1649. Per the requested dependency, implementation of this part is deferred until #1649 is complete. #1649 remains open; its current PR #1938 is also marked unmergeable, so there is no completed ownership fix to build on yet.fglock commentedon Nov 11, 2026
Follow-up after PR #2035 merged (2026-11-11)
PR #2035 merged as
daa2d54d81b430f7185a69b0f1614dc4577ffdf8; it resolves the independent #2018, #2023, and #2024 findings. This issue remains open and is not fixed by that PR.The interpreter reproducer still loses
filenofor aFile::Tempobject stored through nested||=hash assignment before Capture::Tiny redirects STDOUT. This is the hash-slot/resource lifetime behavior tracked by #1649. As agreed, implementation remains deferred until #1649 is complete. #1649 is still open, and its current PR #1938 is open with merge state unknown.test: cover nested hash File::Temp owner lifetime (#2015)
docs: record current-master issue 1649 acceptance
fglock commentedon Nov 12, 2026
Dependency update (2026-11-12)
The #2015 reproducer still loses
filenofor aFile::Tempobject stored through nested||=hash assignment before Capture::Tiny redirects STDOUT. This remains a resource-lifetime/ownership case. The prior comments refer to #1649, which is now closed; the active successor work is #2043, with its current implementation tracked in draft PR #1938.Implementation and acceptance reruns for this case remain deferred until #2043 delivers or hands off the relevant owner-slot behavior. This updates the dependency reference; it does not claim the issue is fixed.
test: cover nested hash File::Temp owner lifetime (#2015)