Closed
Description
Description
With bleadperl v5.41.8-98-gb9eeeef8c0 tests for DRCLAW/Export-These-v0.2.1.tar.gz have started to fail. Sample fail report: http://www.cpantesters.org/cpan/report/7e18d7fa-f893-11ef-a941-f437572b0c47
Bisect says:
b9eeeef8c043fb0238a07e64636815bf327a6562 is the first bad commit
commit b9eeeef8c043fb0238a07e64636815bf327a6562
Author: Lukas Mai <lukasmai.403@gmail.com>
Date: Fri Feb 14 21:49:03 2025 +0100
op.c: re-enable coderef-in-stash optimization
When seeing 'sub foo { ... }', perl does not need to allocate a full
typeglob (with the subroutine being stored in the CODE slot). Instead,
it can just store a coderef directly in the stash.
This optimization was first announced in perl5220delta:
> - Subroutines in packages no longer need to be stored in typeglobs:
> declaring a subroutine will now put a simple sub reference directly
> in the stash if possible, saving memory. The typeglob still
> notionally exists, so accessing it will cause the stash entry to be
> upgraded to a typeglob (i.e. this is just an internal implementation
> detail). This optimization does not currently apply to XSUBs or
> exported subroutines, and method calls will undo it, since they
> cache things in typeglobs. [GH #13392]
However, due to a bug this optimization didn't actually work except for
package main (GH #15671). The issue was fixed in v5.27.5, but the fix
was backed out again in v5.27.9 because of CPAN breakage.
This patch re-enables the optimization because I want to see what the
current state of CPAN breakage is.
op.c | 3 ---
t/op/sub.t | 5 +----
2 files changed, 1 insertion(+), 7 deletions(-)
bisect found first bad commit
Steps to Reproduce
cpan -i DRCLAW/Export-These-v0.2.1.tar.gz
Expected behavior
Was passing tests up to v5.41.8-97-g7fdc8f34fd
Perl configuration
# perl -V output goes here
Summary of my perl5 (revision 5 version 41 subversion 9) configuration:
Commit id: b6969eb9f23724dcbb888d791d31c4708dabc85c
Platform:
osname=linux
osvers=6.8.12-amd64
archname=x86_64-linux-multi
uname='linux k93msid 6.8.12-amd64 #1 smp preempt_dynamic debian 6.8.12-1 (2024-05-31) x86_64 gnulinux '
config_args='-Dprefix=/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.41.9/4da5 -Dmyhostname=k93msid -Dinstallusrbinperl=n -Uversiononly -Dusedevel -des -Ui_db -Dlibswanted=cl pthread socket inet nsl gdbm dbm malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat -Uuseithreads -Uuselongdouble -DEBUGGING=both -Dusemultiplicity'
hint=recommended
useposix=true
d_sigaction=define
useithreads=undef
usemultiplicity=define
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
Compiler:
cc='cc'
ccflags ='-fwrapv -DDEBUGGING -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 -g'
cppflags='-fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
ccversion=''
gccversion='13.3.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.38'
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=so
d_dlsymun=undef
ccdlflags='-Wl,-E'
cccdlflags='-fPIC'
lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
DEBUGGING
HAS_LONG_DOUBLE
HAS_STRTOLD
HAS_TIMES
MULTIPLICITY
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_TRACK_MEMPOOL
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
USE_REENTRANT_API
Built under linux
Compiled at Feb 24 2025 17:29:10
%ENV:
PERL5LIB=""
PERL5OPT=""
PERL5_CPANPLUS_IS_RUNNING="4102518"
PERL5_CPAN_IS_RUNNING="4102518"
PERL_CANARY_STABILITY_NOPROMPT="1"
PERL_MM_USE_DEFAULT="1"
PERL_USE_UNSAFE_INC="1"
@INC:
/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.41.9/4da5/lib/site_perl/5.41.9/x86_64-linux-multi
/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.41.9/4da5/lib/site_perl/5.41.9
/home/sand/src/perl/repoperls/installed-perls/host/k93msid/v5.41.9/4da5/lib/5.41.9/x86_64-linux-multi
/home/sand/src/perl/rep