This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Perl Term::ReadKey from empty scalar Segfaults under cygwin only (1.7.32 x86_64)
- From: Luke Goodsell <Luke dot Goodsell at ogt dot com>
- To: Achim Gratz <Stromeko at NexGo dot DE>, "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Tue, 25 Aug 2015 09:52:28 +0000
- Subject: RE: Perl Term::ReadKey from empty scalar Segfaults under cygwin only (1.7.32 x86_64)
- Authentication-results: sourceware.org; auth=none
- References: <59C49FE16E416F46873F86D530DA80520BD519 at ExchangeServer dot internal dot ogtip dot com> <loom dot 20150825T113314-983 at post dot gmane dot org>
Hi Achim,
> The stacktrace is useless, but if you run this under strace you'll also see a message that doesn't make it to the output otherwise:
That arises from the subsequent print statement, which is never reached under cygwin.
Alternative command that eliminates that warning:
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"; }'
> Please report this upstream.
To whom would that be? Perl devs?
Kind regards,
Luke
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple