You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[JVM/interpreter] local STDERR to IO::Scalar does not capture output #2034
area:backendJVM interpreter or execution-backend behaviorarea:ioFiles handles paths and networkingblocked:ownershipBlocked pending Perl ownership/refcount/DESTROY work (issue #2043).bugSomething isn't working
Localizing STDERR to an IO::Scalar handle does not capture output on either PerlOnJava backend.
Reproducer
use strict;
use warnings;
use IO::Scalar;
my$capture = IO::Scalar->new();
{
local *STDERR = $capture;
printSTDERR"diagnostic\n";
}
die"diagnostic was not captured"unless"$capture"eq"diagnostic\n";
System Perl captures the diagnostic. PerlOnJava's JVM and interpreter backends leave the buffer empty.
CPAN evidence
Grep::Query 1.011, CPAN random run 20261111-090841-71684.
System Perl 5.42.2 passes all 490 tests.
PerlOnJava reports 468/490 passing. t/11-invalid.t fails 14/21 assertions because Grep::Query::Parser localizes STDERR to IO::Scalar while collecting Parse::RecDescent diagnostics; the buffer stays empty and the test sees UNKNOWN ERROR.
The reproducer passes on system Perl and fails on both PerlOnJava backends.
Root cause
The localized STDERR glob does not route writes to the replacement IO::Scalar handle. This prevents callers from retrieving output written through STDERR during the localized scope.
Related work
Issue #2015 covers Capture::Tiny's interpreter failure while duplicating STDOUT. This reproducer exercises direct STDERR localization to IO::Scalar and fails on both backends.
Acceptance criteria
local *STDERR = $capture routes print STDERR to the replacement handle on both PerlOnJava backends.
The reproducer and Grep::Query 1.011 t/11-invalid.t pass on system Perl and both PerlOnJava backends.
State: blocked
Agent/session: Codex / io-archive-2034-2037-20261112
Scope: #2034; direct localized STDERR writes from a blessed IO::Scalar object on JVM and interpreter, with project regression coverage.
Work: feature/io-archive-capture-2034-2037, source 543f9df; no code changes or PR yet.
Checkpoint: 2026-11-12; the focused test passes system Perl and fails on the exact parent JAR on both PerlOnJava backends with an empty buffer. Direct object print, local *STDERR = *$capture, and localization to a normal lexical filehandle pass on both backends. The failing boundary is direct typeglob assignment from the blessed overloaded handle object.
Evidence: parent source 543f9dfef; nice -n 19 make passed in 17m01 (/tmp/io-archive-parent-make.log). System Perl regression result: /tmp/localized_stderr_io_scalar-perl.log; exact-parent JVM/interpreter failures: /tmp/issue2034-parent-jvm.log, /tmp/issue2034-parent-interpreter.log; parity probes: /tmp/issue2034-probe-perl.log, /tmp/issue2034-probe-jvm.log, /tmp/issue2034-probe-interpreter.log.
Blocked by: #2043 active ownership migration overlaps the required RuntimeGlob/runtime typeglob assignment path (PR #1938 changes RuntimeGlob, RuntimeIO, and both backend assignment paths). No overlapping edits made.
Next: reconcile with the #2043 owner after its active slice lands or a non-overlapping handoff is agreed, then implement and validate the focused fix.
Status update: PR #2076 merged as c832739e and closed #2058, #2055, and #2047. It did not include the localized STDERR to IO::Scalar fix. Issue #2034 remains blocked by the #2043 owner-slot work in open PR #1938, which still changes the overlapping RuntimeGlob/RuntimeIO typeglob assignment path. I made no #2034 code changes. The existing parent reproducer and backend evidence remain in the blocked claim above; this issue needs an explicit non-overlapping handoff or the #2043 work to land before implementation can resume.
area:backendJVM interpreter or execution-backend behaviorarea:ioFiles handles paths and networkingblocked:ownershipBlocked pending Perl ownership/refcount/DESTROY work (issue #2043).bugSomething isn't working
Activity
fglock commentedon Nov 12, 2026
State: blocked
Agent/session: Codex / io-archive-2034-2037-20261112
Scope: #2034; direct localized STDERR writes from a blessed IO::Scalar object on JVM and interpreter, with project regression coverage.
Work: feature/io-archive-capture-2034-2037, source 543f9df; no code changes or PR yet.
Checkpoint: 2026-11-12; the focused test passes system Perl and fails on the exact parent JAR on both PerlOnJava backends with an empty buffer. Direct object print,
local *STDERR = *$capture, and localization to a normal lexical filehandle pass on both backends. The failing boundary is direct typeglob assignment from the blessed overloaded handle object.Evidence: parent source
543f9dfef;nice -n 19 makepassed in 17m01 (/tmp/io-archive-parent-make.log). System Perl regression result:/tmp/localized_stderr_io_scalar-perl.log; exact-parent JVM/interpreter failures:/tmp/issue2034-parent-jvm.log,/tmp/issue2034-parent-interpreter.log; parity probes:/tmp/issue2034-probe-perl.log,/tmp/issue2034-probe-jvm.log,/tmp/issue2034-probe-interpreter.log.Blocked by: #2043 active ownership migration overlaps the required
RuntimeGlob/runtime typeglob assignment path (PR #1938 changesRuntimeGlob,RuntimeIO, and both backend assignment paths). No overlapping edits made.Next: reconcile with the #2043 owner after its active slice lands or a non-overlapping handoff is agreed, then implement and validate the focused fix.
fglock commentedon Nov 17, 2026
Status update: PR #2076 merged as
c832739eand closed #2058, #2055, and #2047. It did not include the localizedSTDERRtoIO::Scalarfix. Issue #2034 remains blocked by the #2043 owner-slot work in open PR #1938, which still changes the overlappingRuntimeGlob/RuntimeIOtypeglob assignment path. I made no #2034 code changes. The existing parent reproducer and backend evidence remain in the blocked claim above; this issue needs an explicit non-overlapping handoff or the #2043 work to land before implementation can resume.