Subject: | ReadKey from empty string causes segfault under cygwin/perl 5.14.4 |
Date: | Wed, 26 Aug 2015 07:31:35 +0000 |
To: | "bug-TermReadKey [...] rt.cpan.org" <bug-TermReadKey [...] rt.cpan.org> |
From: | Luke Goodsell <Luke.Goodsell [...] ogt.com> |
Hi,
Please can you help me to diagnose this issue? I reported it first to the Cygwin mailing list, but was directed to report it to the Term::ReadKey bug tracker.
Attempting Term::ReadKey from an empty string under Cygwin with Perl 5.14.4 causes perl to segmentation fault. The same command on Debian with Perl 5.14.2, or with a non-empty string, works fine.
Example command:
Show quoted text
> perl -MTerm::ReadKey -we 'my $input = ""; open(my $stdin, "<", \$input) or die "failed to open: $!"; local *STDIN = $stdin; ReadMode "raw"; my $response = ReadKey(1, \*STDIN); ReadMode "normal"; if(defined($response)) { print "Got \"$response\"\n"; } else { print "Got undef\n"; }'
Response under cygwin:
Show quoted text> Segmentation fault (core dumped)
Response under Debian:
Show quoted text> Got ""
Changing $input to anything non-empty works properly in both environments.
Cygwin dll version: 1.7.32
Perl version: 5.14.4
Term::ReadKey version: 2.33
Kind regards,
Luke