Skip Menu |

This queue is for tickets about the TermReadKey CPAN distribution.

Report information
The Basics
Id: 69131
Status: rejected
Priority: 0/
Queue: TermReadKey

People
Owner: Nobody in particular
Requestors: boyken [...] divms.uiowa.edu
dolmen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Term::ReadKey fails tests
Date: Tue, 28 Jun 2011 10:18:36 -0500
To: bug-TermReadKey [...] rt.cpan.org
From: Karl Boyken <boyken [...] divms.uiowa.edu>
When I build Term::ReadKey on a Red Hat Enterprise Linux Server release 6.1 (Santiago) box, using either Perl 5.12.3 or 5.14.0, "make test" sometimes fails with an "Unable to read terminal settings," and sometimes it fails with a seg fault in the ReadMode 4 test. Summary of my perl5 (revision 5 version 14 subversion 0) configuration: Platform: osname=linux, osvers=2.6.32-131.2.1.el6.x86_64, archname=x86_64-linux-thread-multi uname='linux vserv07.divms.uiowa.edu 2.6.32-131.2.1.el6.x86_64 #1 smp wed may 18 07:07:37 edt 2011 x86_64 x86_64 x86_64 gnulinux ' config_args='-des -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dprefix=/local/pkg/perl/5.14.0 -Dusethreads' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.4.5 20110214 (Red Hat 4.4.5-6)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector' libpth=/usr/local/lib64 /lib64 /usr/lib64 libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.12.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.12' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under linux Compiled at Jun 14 2011 13:46:29 %ENV: PERL="/local/pkg/perl/5.14.0/bin/perl" @INC: /local/pkg/perl/5.14.0/lib/site_perl/5.14.0/x86_64-linux-thread-multi /local/pkg/perl/5.14.0/lib/site_perl/5.14.0 /local/pkg/perl/5.14.0/lib/5.14.0/x86_64-linux-thread-multi /local/pkg/perl/5.14.0/lib/5.14.0 Here's the first case: [root@vserv07 TermReadKey-2.14]# /local/pkg/perl/5.14.0/bin/perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Term::ReadKey Writing MYMETA.yml [root@vserv07 TermReadKey-2.14]# make cp ReadKey.pm blib/lib/Term/ReadKey.pm AutoSplitting blib/lib/Term/ReadKey.pm (blib/lib/auto/Term/ReadKey) /local/pkg/perl/5.14.0/bin/perl /local/pkg/perl/5.14.0/lib/5.14.0/ExtUtils/xsubpp -typemap /local/pkg/perl/5.14.0/lib/5.14.0/ExtUtils/typemap ReadKey.xs > ReadKey.xsc && mv ReadKey.xsc ReadKey.c Please specify prototyping behavior for ReadKey.xs (see perlxs manual) cc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"2.14\" -DXS_VERSION=\"2.14\" -fPIC "-I/local/pkg/perl/5.14.0/lib/5.14.0/x86_64-linux-thread-multi/CORE" ReadKey.c In file included from ReadKey.xs:326: cchars.h: In function ‘XS_Term__ReadKey_GetControlChars’: cchars.h:230: warning: assignment from incompatible pointer type cchars.h:232: warning: assignment from incompatible pointer type cchars.h: In function ‘XS_Term__ReadKey_SetControlChars’: cchars.h:352: warning: assignment from incompatible pointer type cchars.h:354: warning: assignment from incompatible pointer type ReadKey.xs: In function ‘selectfile’: ReadKey.xs:1433: warning: passing argument 2 of ‘Perl_PerlIO_get_cnt’ from incompatible pointer type /local/pkg/perl/5.14.0/lib/5.14.0/x86_64-linux-thread-multi/CORE/proto.h:7159: note: expected ‘struct PerlIOl **’ but argument is of type ‘struct FILE *’ ReadKey.c: In function ‘XS_Term__ReadKey_SetReadMode’: ReadKey.c:1755: warning: assignment from incompatible pointer type ReadKey.c: In function ‘XS_Term__ReadKey_GetTermSizeWin32’: ReadKey.c:1924: warning: assignment from incompatible pointer type ReadKey.c: In function ‘XS_Term__ReadKey_GetTermSizeVIO’: ReadKey.c:1967: warning: assignment from incompatible pointer type ReadKey.c: In function ‘XS_Term__ReadKey_GetTermSizeGWINSZ’: ReadKey.c:2010: warning: assignment from incompatible pointer type ReadKey.c: In function ‘XS_Term__ReadKey_GetTermSizeGSIZE’: ReadKey.c:2053: warning: assignment from incompatible pointer type ReadKey.c: In function ‘XS_Term__ReadKey_SetTerminalSize’: ReadKey.c:2100: warning: assignment from incompatible pointer type ReadKey.c: In function ‘XS_Term__ReadKey_GetSpeed’: ReadKey.c:2130: warning: assignment from incompatible pointer type Running Mkbootstrap for Term::ReadKey () chmod 644 ReadKey.bs rm -f blib/arch/auto/Term/ReadKey/ReadKey.so cc -shared -O2 -fstack-protector ReadKey.o -o blib/arch/auto/Term/ReadKey/ReadKey.so \ \ chmod 755 blib/arch/auto/Term/ReadKey/ReadKey.so cp ReadKey.bs blib/arch/auto/Term/ReadKey/ReadKey.bs chmod 644 blib/arch/auto/Term/ReadKey/ReadKey.bs Manifying blib/man3/Term::ReadKey.3 [root@vserv07 TermReadKey-2.14]# make test PERL_DL_NONLAZY=1 /local/pkg/perl/5.14.0/bin/perl "-Iblib/lib" "-Iblib/arch" -w test.pl And now on to the tests! Term::ReadKey is using TERMIOS, as opposed to TERMIO or SGTTY. Non-blocking reads possible via O_NODELAY, and select(). O_NODELAY will be used. select() will be used for timed reads. Using GetTerminalSize, it appears that your terminal is 80 characters wide by 24 high. Apparently, you are connected at 4104/4104 baud. Unable to read terminal settings in GetControlChars at test.pl line 118. make: *** [test_dynamic] Error 9 And here's the second case: [root@vserv07 TermReadKey-2.14]# make test PERL_DL_NONLAZY=1 /local/pkg/perl/5.14.0/bin/perl "-Iblib/lib" "-Iblib/arch" -w test.pl And now on to the tests! Term::ReadKey is using TERMIOS, as opposed to TERMIO or SGTTY. Non-blocking reads possible via O_NODELAY, and select(). O_NODELAY will be used. select() will be used for timed reads. Using GetTerminalSize, it appears that your terminal is 80 characters wide by 24 high. Apparently, you are connected at 38400/38400 baud. Control chars = (MIN => ^A, SUSPEND => ^Z, DISCARD => ^O, EOF => ^D, REPRINT => ^R, START => ^Q, STOP => ^S, EOL => ^@, TIME => ^@, QUOTENEXT => ^V, ERASE => 127, KILL => ^U, QUIT => ^\, INTERRUPT => ^C, ERASEWORD => ^W, EOL2 => ^@, SWITCH => ^@) And now for the interactive tests. This is ReadMode 1. It's guarranteed to give you cooked input. All the signals and editing characters may be used as usual. You may enter some text here: asdfa You entered `asdfa'. This is ReadMode 2. It's just like #1, but echo is turned off. Great for passwords. You may enter some invisible text here: You entered `adfasdf'. I won't demonstrate ReadMode 3 here. It's your standard cbreak mode, with editing characters disabled, single character at a time input, but with the control characters still enabled. I'm now putting the terminal into ReadMode 4 and using non-blocking reads. All signals should be disabled, including xon-xoff. You should only be able to exit this loop via 'q'. Press a key, or "q" to stop: You pressed `l' after the loop rolled over 835793 times Press a key, or "q" to stop: You pressed `^J' after the loop rolled over 81582 times Press a key, or "q" to stop: You pressed `q' after the loop rolled over 158587 times Here is a similar loop which times out after two seconds: Press a key, or "q" to stop: make: *** [test_dynamic] Segmentation fault (core dumped) -- Karl Boyken, system administrator karl-boyken@uiowa.edu 303A MLH, Dept. of Comp. Sci. http://www.cs.uiowa.edu/~boyken/ The U. of Iowa, Iowa City, IA 52242 319-335-2730 (voice) 319-335-3668 (fax)
Subject: Re: [rt.cpan.org #69131] AutoReply: Term::ReadKey fails tests
Date: Tue, 28 Jun 2011 13:20:48 -0500
To: bug-TermReadKey [...] rt.cpan.org
From: Karl Boyken <boyken [...] divms.uiowa.edu>
Never mind--didn't realize I was trying to build an out of date version of Term::ReadKey. Version 2.30 builds and runs fine. -- Karl Boyken, system administrator karl-boyken@uiowa.edu 303A MLH, Dept. of Comp. Sci. http://www.cs.uiowa.edu/~boyken/ The U. of Iowa, Iowa City, IA 52242 319-335-2730 (voice) 319-335-3668 (fax)
Le 2011-06-28 20:20:58, boyken@divms.uiowa.edu a écrit : Show quoted text
> Never mind--didn't realize I was trying to build an out of date version > of Term::ReadKey. Version 2.30 builds and runs fine. >
So I'm closing the ticket.