develooper Front page | perl.perl5.porters | Postings from July 2016

[perl #128597] SEGV caused by isLEXWARN_off while PL_curcop isNULL(gp_free vs dounwind).

Thread Previous
From:
Hiroaki KOBAYASI
Date:
July 11, 2016 13:11
Subject:
[perl #128597] SEGV caused by isLEXWARN_off while PL_curcop isNULL(gp_free vs dounwind).
Message ID:
rt-4.0.18-21677-1468206012-1030.128597-75-0@perl.org
# New Ticket Created by  Hiroaki KOBAYASI 
# Please include the string:  [perl #128597]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128597 >



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


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

I found following script causes SEGV, in perl5.22 ~ blead 59a08c7 

  perl -e 'open my $fh, ">", \ (my $buf = ""); my $sub = eval q|sub {die}|; $sub->()'
  
Below is a backtrace from the blead:


  (gdb) run -Ilib -e 'open my $fh, ">", \ (my $buf = ""); my $sub = eval q|sub {die}|; $sub->()'
  Starting program: /home/hkoba/blob/src/perl5/perl -Ilib -e 'open my $fh, ">", \ (my $buf = ""); my $sub = eval q|sub {die}|; $sub->()'
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib64/libthread_db.so.1".
  Died at (eval 1) line 1.
  
  Program received signal SIGSEGV, Segmentation fault.
  0x0000000000562460 in Perl_ckwarn_d (w=5) at util.c:2072
  2072        if (isLEXWARN_off)
  (gdb) bt
  #0  0x0000000000562460 in Perl_ckwarn_d (w=5) at util.c:2072
  #1  0x0000000000483f8e in Perl_gp_free (gv=0xaa7178) at gv.c:2559
  #2  0x00000000005f89cc in Perl_sv_clear (orig_sv=0xaa7178) at sv.c:6593
  #3  0x00000000005fb108 in Perl_sv_free2 (sv=0xaa7178, rc=1) at sv.c:6962
  #4  0x00000000005c5049 in S_SvREFCNT_dec_NN (sv=0xaa7178) at inline.h:177
  #5  0x000000000060f0e0 in Perl_sv_unref_flags (ref=0xac5830, flags=5)
      at sv.c:10488
  #6  0x00000000005edf0b in Perl_sv_force_normal_flags (sv=0xac5830, flags=5)
      at sv.c:5222
  #7  0x000000000065a2a3 in Perl_leave_scope (base=0) at scope.c:1100
  #8  0x0000000000668096 in Perl_dounwind (cxix=-1) at pp_ctl.c:1527
  #9  0x000000000046ec90 in S_my_exit_jump () at perl.c:5191
  #10 0x000000000046eb00 in Perl_my_failure_exit () at perl.c:5178
  #11 0x0000000000669257 in Perl_die_unwind (msv=0xabc2d0) at pp_ctl.c:1744
  #12 0x0000000000561550 in Perl_croak_sv (baseex=0xabc360) at util.c:1758
  #13 0x0000000000561439 in Perl_die_sv (baseex=0xabc360) at util.c:1668
  #14 0x000000000068851e in Perl_pp_die () at pp_sys.c:523
  #15 0x000000000055b0a5 in Perl_runops_debug () at dump.c:2232
  #16 0x0000000000462ae0 in S_run_body (oldscope=1) at perl.c:2521
  #17 0x000000000046210b in perl_run (my_perl=0xaa5010) at perl.c:2444
  #18 0x000000000041efce in main (argc=4, argv=0x7fffffffda28,
      env=0x7fffffffda50) at perlmain.c:123
  (gdb)
  


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=high
---
Site configuration information for perl 5.22.2:

Configured by hkoba at Tue Jun 14 14:28:25 JST 2016.

Summary of my perl5 (revision 5 version 22 subversion 2) configuration:
   
  Platform:
    osname=linux, osvers=4.4.11-200.fc22.x86_64, archname=x86_64-linux
    uname='linux chaika.localdomain 4.4.11-200.fc22.x86_64 #1 smp tue may 24 00:20:46 utc 2016 x86_64 x86_64 x86_64 gnulinux '
    config_args='-Dprefix=/home/hkoba/db/perl5/plenv/versions/5.22.2 -de -Dusedevel -A'eval:scriptdir=/home/hkoba/db/perl5/plenv/versions/5.22.2/bin''
    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-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2',
    optimize='-O2',
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion='', gccversion='5.3.1 20160406 (Red Hat 5.3.1-6)', 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-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.21.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.21'
  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-strong'

Locally applied patches:
    Devel::PatchPerl 1.40

---
@INC for perl 5.22.2:
    /home/hkoba/db/opam/dot.opam/4.02.0/lib/perl5
    /home/hkoba/.opam/4.02.0/lib/perl5
    /home/hkoba/db/perl5/plenv/versions/5.22.2/lib/site_perl/5.22.2/x86_64-linux
    /home/hkoba/db/perl5/plenv/versions/5.22.2/lib/site_perl/5.22.2
    /home/hkoba/db/perl5/plenv/versions/5.22.2/lib/5.22.2/x86_64-linux
    /home/hkoba/db/perl5/plenv/versions/5.22.2/lib/5.22.2
    .

---
Environment for perl 5.22.2:
    HOME=/home/hkoba
    LANG=ja_JP.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/hkoba/db/perl5/plenv/versions/5.22.2/bin:/home/hkoba/db/perl5/.plenv/libexec:/home/hkoba/db/perl5/plenv/plugins/perl-build/bin:/home/hkoba/db/opam/dot.opam/4.02.0/bin:/home/hkoba/db/perl5/plenv/shims:/home/hkoba/db/perl5/.plenv/bin:/home/hkoba/.opam/4.02.0/bin:/home/hkoba/db/tools/nodebrew/current/bin:/home/ssri/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/hkoba/bin:/home/hkoba/Local/bin:/home/hkoba/Configs/bin:/home/hkoba/Configs/common/bin:/home/hkoba/mytools:/home/hkoba/db/bin:/home/hkoba/db/mytools:/home/hkoba/db/mykit/bin:/home/hkoba/db/opam:/home/hkoba/db/tools/android-ndk:/home/hkoba/db/src/perl6/rakudobrew/bin/
    PERL5LIB=/home/hkoba/db/opam/dot.opam/4.02.0/lib/perl5:/home/hkoba/.opam/4.02.0/lib/perl5
    PERL_BADLANG (unset)
    SHELL=/bin/zsh


Thread Previous


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