develooper Front page | perl.perl5.porters | Postings from January 2001

[ID 20010104.011] B::C compiled perl fails to execute END{} blocks

From:
dgoddard
Date:
January 4, 2001 18:22
Subject:
[ID 20010104.011] B::C compiled perl fails to execute END{} blocks
Message ID:
200101050222.SAA22254@dlsun469.us.oracle.com

This is a bug report for perl from Denis.Goddard@oracle.com,
generated with the help of perlbug 1.32 running under perl v5.7.0.


-----------------------------------------------------------------
According to 'perldoc B' and also the Camel Book, 3rd ed., table 18-1, a Perl program that is compiled into a native executable should execute END{} blocks during (or, just before the end of) runtime.

However, the following simple test shows that END{} bocks are in fact never executed:
    % cat tst.pl
    print "This is main.\n";
    END { print "END.\n"; }

    % ./perl5.7.0/bin/perl -MO=C,-O2,-v,-o/tmp/tst.pl.c tst.pl
    Starting compile
    Walking tree
    Prescan
    Saving methods
    Writing output
    Total number of OPs processed: 0
    NULLOP count:
    Loaded B
    Loaded IO
    Loaded Fcntl
    tst.pl syntax OK
    cc -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/dgoddard/Perl/perl5.7.0/lib/5.7.0/sun4-solaris/CORE -o tst.exe /tmp/tst.pl.c  -L/usr/local/lib  /home/dgoddard/Perl/perl5.7.0/lib/5.7.0/sun4-solaris/CORE/libperl.a  -L/lib  -L/usr/local/lib /home/dgoddard/Perl/perl5.7.0/lib/5.7.0/sun4-solaris/auto/DynaLoader/DynaLoader.a -lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt -lsec

    % ./tst.exe
    This is main.

I recall that in perl version 5.0056, the POD for B.pm expressly stated that END blocks would never get executed, but the Camel Book and newer PODs seem to suggest that this should no longer be the case. So, it's either a doc bug or a B bug.

Thanks,
-Denis
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl v5.7.0:

Configured by dgoddard at Thu Jan  4 15:27:09 PST 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos dlsun469 5.6 generic_105181-16 sun4u sparc sunw,ultra-1 '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O', cppflags='-I/usr/local/include'
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    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/usr/local/lib '
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -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/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.7.0:
    /home/dgoddard/Perl/perl5.7.0/lib/5.7.0/sun4-solaris
    /home/dgoddard/Perl/perl5.7.0/lib/5.7.0
    /home/dgoddard/Perl/perl5.7.0/lib/site_perl/5.7.0/sun4-solaris
    /home/dgoddard/Perl/perl5.7.0/lib/site_perl/5.7.0
    /home/dgoddard/Perl/perl5.7.0/lib/site_perl
    .

---
Environment for perl v5.7.0:
    HOME=/home/dgoddard
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/dt/lib:/usr/lib:/usr/local/lib:/usr/dt/lib:/usr/openwin/lib:/usr/ucblib:/opt/SUNWspro/lib:/usr/ccs/lib:/usr/openwin/lib:/usr/ucblib
    LOGDIR (unset)
    PATH=.:/bin:/usr/bin:/usr/sbin:/etc:/usr/ccs/bin:/usr/atria/bin:/usr/local/bin:/usr/dt/bin:/usr/openwin/bin:/home/dgoddard/bin:/opt/SUNWspro/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh




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