Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs on destructors are inaccurate #14083

Closed
p5pRT opened this issue Sep 10, 2014 · 11 comments
Closed

Docs on destructors are inaccurate #14083

p5pRT opened this issue Sep 10, 2014 · 11 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 10, 2014

Migrated from rt.perl.org#122753 (status was 'resolved')

Searchable as RT122753$

@p5pRT
Copy link
Author

p5pRT commented Sep 10, 2014

From @FGasper

Created by @FGasper

http​://perldoc.perl.org/perlobj.html#Destructors

The above describes perl 5.12's behavior of populating $@​ on a die()
within a DESTROY within an eval {}. Also, it says nothing is written
to STDOUT.

This behavior has not been the case since 5.14; as of 5.14, $@​ is not
populated, and a warn() is indeed thrown.

Perl Info

Flags:
    category=docs
    severity=low

Site configuration information for perl 5.14.4:

Configured by cPanel at Thu Jul 10 15:51:11 CDT 2014.

Summary of my perl5 (revision 5 version 14 subversion 4) configuration:
   
  Platform:
    osname=linux, osvers=2.6.32-358.23.2.el6.i686, archname=i386-linux-64int
    uname='linux rpmb-32-centos-6 2.6.32-358.23.2.el6.i686 #1 smp wed oct 16 17:21:31 utc 2013 i686 i686 i386 gnulinux '
    config_args='-des -Dusedevel -Darchname=i386-linux-64int -Dcc=/usr/bin/gcc -Dcpp=/usr/bin/cpp -DDEBUGGING=none -Doptimize=-Os -Dusemymalloc=n -Duseshrplib -Duselargefiles=yes -Duseposix=true -Dhint=recommended -Duseperlio=yes -Dccflags=-I/usr/local/cpanel/3rdparty/perl/514/include -L/usr/local/cpanel/3rdparty/perl/514/lib -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib -DAPPLLIB_EXP="/usr/local/cpanel" -Dcppflags=-I/usr/local/cpanel/3rdparty/perl/514/include -L/usr/local/cpanel/3rdparty/perl/514/lib -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib -Dldflags=-Wl,-rpath -Wl,/usr/local/cpanel/3rdparty/perl/514/lib -L/usr/local/cpanel/3rdparty/perl/514/lib -L/usr/local/cpanel/3rdparty/lib -Dprefix=/usr/local/cpanel/3rdparty/perl/514 -Dsiteprefix=/opt/cpanel/perl5/514 -Dsitebin=/opt/cpanel/perl5/514/bin -Dsitelib=/opt/cpanel/perl5/514/site_lib -Dusevendorprefix=true -Dvendorbin=/usr/local/cpanel/3rdparty/perl/514/bin -Dvendorprefix=/usr/local/cpanel/3rdparty/perl/514/lib/perl5 -Dvendorlib=/usr/local/cpanel/3rdparty/perl/514/lib/perl5/cpanel_lib -Dprivlib=/usr/local/cpanel/3rdparty/perl/514/lib/perl5/5.14.4 -Dman1dir=none -Dman3dir=none -Dscriptdir=/usr/local/cpanel/3rdparty/perl/514/bin -Dscriptdirexp=/usr/local/cpanel/3rdparty/perl/514/bin -Dsiteman1dir=none -Dsiteman3dir=none -Dinstallman1dir=none -Dversiononly=no -Dinstallusrbinperl=no -Dcf_by=cPanel -Dmyhostname=localhost -Dperladmin=root@localhost -Dcf_email=support@cpanel.net -Di_dbm=/usr/local/cpanel/3rdparty/include -Di_gdbm=/usr/local/cpanel/3rdparty/include -Di_ndbm=/usr/local/cpanel/3rdparty/include -Ud_dosuid -Uuserelocatableinc -Umad -Uusethreads -Uusemultiplicity -Uusesocks -Uuselongdouble -Ui_db -Aldflags=-L/usr/local/cpanel/3rdparty/perl/514/lib -L/usr/local/cpanel/3rdparty/lib -L/usr/lib -L/lib -lgdbm -Dlocincpth=/usr/local/cpanel/3rdparty/perl/514/include /usr/local/cpanel/3rdparty/include /usr/local/include  -Duse64bitint -Uuse64bitall -Acflags=-fPIC -DPIC -m32 -I/usr/local/cpanel/3rdparty/perl/514/include -I/usr/local/cpanel/3rdparty/include -Dlibpth=/usr/local/cpanel/3rdparty/perl/514/lib /usr/local/cpanel/3rdparty/lib /usr/local/lib /lib /usr/lib '
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='/usr/bin/gcc', ccflags ='-I/usr/local/cpanel/3rdparty/perl/514/include -L/usr/local/cpanel/3rdparty/perl/514/lib -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib -DAPPLLIB_EXP="/usr/local/cpanel" -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-Os',
    cppflags='-I/usr/local/cpanel/3rdparty/perl/514/include -L/usr/local/cpanel/3rdparty/perl/514/lib -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib -I/usr/local/cpanel/3rdparty/perl/514/include -L/usr/local/cpanel/3rdparty/perl/514/lib -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib -DAPPLLIB_EXP="/usr/local/cpanel" -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.7 20120313 (Red Hat 4.4.7-3)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='/usr/bin/gcc', ldflags ='-Wl,-rpath -Wl,/usr/local/cpanel/3rdparty/perl/514/lib -L/usr/local/cpanel/3rdparty/perl/514/lib -L/usr/local/cpanel/3rdparty/lib -L/usr/local/cpanel/3rdparty/perl/514/lib -L/usr/local/cpanel/3rdparty/lib -L/usr/lib -L/lib -lgdbm -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.12.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.12'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/local/cpanel/3rdparty/perl/514/lib/perl5/5.14.4/i386-linux-64int/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -Os -L/usr/local/cpanel/3rdparty/perl/514/lib -L/usr/local/cpanel/3rdparty/lib -L/usr/lib -L/lib -L/usr/local/lib -fstack-protector'

