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

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

January 4, 2001 18:22
[ID 20010104.011] B::C compiled perl fails to execute END{} blocks
Message ID:

This is a bug report for perl from,
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
    print "This is main.\n";
    END { print "END.\n"; }

    % ./perl5.7.0/bin/perl -MO=C,-O2,-v,-o/tmp/
    Starting compile
    Walking tree
    Saving methods
    Writing output
    Total number of OPs processed: 0
    NULLOP count:
    Loaded B
    Loaded IO
    Loaded Fcntl 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/  -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 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.

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:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos dlsun469 5.6 generic_105181-16 sun4u sparc sunw,ultra-1 '
    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
    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/, 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:

Environment for perl v5.7.0:
    LANG (unset)
    LANGUAGE (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About