develooper Front page | perl.perl5.porters | Postings from July 2011

[perl #95748] IPC::Open3::open3(..., '-') broken

Thread Previous | Thread Next
From:
Salvador Fandiño
Date:
July 27, 2011 03:50
Subject:
[perl #95748] IPC::Open3::open3(..., '-') broken
Message ID:
rt-3.6.HEAD-7815-1311763413-596.95748-75-0@perl.org
# New Ticket Created by  Salvador Fandiño 
# Please include the string:  [perl #95748]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=95748 >



This is a bug report for perl from sfandino@yahoo.com,
generated with the help of perlbug 1.39 running under perl 5.14.1.


-----------------------------------------------------------------
[Please describe your issue here]

IPC::Open3::open3($in, $out, $err, '-') is broken in 5.14.1

Because the old "return 0" used to return to user code now is wrapped inside and eval block.

The following patch solves the problem:

====================================================================
--- Open3.pm~    2011-07-27 10:09:39.072915811 +0200
+++ Open3.pm    2011-07-27 12:30:08.066949005 +0200
@@ -284,12 +284,15 @@
         } else {
             xopen \*STDERR, ">&STDOUT" if fileno(STDERR) != fileno(STDOUT);
         }
-        return 0 if ($cmd[0] eq '-');
+        return 1 if ($cmd[0] eq '-');
         exec @cmd or do {
             local($")=(" ");
             croak "$Me: exec of @cmd failed";
         };
-        };
+        } and do {
+                close $stat_w;
+                return 0;
+            };
 
         my $bang = 0+$!;
         my $err = $@;
====================================================================

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=high
    module=IPC::Open3
---
Site configuration information for perl 5.14.1:

Configured by salva at Wed Jul 27 09:56:26 CEST 2011.

Summary of my perl5 (revision 5 version 14 subversion 1) configuration:
   
  Platform:
    osname=linux, osvers=3.0.0-5-generic, archname=x86_64-linux
    uname='linux leon 3.0.0-5-generic #6-ubuntu smp tue jul 12 05:21:50 utc 2011 x86_64 x86_64 x86_64 gnulinux '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.6.1', 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 -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/lib/x86_64-linux-gnu /lib64 /usr/lib64
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.13'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.14.1:
    /usr/local/perl/5.14.1//lib/site_perl/5.14.1/x86_64-linux
    /usr/local/perl/5.14.1//lib/site_perl/5.14.1
    /usr/local/perl/5.14.1//lib/5.14.1/x86_64-linux
    /usr/local/perl/5.14.1//lib/5.14.1
    .

---
Environment for perl 5.14.1:
    HOME=/home/salva
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/bash

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About