# New Ticket Created by Mark Martinec
# Please include the string: [perl #61976]
# in the subject line of all future correspondence about this issue.
# <URL:
http://rt.perl.org/rt3/Ticket/Display.html?id=61976 >
This is a bug report for perl from [email protected: r...@patsy.ijs.si],
generated with the help of perlbug 1.35 running under perl v5.10.0.
-----------------------------------------------------------------
[Please enter your report here]
With Perl 5.10.0 in taint mode, evaluating a $! variable in
a string context does not yield a system error message text,
but gives a numeric errno code.
The problem is reproducible with an EPIPE error, although
I can not reproduce it with a more trivial I/O error.
The problem is reproducible on all platforms that I tried:
FreeBSD 6.3 in 32-bit mode, FreeBSD 7.0 in 64-bit mode,
and on Linux 2.6.27.9-159.fc10.x86_64.
The following example illustrates the problem.
Standard output is piped into a program which does not read from
its stdin, such as a 'true', intentionally causing a broken pipe:
$ date | /usr/local/bin/perl5.10.0 -T -e '
$|=1; $SIG{PIPE}="IGNORE"; my $s=<STDIN>;
print $s or die "error writing: $!\n"' | true
error writing: 32
The same command with perl 5.8.8 works as expected,
reporting a 'Broken pipe' instead of a '32':
$ date | /usr/local/bin/perl5.8.8 -T -e '
$|=1; $SIG{PIPE}="IGNORE"; my $s=<STDIN>;
print $s or die "error writing: $!\n"' | true
error writing: Broken pipe
Without a -T switch even the perl5.10.0 yields a correct result:
$ date | /usr/local/bin/perl5.10.0 -e '
$|=1; $SIG{PIPE}="IGNORE"; my $s=<STDIN>;
print $s or die "error writing: $!\n"' | true
error writing: Broken pipe
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=medium
---
This perlbug was built using Perl v5.8.8 - Fri Nov 21 17:20:57 UTC 2008
It is being executed now by Perl v5.10.0 - Fri Nov 21 16:22:04 UTC 2008.
Site configuration information for perl v5.10.0:
Configured by root at Fri Nov 21 16:22:04 UTC 2008.
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
Platform:
osname=freebsd, osvers=6.3-release-p4, archname=i386-freebsd
uname='freebsd patsy.ijs.si 6.3-release-p4 freebsd 6.3-release-p4 #1: sun sep 14 11:22:58 cest 2008 lesi@patsy.ijs.si:usrobjusrsrcsyspatsy i386 '
config_args='-de'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include',
optimize='-O',
cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='3.4.6 [FreeBSD] 20060305', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags ='-Wl,-E -L/usr/local/lib'
libpth=/usr/lib /usr/local/lib
libs=-lm -lcrypt -lutil -lc
perllibs=-lm -lcrypt -lutil -lc
libc=, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib'
Locally applied patches:
defined-or
---
@INC for perl v5.10.0:
/usr/local/lib/perl5/5.10.0/i386-freebsd
/usr/local/lib/perl5/5.10.0
/usr/local/lib/perl5/site_perl/5.10.0/i386-freebsd
/usr/local/lib/perl5/site_perl/5.10.0
.
---
Environment for perl v5.10.0:
HOME=/root
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/root/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
PERL_BADLANG (unset)
SHELL=/usr/local/bin/bash