Skip to content

Instantly share code, notes, and snippets.

@robbat2
Created November 18, 2021 06:14
Show Gist options
  • Select an option

  • Save robbat2/24250285cd9f0c126b39460fb4c88af5 to your computer and use it in GitHub Desktop.

Select an option

Save robbat2/24250285cd9f0c126b39460fb4c88af5 to your computer and use it in GitHub Desktop.
perl segfault 2021/11/17
#!/usr/bin/perl -w
# The -w is required to trigger the segfault
# Copyright 2021/11/17 Robin H. Johnson <robbat2@gentoo.org>
# Public domain
my $v = undef;
my $c = undef;
my %x;
$x{$v} = '';
$x{$v} .= ' '.$c; # crash
$ perl testscript.pl
Use of uninitialized value $v in hash element at testscript.pl line 8.
Use of uninitialized value $v in hash element at testscript.pl line 9.
Segmentation fault
Summary of my perl5 (revision 5 version 34 subversion 0) configuration:
Platform:
osname=linux
osvers=5.14.5-x86_64-00001-g24d365d50a37
archname=x86_64-linux
uname='linux localhost 5.14.5-x86_64-00001-g24d365d50a37 #88 smp fri sep 17 22:30:09 pdt 2021 x86_64 amd ryzen 7 3700x 8-core processor authenticamd gnulinux '
config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n -Ui_xlocale -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none -Dgentoolibdirs=/usr/lib64/perl5/5.32:/usr/lib64/perl5/vendor_perl/5.32:/usr/lib64/perl5/vendor_perl/5.30.0:/usr/lib64/perl5/vendor_perl/5.26.2:/usr/local/lib64/perl5/5.24.2:/usr/lib64/perl5/5.24.0:/usr/lib64/perl5/vendor_perl/5.24.0:/usr/lib64/perl5/vendor_perl/5.22.1:/usr/lib64/perl5/vendor_perl/5.20.1:/usr/lib64/perl5/vendor_perl/5.16.3:/usr/lib64/perl5/vendor_perl/5.16.1:/usr/lib64/perl5/vendor_perl/5.16.0:/usr/lib64/perl5/5.12.4:/usr/lib64/perl5/vendor_perl/5.12.4:/usr/lib64/perl5/5.12.3:/usr/lib64/perl5/vendor_perl/5.12.3:/usr/lib64/perl5/5.12.2:/usr/lib64/perl5/vendor_perl/5.12.2:/usr/lib64/perl5/5.8.8:/usr/lib64/perl5/vendor_perl/5.8.8: -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dnoextensions=ODBM_File -Duseshrplib -Darchname=x86_64-linux -Dcc=x86_64-pc-linux-gnu-gcc -Dar=x86_64-pc-linux-gnu-ar -Dnm=x86_64-pc-linux-gnu-nm -Dcpp=x86_64-pc-linux-gnu-gcc -E -Dranlib=x86_64-pc-linux-gnu-ranlib -Dccflags=-march=native -O2 -pipe -Doptimize=-march=native -O2 -pipe -Dldflags=-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Dprefix=/usr -Dsiteprefix=/usr/local -Dvendorprefix=/usr -Dscriptdir=/usr/bin -Dprivlib=/usr/lib64/perl5/5.34 -Darchlib=/usr/lib64/perl5/5.34/x86_64-linux -Dsitelib=/usr/local/lib64/perl5/5.34 -Dsitearch=/usr/local/lib64/perl5/5.34/x86_64-linux -Dvendorlib=/usr/lib64/perl5/vendor_perl/5.34 -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.34/x86_64-linux -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.34.0 -Dlocincpth=/usr/include -Dglibpth=/lib64 /usr/lib64 -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@localhost -Ud_csh -Dsh=/bin/sh -Dtargetsh=/bin/sh -Uusenm'
hint=recommended
useposix=true
d_sigaction=define
useithreads=undef
usemultiplicity=undef
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
Compiler:
cc='x86_64-pc-linux-gnu-gcc'
ccflags ='-march=native -O2 -pipe -fwrapv -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
optimize='-march=native -O2 -pipe'
cppflags='-march=native -O2 -pipe -fwrapv -fno-strict-aliasing'
ccversion=''
gccversion='11.2.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='x86_64-pc-linux-gnu-gcc'
ldflags ='-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0'
libpth=/usr/local/lib64 /lib64 /usr/lib64
libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
perllibs=-ldl -lm -lcrypt -lutil -lc
libc=libc-2.33.so
so=so
useshrplib=true
libperl=libperl.so.5.34.0
gnulibc_version='2.33'
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=so
d_dlsymun=undef
ccdlflags='-Wl,-E'
cccdlflags='-fPIC'
lddlflags='-shared -march=native -O2 -pipe -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_TIMES
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
USE_64_BIT_ALL
USE_64_BIT_INT
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
Locally applied patches:
0001-Fix-hpux-hints.patch
- Fix hpux hints
0002-aix-gcc-detection-and-shared-library-soname-support.patch
- aix gcc detection and shared library soname support
0003-cpan-ExtUtils-MakeMaker-drop-PORTAGE_TMPDIR-from-LD_.patch
- cpan/ExtUtils-MakeMaker: drop $PORTAGE_TMPDIR from LD_RUN_PATH
- Bug: https://bugs.gentoo.org/105054
0004-Remove-rpath-and-append-LDFLAGS-to-lddlflags.patch
- Remove -rpath and append LDFLAGS to lddlflags
0005-Add-headers-for-opensolaris.patch
- Add headers for opensolaris
0006-List-packaged-patches-in-patchlevel.h.patch
- List packaged patches for perl-5.34.0-r5(perl-5.34.0-patches-1) in patchlevel.h
- Bug: https://bugs.debian.org/567489
0007-Cleanup-PATH-and-shrpenv.patch
- Cleanup PATH and shrpenv
0008-Tweak-enc2xs-to-follow-symlinks-and-ignore-missing-I.patch
- Tweak enc2xs to follow symlinks and ignore missing @INC directories.
- Bug: https://bugs.debian.org/290336
0009-darwin-Use-CC-to-link.patch
- darwin: Use $CC to link
- Bug: https://bugs.gentoo.org/297751
0010-Provide-a-sensible-INSTALLDIRS-default-for-modules-i.patch
- Provide a sensible INSTALLDIRS default for modules installed from CPAN.
0011-Fix-interix-hints.patch
- Fix interix hints
0012-Set-libperl-soname.patch
- Set libperl soname
- Bug: https://bugs.gentoo.org/286840
0013-Add-etc-perl-to-INC.patch
- Add /etc/perl to @INC
0014-cpan-ExtUtils-MakeMaker-remove-targets-that-generate.patch
- cpan/ExtUtils-MakeMaker: remove targets that generate perllocal.pod
0015-Don-t-force-fstack-protector-on-everyone.patch
- Don't force -fstack-protector on everyone
- Bug: https://bugs.gentoo.org/348557
0016-Do-not-set-custom-CFLAGS-in-cpan-Digest-SHA.patch
- Do not set custom CFLAGS in cpan/Digest-SHA
- Bug: https://bugs.gentoo.org/506818
0017-Configure-Don-t-include-sources-in-usr-local-for-com.patch
- Configure: Don't include sources in /usr/local/ for compiling perl
0018-cpan-IO-Socket-IP-Disable-network-tests.patch
- cpan/IO-Socket-IP: Disable network tests
0019-Fix-EUMM-podlocal-tests.patch
- Fix EUMM podlocal tests
0020-Skip-auto-linking-nsl-and-cl.patch
- Skip auto-linking nsl and cl
- Bug: https://rt.perl.org/Public/Bug/Display.html?id=13148
0021-Disable-porting-tests-which-create-fun-false-failure.patch
- Disable porting tests which create fun false-failures all over travis
0022-Disable-PathTools-tests-which-fails-under-sandboxing.patch
- Disable PathTools tests which fails under sandboxing
- Bug: https://bugs.gentoo.org/645084
0023-Fix-CPAN-FirstTime-defaults-with-nonexisting-site-di.patch
- Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent is writable
- Bug: https://bugs.debian.org/688842
0024-Pass-LD-settings-through-to-subdirectories.patch
- Pass LD settings through to subdirectories
- Bug: https://bugs.debian.org/758471
0025-Memoize-Storable-respect-nstore-option-not-respected.patch
- Memoize::Storable: respect 'nstore' option not respected
- Bug: https://bugs.debian.org/587650
- Bug: https://rt.cpan.org/Public/Bug/Display.html?id=77790
0026-Better-errors-for-man-pages-from-standard-input.patch
- Better errors for man pages from standard input
- Bug: https://bugs.debian.org/777405
0027-Respect-umask-during-installation.patch
- Respect umask during installation
0028-Document-that-CCFLAGS-should-include-Config-ccflags.patch
- Document that CCFLAGS should include $Config{ccflags}
- Bug: https://bugs.debian.org/628522
- Bug: https://rt.cpan.org/Public/Bug/Display.html?id=68613
0029-Fix-parallel-building.patch
- Fix parallel building
0030-Add-support-for-Dgentoolibdirs.patch
- Add support for -Dgentoolibdirs
0101-Fix-build-with-gdb120.patch
- Fix GDBM_File to compile with version 1.20 and earlier
- Bug: https://bugs.gentoo.org/802945
Built under linux
Compiled at Nov 8 2021 13:24:31
@INC:
/etc/perl
/usr/local/lib64/perl5/5.34/x86_64-linux
/usr/local/lib64/perl5/5.34
/usr/lib64/perl5/vendor_perl/5.34/x86_64-linux
/usr/lib64/perl5/vendor_perl/5.34
/usr/lib64/perl5/5.34/x86_64-linux
/usr/lib64/perl5/5.34
/usr/lib64/perl5/5.32
/usr/lib64/perl5/vendor_perl/5.32
/usr/lib64/perl5/vendor_perl/5.30.0
/usr/lib64/perl5/vendor_perl/5.26.2
/usr/local/lib64/perl5/5.24.2
/usr/lib64/perl5/5.24.0
/usr/lib64/perl5/vendor_perl/5.24.0
/usr/lib64/perl5/vendor_perl/5.22.1
/usr/lib64/perl5/vendor_perl/5.20.1
/usr/lib64/perl5/vendor_perl/5.16.3
/usr/lib64/perl5/vendor_perl/5.16.1
/usr/lib64/perl5/vendor_perl/5.16.0
/usr/lib64/perl5/5.12.4
/usr/lib64/perl5/vendor_perl/5.12.4
/usr/lib64/perl5/5.12.3
/usr/lib64/perl5/vendor_perl/5.12.3
/usr/lib64/perl5/5.12.2
/usr/lib64/perl5/vendor_perl/5.12.2
/usr/lib64/perl5/5.8.8
/usr/lib64/perl5/vendor_perl/5.8.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment