-
Notifications
You must be signed in to change notification settings - Fork 603
Open
Description
Description
Perl detects Deep recursions:
$ cat t.pl
use v5.41;
sub t{ __SUB__->() }
t();
$ perl t.pl
Deep recursion on subroutine "main::t" at t.pl line 3.But it does not do this for subroutines from overload::.
Steps to Reproduce
$ cat t.pl
package X;
use overload
'""' => sub{ "" .$_[0] },
'+' => sub{ 0 +$_[0] };
package main;
"". bless {}, 'X';
0+ bless {}, 'X';
$ perl t.pl
Segmentation faultExpected behavior
Perl should detect Deep recursion for subroutines from overload::. Probably it does not detect it due to pragmas. If this check will cause slowdown of runtime execution, then a better solution could be to track Deep recursion only when -d is enabled.
References
I am not sure, it seems this is a different issue, but probably related to: #24001
Perl configuration
Summary of my perl5 (revision 5 version 41 subversion 2) configuration:
Platform:
osname=linux
osvers=6.5.0-1027-oem
archname=x86_64-linux
uname='linux work 6.5.0-1027-oem #28-ubuntu smp preempt_dynamic thu jul 25 13:32:46 utc 2024 x86_64 x86_64 x86_64 gnulinux '
config_args='-de -Dprefix=/home/kes/perl5/perlbrew/perls/perl-5.41.2 -Dusedevel -Aeval:scriptdir=/home/kes/perl5/perlbrew/perls/perl-5.41.2/bin'
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='cc'
ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
optimize='-O2'
cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
ccversion=''
gccversion='13.1.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/x86_64-linux-gnu /usr/lib /usr/lib64
libs=-lpthread -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc
libc=/lib/x86_64-linux-gnu/libc.so.6
so=so
useshrplib=false
libperl=libperl.a
gnulibc_version='2.35'
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'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_LONG_DOUBLE
HAS_STRTOLD
HAS_TIMES
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_SIPHASH13
PERL_HASH_USE_SBOX32
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
PERL_USE_DEVEL
PERL_USE_SAFE_PUTENV
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
Built under linux
Compiled at Aug 17 2024 19:35:18
%ENV:
PERLBREW="command perlbrew"
PERLBREW_HOME="/home/kes/.perlbrew"
PERLBREW_MANPATH="/home/kes/perl5/perlbrew/perls/perl-5.41.2/man"
PERLBREW_PATH="/home/kes/perl5/perlbrew/bin:/home/kes/perl5/perlbrew/perls/perl-5.41.2/bin"
PERLBREW_PERL="perl-5.41.2"
PERLBREW_ROOT="/home/kes/perl5/perlbrew"
PERLBREW_SHELLRC_VERSION="0.98"
PERLBREW_VERSION="0.98"
@INC:
/home/kes/perl5/perlbrew/perls/perl-5.41.2/lib/site_perl/5.41.2/x86_64-linux
/home/kes/perl5/perlbrew/perls/perl-5.41.2/lib/site_perl/5.41.2
/home/kes/perl5/perlbrew/perls/perl-5.41.2/lib/5.41.2/x86_64-linux
/home/kes/perl5/perlbrew/perls/perl-5.41.2/lib/5.41.2
Metadata
Metadata
Assignees
Labels
No labels