Locally applied patches:
    cPanel patches
    cPanel INC path changes
    Disabled some unstable tests on a kvm build server
    Cherry pick of 49498ca from p5p (RT 113514)
    Remove improper use of each() in B::walksymtable (5cc8528c90)


@INC for perl 5.14.4:
    /usr/local/cpanel
    /usr/local/cpanel
    /usr/local/cpanel/3rdparty/perl/514/lib/perl5/cpanel_lib/i386-linux-64int
    /usr/local/cpanel/3rdparty/perl/514/lib/perl5/cpanel_lib
    /usr/local/cpanel/3rdparty/perl/514/lib/perl5/5.14.4/i386-linux-64int
    /usr/local/cpanel/3rdparty/perl/514/lib/perl5/5.14.4
    /opt/cpanel/perl5/514/site_lib/i386-linux-64int
    /opt/cpanel/perl5/514/site_lib
    .


Environment for perl 5.14.4:
    HOME=/root
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/root/.opt/bin:/usr/local/cpanel/3rdparty/perl/514/bin:/usr/local/cpanel/3rdparty/bin:/usr/local/cpanel/3rdparty/node/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    PERL5LIB=/usr/local/cpanel
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Sep 10, 2014

From @FGasper

Example script that demonstrates the issue​:

==========================
#!/usr/bin/perl

use strict;
use warnings;

package Finally;

sub new {
  my ( $class, $todo_cr ) = @​_;

  return bless [$todo_cr], $class;
}

sub DESTROY {
  my ($self) = @​_;
  return $self->[0]->();
}

#----------------------------------------------------------------------

package main;

use strict;
use warnings;

print "Perl​: $^V$/";

eval {
  do {
  my $finally = Finally->new( sub { print "die!"; die "haha" } );
  };

  print "err in​: $@​";
};

print "err out​: $@​";

=======================

On 9/10/14 2​:21 PM, perlbug-followup@​perl.org wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a perl bug report regarding​:
"Docs on destructors are inaccurate".

