develooper Front page | perl.perl5.porters | Postings from February 2021

perl drops core in S_sv_unmagicext_flags

Thread Next
From:
keni
Date:
February 8, 2021 08:38
Subject:
perl drops core in S_sv_unmagicext_flags
Message ID:
5.32.1_15646_1612747125@wings

This is a bug report for perl from keni@his.com,
generated with the help of perlbug 1.42 running under perl 5.32.1.


-----------------------------------------------------------------
The following demo code is enough to make perl drop core:
    map (   
	@q = split(/N/,$_),
	$q[0] => $q[1]
    ), @_

Seen in:
    5.26.1 on Ubuntu 18.04.5 LTS
    5.22.0 on MacOS 10.15.7
    5.32.1 on Ubuntu 18.04.5 LTS (gdb trace below is this configuration)


(gdb) run ../this_cores_perl.pl
Starting program: /home/keni/src/perl-5.32.1/perl ../this_cores_perl.pl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00005555556e57ee in S_sv_unmagicext_flags (sv=0x555555b6d758, type=60, 
    vtbl=0x0, flags=0) at sv.c:5901
5901		const MGVTBL* const virt = mg->mg_virtual;
(gdb) where
#0  0x00005555556e57ee in S_sv_unmagicext_flags (sv=0x555555b6d758, type=60, 
    vtbl=0x0, flags=0) at sv.c:5901
#1  0x00005555556e59a4 in Perl_sv_unmagic (sv=0x555555b6d758, type=60)
    at sv.c:5943
#2  0x00005555556e72b3 in Perl_sv_clear (orig_sv=0x555555b6d758) at sv.c:6640
#3  0x00005555556e8c6c in Perl_sv_free2 (sv=0x555555b6d758, rc=1) at sv.c:7132
#4  0x00005555557186f1 in Perl_SvREFCNT_dec (sv=0x555555b6d758) at inline.h:235
#5  0x000055555571ae23 in Perl_leave_scope (base=0) at scope.c:979
#6  0x0000555555718bff in Perl_pop_scope () at scope.c:130
#7  0x000055555572152b in Perl_pp_mapwhile () at pp_ctl.c:1113
#8  0x00005555556c43cf in Perl_runops_standard () at run.c:41
#9  0x00005555555d16ac in S_run_body (oldscope=1) at perl.c:2762
#10 0x00005555555d1254 in perl_run (my_perl=0x555555b6b260) at perl.c:2685
#11 0x000055555559f347 in main (argc=2, argv=0x7fffffffdfa8, 
    env=0x7fffffffdfc0) at perlmain.c:127

Let me know if you need anything else.

Thanks!
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
This perlbug was built using Perl 5.32.1 - Sun Feb  7 19:59:34 EST 2021
It is being executed now by  Perl 5.32.1 - Sun Feb  7 18:56:22 EST 2021.

Site configuration information for perl 5.32.1:

Configured by keni at Sun Feb  7 18:56:22 EST 2021.

Summary of my perl5 (revision 5 version 32 subversion 1) configuration:
   
  Platform:
    osname=linux
    osvers=5.4.0-60-generic
    archname=x86_64-linux
    uname='linux wings 5.4.0-60-generic #67~18.04.1-ubuntu smp tue jan 5 22:01:05 utc 2021 x86_64 x86_64 x86_64 gnulinux '
    config_args='-der'
    hint=previous
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    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'
    optimize='-Og'
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='7.5.0'
    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/gcc/x86_64-linux-gnu/7/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 /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.27.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.27'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -g -L/usr/local/lib -fstack-protector-strong'


---
@INC for perl 5.32.1:
    /home/keni/src/root/lib/perl5/site_perl/5.32.1/x86_64-linux
    /home/keni/src/root/lib/perl5/site_perl/5.32.1
    /home/keni/src/root/lib/perl5/5.32.1/x86_64-linux
    /home/keni/src/root/lib/perl5/5.32.1

---
Environment for perl 5.32.1:
    HOME=/home/keni
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    PERL_BADLANG (unset)
    SHELL=/usr/bin/tcsh

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