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

[perl #118767] fatal warnings, local $?, qx() odd interaction

From:
Todd Hepler
Date:
July 8, 2013 00:13
Subject:
[perl #118767] fatal warnings, local $?, qx() odd interaction
Message ID:
rt-3.6.HEAD-2552-1373041003-1517.118767-75-0@perl.org
# New Ticket Created by  Todd Hepler 
# Please include the string:  [perl #118767]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118767 >




This is a bug report for perl from thepler@genome.wustl.edu,
generated with the help of perlbug 1.39 running under perl 5.18.0.


-----------------------------------------------------------------

gist:
http://gist.github.com/thepler/5920936

here it is inline:
# is this difference in $? expected or a bug?

$ perl -e 'use warnings; local $?; qx(command_not_in_path_arglebargle 2>&1); print "$?\n";'
-1
$ perl -e 'use warnings FATAL => "all"; local $?; qx(command_not_in_path_arglebargle 2>&1); print "$?\n";'
0
$ perl -e 'use warnings; qx(command_not_in_path_arglebargle 2>&1); print "$?\n";'
-1
$ perl -e 'use warnings FATAL => "all"; qx(command_not_in_path_arglebargle 2>&1); print "$?\n";'
512

I tripped on the zero case (the second invocation) above.  I expected $? to be non-zero after the qx().

I get consistent results for the above on 5.8.7, 5.10.1, and 5.18.0.  Those are the only versions I tried.



-----------------------------------------------------------------
---
Flags:
    category=library
    severity=low
    module=warnings
---
Site configuration information for perl 5.18.0:

Configured by thepler at Tue May 21 13:31:32 CDT 2013.

Summary of my perl5 (revision 5 version 18 subversion 0) configuration:

  Platform:
    osname=darwin, osvers=12.3.0, archname=darwin-2level
    uname='darwin dhcp-10-0-108-54.gsc.wustl.edu 12.3.0 darwin kernel version 12.3.0: sun jan 6 22:37:10 pst 2013; root:xnu-2050.22.13~1release_x86_64 x86_64 '
    config_args='-de -Dprefix=/Users/thepler/perl5/perlbrew/perls/perl-5.18.0 -Aeval:scriptdir=/Users/thepler/perl5/perlbrew/perls/perl-5.18.0/bin'
    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-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
    optimize='-O3',
    cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.27)', 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='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'

Locally applied patches:


---
@INC for perl 5.18.0:

/Users/thepler/perl5/perlbrew/perls/perl-5.18.0/lib/site_perl/5.18.0/darwin-2level
    /Users/thepler/perl5/perlbrew/perls/perl-5.18.0/lib/site_perl/5.18.0

/Users/thepler/perl5/perlbrew/perls/perl-5.18.0/lib/5.18.0/darwin-2level
    /Users/thepler/perl5/perlbrew/perls/perl-5.18.0/lib/5.18.0
    .

---
Environment for perl 5.18.0:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/thepler
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)

PATH=/Users/thepler/perl5/perlbrew/bin:/Users/thepler/perl5/perlbrew/perls/perl-5.18.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/sbin:/gsc/scripts/sbin:/gsc/sbin:/gscuser/thepler/bin:/home/archive/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/thepler/bin
    PERLBREW_BASHRC_VERSION=0.64
    PERLBREW_HOME=/Users/thepler/.perlbrew
    PERLBREW_MANPATH=/Users/thepler/perl5/perlbrew/perls/perl-5.18.0/man

PERLBREW_PATH=/Users/thepler/perl5/perlbrew/bin:/Users/thepler/perl5/perlbrew/perls/perl-5.18.0/bin
    PERLBREW_PERL=perl-5.18.0
    PERLBREW_ROOT=/Users/thepler/perl5/perlbrew
    PERLBREW_VERSION=0.64
    PERL_BADLANG (unset)
    SHELL=/bin/bash






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