develooper Front page | perl.perl5.porters | Postings from March 2017

[perl #131046] [PATCH] Carp: Do not crash when reading @DB::args

Thread Next
From:
perlbug-followup
Date:
March 25, 2017 21:07
Subject:
[perl #131046] [PATCH] Carp: Do not crash when reading @DB::args
Message ID:
rt-4.0.24-19418-1490258360-194.131046-75-0@perl.org
# New Ticket Created by   
# Please include the string:  [perl #131046]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131046 >


This is a bug report for perl from pali@cpan.org,
generated with the help of perlbug 1.40 running under perl 5.25.10.


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

Trying to read values from array @DB::args can lead to perl fatal error
"Bizarre copy of ARRAY in scalar assignment". But missing, incomplete or
possible incorrect value in @DB::args is not a fatal error for Carp.

Carp is primary used for reporting warnings and errors from other modules,
so it should not crash perl when trying to print error message.

This patch safely iterates all elements of @DB::args array via eval { }
block and replace already freed scalars for Carp usage by string
"** argument not available anymore **".

This prevent crashing perl and allows to use Carp module. It it not a
proper fix but rather workaround for Carp module. At least it allows to
safely use Carp.

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


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=high
    Type=Patch
    PatchStatus=HasPatch
    module=Carp
---
Site configuration information for perl 5.25.10:

Configured by pali at Sat Jan 14 11:57:32 CET 2017.

Summary of my perl5 (revision 5 version 25 subversion 9) configuration:
  Derived from: 155408ed6773363ab605c3c786489765e35d4ec5
  Platform:
    osname=linux
    osvers=3.13.0-107-generic
    archname=x86_64-linux
    uname='linux pali 3.13.0-107-generic #154~precise1-ubuntu smp tue dec 20 10:36:28 utc 2016 x86_64 x86_64 x86_64 gnulinux '
    config_args='-ds -e -Dprefix=/usr -Dusedevel'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='-O2'
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion=''
    gccversion='4.6.3'
    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='cc'
    ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.6/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
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.15.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.15'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches:
    uncommitted-changes

---
@INC for perl 5.25.10:
    lib
    /usr/lib/perl5/site_perl/5.25.9/x86_64-linux
    /usr/lib/perl5/site_perl/5.25.9
    /usr/lib/perl5/5.25.9/x86_64-linux
    /usr/lib/perl5/5.25.9

---
Environment for perl 5.25.10:
    HOME=/home/pali
    LANG=C
    LANGUAGE=C
    LD_LIBRARY_PATH=/usr/lib/i386-linux-gnu/
    LOGDIR (unset)
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    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