There is no need to reply to this message right now. Your ticket has been
assigned an ID of [perl #122753].

You can view your ticket at
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122753

Within the next 24 to 72 hours, your message will be posted to the Perl 5 Porters mailing list. Please be patient!

Please include the string​:

\[perl \#122753\]

in the subject line of all future correspondence about this issue. To do so,
you may reply to this message (please delete unnecessary quotes and text.)

Thank you,
perlbug-followup@​perl.org

-------------------------------------------------------------------------
Reply-To​: felipe@​felipegasper.com
Received​: (qmail 26680 invoked by uid 225); 10 Sep 2014 19​:21​:48 -0000
Received​: (qmail 26676 invoked by alias); 10 Sep 2014 19​:21​:47 -0000
Received​: from ng1.cptxoffice.net (HELO felipe.dev.cpanel.net) (208.74.121.102) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 10 Sep 2014 12​:21​:45 -0700
Received​: from root by felipe.dev.cpanel.net with local (Exim 4.84) (envelope-from <felipe@​felipegasper.com>) id 1XRnSS-0007OQ-MF for perlbug@​perl.org; Wed, 10 Sep 2014 14​:21​:36 -0500
X-Spam-Status​: No, hits=-5.2 required=8.0 tests=BAYES_00,PERLBUG_CONF,SPF_SOFTFAIL,URIBL_BLOCKED
Date​: Wed, 10 Sep 2014 14​:21​:36 -0500
To​: perlbug@​perl.org
Subject​: Docs on destructors are inaccurate
X-Virus-Checked​: Checked
From felipe@​felipegasper.com Wed Sep 10 19​:21​:48 2014
X-Spam-Check-BY​: la.mx.develooper.com
Delivered-To​: rt-perl5@​rt.perl.org
Delivered-To​: perlbug@​perl.org
X-Get-Message-Sender-Via​: felipe.dev.cpanel.net​: sender_ident via received_protocol == local​: root/only user confirmed/virtual account not confirmed
X-Antiabuse​: This header was added to track abuse, please include it with any abuse report
X-Antiabuse​: Primary Hostname - felipe.dev.cpanel.net
X-Antiabuse​: Original Domain - perl.org
X-Antiabuse​: Originator/Caller UID/GID - [0 0] / [47 12]
X-Antiabuse​: Sender Address Domain - felipegasper.com
From​: felipe@​felipegasper.com
Message-ID​: <5.14.4_28242_1410376799@​felipe.dev.cpanel.net>
Return-Path​: <felipe@​felipegasper.com>
X-RT-Original-Encoding​: ascii
content-type​: text/plain; charset="utf-8"
X-RT-Interface​: Email

@p5pRT
Copy link
Author

p5pRT commented Sep 11, 2014

From @jkeenan

On Wed Sep 10 12​:21​:53 2014, felipe@​felipegasper.com wrote​:

This is a bug report for perl from felipe@​felipegasper.com,
generated with the help of perlbug 1.39 running under perl 5.14.4.

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

http​://perldoc.perl.org/perlobj.html#Destructors

The above describes perl 5.12's behavior of populating $@​ on a die()
within a DESTROY within an eval {}. Also, it says nothing is written
to STDOUT.

This behavior has not been the case since 5.14; as of 5.14, $@​ is not
populated, and a warn() is indeed thrown.

Other porters​: Is the OP's assertion that these docs are out-of-date correct?

Felipe​: Would you be able to submit a patch pulled against blead?

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Sep 11, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2014

From @FGasper

On 9/10/14 8​:24 PM, James E Keenan via RT wrote​:

Other porters​: Is the OP's assertion that these docs are out-of-date correct?

Felipe​: Would you be able to submit a patch pulled against blead?

I can submit, sure … do you mean in this RT, or via GitHub?

-F

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2014

From victor@vsespb.ru

duplicate https://rt.perl.org/Public/Bug/Display.html?id=121761

2014-09-12 20​:31 GMT+04​:00 Felipe Gasper <felipe@​felipegasper.com>​:

On 9/10/14 8​:24 PM, James E Keenan via RT wrote​:

Other porters​: Is the OP's assertion that these docs are out-of-date
correct?

Felipe​: Would you be able to submit a patch pulled against blead?

I can submit, sure … do you mean in this RT, or via GitHub?

-F

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2014

From @Leont

On Fri, Sep 12, 2014 at 6​:31 PM, Felipe Gasper <felipe@​felipegasper.com>
wrote​:

On 9/10/14 8​:24 PM, James E Keenan via RT wrote​:

Other porters​: Is the OP's assertion that these docs are out-of-date
correct?

Felipe​: Would you be able to submit a patch pulled against blead?

I can submit, sure … do you mean in this RT, or via GitHub?

RT is our bugtracker, so please post them here.

Leon

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2014

From @jkeenan

On Fri Sep 12 09​:31​:32 2014, felipe@​felipegasper.com wrote​:

On 9/10/14 8​:24 PM, James E Keenan via RT wrote​:

Other porters​: Is the OP's assertion that these docs are out-of-date
correct?

Felipe​: Would you be able to submit a patch pulled against blead?

I can submit, sure … do you mean in this RT, or via GitHub?

-F

RT. As an attachment either via the RT web site https://rt.perl.org or by attachment to response to perl5-porters mailing list.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Sep 12, 2014

From @FGasper

On 12 Sep 2014 5​:54 PM, James E Keenan via RT wrote​:

On Fri Sep 12 09​:31​:32 2014, felipe@​felipegasper.com wrote​:

On 9/10/14 8​:24 PM, James E Keenan via RT wrote​:

Other porters​: Is the OP's assertion that these docs are out-of-date
correct?

Felipe​: Would you be able to submit a patch pulled against blead?

I can submit, sure … do you mean in this RT, or via GitHub?

-F

RT. As an attachment either via the RT web site https://rt.perl.org or by attachment to response to perl5-porters mailing list.

A post earlier indicated that this RT is a dupe. The referent RT seems
to have been left in “limbo” … ?

-F

@p5pRT
Copy link
Author

p5pRT commented Dec 13, 2017

From zefram@fysh.org

Fixed in commit addf67e.

-zefram

@p5pRT
Copy link
Author

p5pRT commented Dec 13, 2017

@iabyn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant