develooper Front page | perl.perl5.porters | Postings from November 2010

[perl #79828] STDERR isn't being unlocalized when there's an unhandled exception.

Thread Next
From:
Elliot Shank
Date:
November 27, 2010 08:52
Subject:
[perl #79828] STDERR isn't being unlocalized when there's an unhandled exception.
Message ID:
rt-3.6.HEAD-13564-1290796287-1812.79828-75-0@perl.org
# New Ticket Created by  Elliot Shank 
# Please include the string:  [perl #79828]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=79828 >


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


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

STDERR isn't being unlocalized when there's an unhandled exception.  For
example,

     perl -E 'open my $h, ">", \$string; local *STDERR = $h; die "blah"'

doesn't emit anything.  That's global scope you say?  The following shows the
same problem:

     sub foo {
         die q<why doesn't this show up?>;
     }

     sub bar {
         my $x;
         open my $h, '>', \$x;
         local *STDERR = $h;
         foo();
     }

     bar();

I expect STDERR to be delocalized before final exeption handling kicks in.
It's as if the lexical scope isn't being left.



[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
     category=core
     severity=low
---
Site configuration information for perl 5.12.2:

Configured by elliot at Wed Sep  8 10:15:25 CDT 2010.

Summary of my perl5 (revision 5 version 12 subversion 2) configuration:
    
   Platform:
     osname=darwin, osvers=10.4.0, archname=darwin-thread-multi-ld-2level
     uname='darwin emdaer.local 10.4.0 darwin kernel version 10.4.0: fri apr 23 18:27:12 pdt 2010; root:xnu-1504.7.4~1release_x86_64 x86_64 i386 '
     config_args='-des -Dusedtrace -Duse64bitint -Duse64bitall -Duselongdouble -Dusethreads -A define:cf_email=perl@galumph.com -A define:perladmin=perl@galumph.com -Dprefix=/usr/local/perl/5.12.2-64-threads'
     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=define
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -arch x86_64 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
     optimize='-O3',
     cppflags='-no-cpp-precomp -arch x86_64 -fno-common -DPERL_DARWIN -no-cpp-precomp -arch x86_64 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
     ccversion='', gccversion='4.2.1 (Apple Inc. build 5664)', 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='long double', nvsize=16, Off_t='off_t', lseeksize=8
     alignbytes=8, prototype=define
   Linker and Libraries:
     ld='env MACOSX_DEPLOYMENT_TARGET=10.6 cc -arch x86_64', ldflags =' -arch x86_64 -fstack-protector -L/usr/local/lib'
     libpth=/usr/local/lib /usr/lib
     libs=-ldbm -ldl -lm -lutil -lc
     perllibs=-ldl -lm -lutil -lc
     libc=/usr/lib/libc.dylib, 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.12.2:
     /Users/elliot/opt/perl/install/default-5.12.2-64-threads/lib/perl5/darwin-thread-multi-ld-2level
     /Users/elliot/opt/perl/install/default-5.12.2-64-threads/lib/perl5
     /usr/local/perl/5.12.2-64-threads/lib/site_perl/5.12.2/darwin-thread-multi-ld-2level
     /usr/local/perl/5.12.2-64-threads/lib/site_perl/5.12.2
     /usr/local/perl/5.12.2-64-threads/lib/5.12.2/darwin-thread-multi-ld-2level
     /usr/local/perl/5.12.2-64-threads/lib/5.12.2
     .

---
Environment for perl 5.12.2:
     DYLD_LIBRARY_PATH (unset)
     HOME=/Users/elliot
     LANG=en_US.UTF-8
     LANGUAGE (unset)
     LC_COLLATE=en_US.us-ascii
     LC_CTYPE=en_US.us-ascii
     LC_MESSAGES=en_US.us-ascii
     LC_MONETARY=en_US.us-ascii
     LC_NUMERIC=en_US.us-ascii
     LC_TIME=en_US.us-ascii
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
     PATH=/Users/elliot/bin:/Users/elliot/opt/bin:/Users/elliot/opt/perl/install/default-5.12.2-64-threads/bin:/usr/local/perl/5.12.2-64-threads/bin:/opt/subversion/bin:/usr/local/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/X11R6/bin
     PERL5LIB=/Users/elliot/opt/perl/install/default-5.12.2-64-threads/lib/perl5
     PERL_AUTOINSTALL=--defaultdeps
     PERL_BADLANG (unset)
     SHELL=/bin/bash


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