Front page | perl.perl5.porters |
Postings from July 2001
[ID 20010723.011] IO::Pty objects and the -t operator
From:
Hans Ecke
Date:
July 23, 2001 18:54
Subject:
[ID 20010723.011] IO::Pty objects and the -t operator
Message ID:
200107240153.TAA02235@lager.advance.com
This is a bug report for perl from hans@ecke.ws,
generated with the help of perlbug 1.28 running under perl v5.6.0.
-----------------------------------------------------------------
Hi List,
this mail tries to report a bug with the IO::Pty module on SunOS.
I first noticed this bug last year trying to use the Expect module
which breaks due to it.
When I notified Roland Giersig (Roland.Giersig@alcatel.at), the current
maintainer, he said its not really a bug. I disagree. I never really
followed up on this due to personal upheavals. Now I'm again working
with Expect and again it dies on SunOS.
Following is my original bugreport (slightly edited). If the list agrees
with Roland that its not a bug, please explain why. If you guys think
this is a real bug, do you have any idea how to fix it?
I omit Rolands original reply because he wrote that privately and might
object in having it public. I also didn't really understand it :-)
************ begin original bugreport **************
Please consider the following minimal perl program:
perl -MIO::Pty -e'$T=new IO::Pty;print ${*$T}{'io_pty_ttyname'};if(-t
$T){print " is a tty\n";}else{print " is no tty\n";}'
You would expect it to print "xxx is a tty" in _any_ case. In fact, it
does not.
IRIX64 6.5 : /dev/ttyq8 is a tty
SunOS 5.6 : /dev/pts/11 is no tty
Linux 2.2 (Redhat 7.0): /dev/pts/1 is a tty
AIX 4.3 : /dev/pts/3 is a tty
All of them are Perl 5.6 with current IO::Pty.
Tty.xs seems to have to wade through pretty thick muck to implement
OpenPTY (which is called by IO::Pty::new()). I guess something in there
goes wrong.
************* end original bugreport ********************
This might be good or bad, the problem is that this behavior breaks
Expect.pm. An Expect object inherits from IO::Pty. The function
Expect::exp_stty() calls both POSIX::isatty() (which fails because its
identical to -t) and IO::Stty::stty(). IO::Stty::stty() calls isatty()
and a lot of terminal related stuff I don't really understand. Anyhow
the first isatty() will kill Expect::exp_stty().
This is the reason I believe this is a bug: It breaks the Expect module.
If you think this too, please write where to start digging for a solution.
We need it working for an in-company program and could spend some
(not too much) manpower on fixing this.
Please CC: Chris Jones (crs@acm.org) as he is the co-developer.
Thank you very much
Hans Ecke (hans@ecke.ws)
-----------------------------------------------------------------
---
Flags:
category=library
severity=high
---
Site configuration information for perl v5.6.0:
Configured by crs at Tue Nov 28 19:01:02 MST 2000.
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
Platform:
osname=solaris, osvers=2.8, archname=sun4-solaris
uname='sunos lager 5.8 generic sun4u sparc sunw,ultra-80 '
config_args='-de'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define
use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
Compiler:
cc='cc', optimize='-O', gccversion=
cppflags=''
ccflags =' -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/opt/SUNWspro/WS6/lib '
libpth=/opt/SUNWspro/WS6/lib /lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc -lcrypt -lsec
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-KPIC', lddlflags='-G -L/opt/SUNWspro/WS6/lib'
Locally applied patches:
---
@INC for perl v5.6.0:
.
/lair/hecke/apps/lib/perl5/site-lib
/usr/share/lib/perl5/5.6.0/sun4-solaris
/usr/share/lib/perl5/5.6.0
/usr/share/lib/perl5/site_perl/5.6.0/sun4-solaris
/usr/share/lib/perl5/site_perl/5.6.0
/usr/share/lib/perl5/site_perl
.
---
Environment for perl v5.6.0:
HOME=/lair/hecke
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH=/lair/hecke/promax/2003.0/sys/lib:
LOGDIR (unset)
PATH=/lair/hecke/promax/2003.0/sys/exe:.:/lair/hecke/apps/bin:/lair/hecke/apps/bin/sunos:/usr/bin:/usr/games:/usr/java/jre/bin:/usr/local/java/bin:/usr/openwin/bin:/pub/tools/perl/latest/bin:/pub/tools/perl/5.6.0/bin:/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/ucb:/usr/xpg4/bin:/etc:/promax/2003.0/sys/bin:/promax/2003.0/sys/exe:/promax/2003.0/port/bin
PERL5LIB=.:/lair/hecke/apps/lib/perl5/site-lib:
PERL_BADLANG (unset)
SHELL=/usr/local/bin/bash
-
[ID 20010723.011] IO::Pty objects and the -t operator
by Hans Ecke