develooper Front page | perl.perl5.porters | Postings from September 2017

[perl #132008] Term::ReadLine generates empty &STDERR files

Thread Next
From:
James E Keenan via RT
Date:
September 1, 2017 03:13
Subject:
[perl #132008] Term::ReadLine generates empty &STDERR files
Message ID:
rt-4.0.24-12907-1504235620-1866.132008-15-0@perl.org
On Thu, 31 Aug 2017 21:55:28 GMT, TODDR wrote:
> This is a bug report for perl from toddr@cpan.org,
> generated with the help of perlbug 1.40 running under perl 5.26.0.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> We just upgraded to 5.26.0 and noticed that an empty &STDERR file was
> getting created in one of our directories. The root cause was hard to
> track down because it only happened if /dev/tty was inaccessible. To
> re-produce this (probably only on POSIX systems), you can do:
> 
> perl526 -MPOSIX -MTerm::ReadLine -E'exit if(fork); POSIX::setsid();
> exit if(fork); my $t = Term::ReadLine->new("whatever")';
> 
> then
> 
> ls -ld \&STDERR
> 
> This problem bisects back to a conversion of a 2 arg open to a 3 arg
> open in 1ae6ead94905dfee43773cf3b18949c91b33f9d1
> 
> The problem is that redirecting file handles to STDERR (open (my $fh,
> ">&STDERR)) cannot be done as a 3 arg open or it'll actually try to
> write to that file.
> 
> I suggest reverting the fix (Only for the one file
> dist/Term-ReadLine/lib/Term/ReadLine.pm) and also propose this be a
> maintenance fix in 5.26.1
> 
> Todd
> 

Patch attached; also available in the smoke-me/jkeenan/132008-term-readline branch.

But I don't consider it ready to apply to blead as it lacks a test.

Todd:  Can you add a test for the non-creation of '&STDERR' that fails in blead (or 5.26) but passes once patch is applied?

Thank you very much.
-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=132008

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About