develooper Front page | perl.perl5.porters | Postings from April 2015

[perl #124370] [PATCH] add warnings 7fatal testcase for #123398

From:
rurban @ cpanel . net
Date:
April 23, 2015 11:08
Subject:
[perl #124370] [PATCH] add warnings 7fatal testcase for #123398
Message ID:
rt-4.0.18-21962-1429787249-1734.124370-75-0@perl.org
# New Ticket Created by  rurban@cpanel.net 
# Please include the string:  [perl #124370]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=124370 >



This is a bug report for perl from rurban@cpanel.net,
generated with the help of perlbug 1.40 running under perl 5.21.9.

>From 09488421cf4af21111fabf99d97ddfa984c5e26d Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@cpanel.net>
Date: Thu, 23 Apr 2015 13:04:05 +0200
Subject: [PATCH] add warnings 7fatal testcase for #123398

---
 t/lib/warnings/7fatal | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git t/lib/warnings/7fatal t/lib/warnings/7fatal
index 87f3fd0..40c649f 100644
--- t/lib/warnings/7fatal
+++ t/lib/warnings/7fatal
@@ -548,3 +548,21 @@ syntax error at - line 4, near "1 {"
 "my" variable $x masks earlier declaration in same statement at - line 6.
 syntax error at - line 7, near "}"
 Execution of - aborted due to compilation errors.
+########
+
+# fatal warnings in DESTROY should be made non-fatal [perl #123398]
+# This test will blow up your memory with SEGV without the patch
+package Foo;
+use strict; use utf8; use warnings FATAL => 'all';
+sub new {
+    return bless{ 'field' => undef }, 'Foo';
+}
+sub DESTROY {
+    my $self = shift;
+    $self->{'field'}->missing_method;
+}
+package main;
+my $foo = new Foo;
+undef($foo);
+EXPECT
+	(in cleanup) Can't call method "missing_method" on an undefined value at - line 11.
-- 
2.1.4

---
Flags:
    category=library
    severity=medium
    module=warnings
---
Site configuration information for perl 5.21.9:

Configured by rurban at Mon Feb 16 13:23:45 CET 2015.

Summary of my perl5 (revision 5 version 21 subversion 9) configuration:
  Commit id: 87c3212bd01880fc80afc73aaa8ab52ad0fdc7db
  Platform:
    osname=linux, osvers=3.16.0-4-amd64, archname=x86_64-linux
    uname='linux reini 3.16.0-4-amd64 #1 smp debian 3.16.7-ckt2-1 (2014-12-08) x86_64 gnulinux '
    config_args='-sder -Dusedevel -DDEBUGGING -Dcc=ccache gcc-5.0 -Accflags=-mcrc32 -march=native -Dinstallman1dir=none -Dinstallman3dir=none -Dinstallsiteman1dir=none -Dinstallsiteman3dir=none -Doptimize=-O2 -g3 -Accflags=-DPERL_HASH_FUNC_ONE_AT_A_TIME_HARD'
    hint=previous, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='ccache gcc-5.0', ccflags ='-DPERL_HASH_FUNC_ONE_AT_A_TIME_HARD -mcrc32 -march=native -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fwrapv',
    optimize='-O2 -g3',
    cppflags='-mcrc32 -march=native -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -DPERL_HASH_FUNC_ONE_AT_A_TIME_HARD -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -fwrapv'
    ccversion='', gccversion='5.0.0 20150103 (experimental)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='ccache gcc-5.0', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64 /usr/local/lib64 /usr/local/lib /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/include-fixed /usr/include/x86_64-linux-gnu /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.19'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g3 -L/usr/local/lib -fstack-protector'


---
@INC for perl 5.21.9:
    lib
    /usr/local/lib/perl5/site_perl/5.19.11/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.19.11
    /usr/local/lib/perl5/5.19.11/x86_64-linux
    /usr/local/lib/perl5/5.19.11
    .

---
Environment for perl 5.21.9:
    HOME=/home/rurban
    LANG=en_US.utf8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/rurban/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
    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